in memory amqp for dev and testing - spring-amqp

I am using rabbit in my services, but for restrictions I cant download on local. For that I want to use in memory broker and figured qpic can work. I have below configuration and in logs I can see qpid broker starts fine but when spring boot tries to send message it cant connect.
#Bean
Broker broker() throws Exception {
org.apache.qpid.server.Broker broker = new org.apache.qpid.server.Broker();
BrokerOptions brokerOptions = new BrokerOptions();
brokerOptions.setConfigProperty("qpid.amqp_port", "5672");
brokerOptions.setConfigProperty("qpid.broker.defaultPreferenceStoreAttributes", "{\"type\": \"Noop\"}");
brokerOptions.setConfigProperty("qpid.vhost", "/");
brokerOptions.setConfigurationStoreType("Memory");
brokerOptions.setStartupLoggedToSystemOut(false);
broker.startup(brokerOptions);
return broker;
}
in resource I have initial-config as below:
{
"name": "Embedded Test Broker",
"modelVersion": "6.1",
"authenticationproviders" : [{
"name": "password",
"type": "Plain",
"secureOnlyMechanisms": [],
"users": [{"name": "guest", "password": "guest", "type": "managed"}]
}],
"ports": [{
"name": "AMQP",
"port": "${qpid.amqp_port}",
"authenticationProvider": "password",
"protocols": [ "AMQP_0_9_1" ],
"transports": [ "TCP" ],
"virtualhostaliases": [{
"name": "${qpid.vhost}",
"type": "nameAlias"
}]
}],
"virtualhostnodes" : [{
"name": "${qpid.vhost}",
"type": "Memory",
"virtualHostInitialConfiguration": "{ \"type\": \"Memory\" }"
}]
}
Error I am getting
2018-08-15 19:55:07 CachingConnectionFactory - Attempting to connect to: [localhost:5672]
2018-08-15 19:55:07 NonBlockingConnection - Identified transport encryption as NONE
2018-08-15 19:55:07 NonBlockingConnection - Read 8 byte(s)
2018-08-15 19:55:07 TaskExecutorImpl - Submitting Task['create' on '/127.0.0.1:56891(?)'] to executor Broker-Config
2018-08-15 19:55:07 TaskExecutorImpl - Performing Task['create' on '/127.0.0.1:56891(?)']
2018-08-15 19:55:07 open - [con:2(/127.0.0.1:56891)] CON-1001 : Open : Destination : AMQP(127.0.0.1:5672) : Protocol Version : 0-9-1
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#3979d0 through executor interface
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#db842 through executor interface
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#4c9750 through executor interface
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ProtocolHeader [AMQP0091 ]
2018-08-15 19:55:07 TaskExecutorImpl - Task['create' on '/127.0.0.1:56891(?)'] performed successfully with result: null
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionStartBodyImpl: versionMajor=0, versionMinor=9, serverProperties={product=[LONG_STRING: qpid], version=[LONG_STRING: 6.1.1], qpid.build=[LONG_STRING: 1775107], qpid.instance_name=[LONG_STRING: Embedded Test Broker], qpid.close_when_no_route=[LONG_STRING: true], qpid.message_compression_supported=[LONG_STRING: true], qpid.confirmed_publish_supported=[LONG_STRING: true], qpid.virtualhost_properties_supported=[LONG_STRING: true], qpid.queue_lifetime_supported=[LONG_STRING: true]}, mechanisms=[80, 76, 65, 73, 78, 32, 67, 82, 65, 77, 45, 77, 68, 53, 32, 83, 67, 82, 65, 77, 45, 83, 72, 65, 45, 49, 32, 83, 67, 82, 65, 77, 45, 83, 72, 65, 45, 50, 53, 54], locales=[101, 110, 95, 85, 83]]
2018-08-15 19:55:07 FieldTable - FieldTable::writeToBuffer: Writing encoded length of 308...
2018-08-15 19:55:07 FieldTable - {product=[LONG_STRING: qpid], version=[LONG_STRING: 6.1.1], qpid.build=[LONG_STRING: 1775107], qpid.instance_name=[LONG_STRING: Embedded Test Broker], qpid.close_when_no_route=[LONG_STRING: true], qpid.message_compression_supported=[LONG_STRING: true], qpid.confirmed_publish_supported=[LONG_STRING: true], qpid.virtualhost_properties_supported=[LONG_STRING: true], qpid.queue_lifetime_supported=[LONG_STRING: true]}
2018-08-15 19:55:07 NonBlockingConnection - Written 379 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 443 byte(s)
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionStartOk[ clientProperties: {connection_name=[LONG_STRING: rabbitConnectionFactory#1800efd:1], product=[LONG_STRING: RabbitMQ], copyright=[LONG_STRING: Copyright (c) 2007-2017 Pivotal Software, Inc.], capabilities=[FIELD_TABLE: {exchange_exchange_bindings=[BOOLEAN: true], connection.blocked=[BOOLEAN: true], authentication_failure_close=[BOOLEAN: true], basic.nack=[BOOLEAN: true], publisher_confirms=[BOOLEAN: true], consumer_cancel_notify=[BOOLEAN: true]}], information=[LONG_STRING: Licensed under the MPL. See http://www.rabbitmq.com/], version=[LONG_STRING: 5.1.2], platform=[LONG_STRING: Java]} mechanism: PLAIN response: ******** locale: en_US ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SASL Mechanism selected: PLAIN Locale : en_US
2018-08-15 19:55:07 AMQPConnection_0_8Impl - Connected as: Subject:
Principal: guest
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionTuneBodyImpl: channelMax=256, frameMax=262136, heartbeat=0]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 1 ms.
2018-08-15 19:55:07 NonBlockingConnection - Written 20 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 36 byte(s)
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionTuneOk[ channelMax: 256 frameMax: 262136 heartbeat: 60 ]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 0 ms.
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionOpen[ virtualHost: / capabilities: null insist: false ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionCloseBodyImpl: replyCode=404, replyText=Unknown virtual host: '/', classId=10, methodId=40]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 0 ms.
2018-08-15 19:55:07 NonBlockingConnection - Written 44 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 12 byte(s)
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionCloseOk
2018-08-15 19:55:07 NonBlockingConnection - Closing /127.0.0.1:56891
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 1 ms.
2018-08-15 19:55:07 MultiVersionProtocolEngine - Closed
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable org.apache.qpid.server.transport.AbstractAMQPConnection$1#ddf89f through executor interface
2018-08-15 19:55:07 ForgivingExceptionHandler - An unexpected connection driver error occured
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readUnsignedByte(Unknown Source)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:580)
at java.lang.Thread.run(Unknown Source)
2018-08-15 19:55:07 NonBlockingConnection - Identified transport encryption as NONE
2018-08-15 19:55:07 close - [con:2(guest#/127.0.0.1:56891)] CON-1002 : Close
2018-08-15 19:55:07 NonBlockingConnection - Read 8 byte(s)
2018-08-15 19:55:07 TaskExecutorImpl - Submitting Task['create' on '/0:0:0:0:0:0:0:1:56892(?)'] to executor Broker-Config
2018-08-15 19:55:07 TaskExecutorImpl - Performing Task['create' on '/0:0:0:0:0:0:0:1:56892(?)']
2018-08-15 19:55:07 open - [con:3(/0:0:0:0:0:0:0:1:56892)] CON-1001 : Open : Destination : AMQP(0:0:0:0:0:0:0:1:5672) : Protocol Version : 0-9-1
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#146d207 through executor interface
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#1d1fae1 through executor interface
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable com.google.common.util.concurrent.Futures$6#ed29c3 through executor interface
2018-08-15 19:55:07 TaskExecutorImpl - Task['create' on '/0:0:0:0:0:0:0:1:56892(?)'] performed successfully with result: null
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ProtocolHeader [AMQP0091 ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionStartBodyImpl: versionMajor=0, versionMinor=9, serverProperties={product=[LONG_STRING: qpid], version=[LONG_STRING: 6.1.1], qpid.build=[LONG_STRING: 1775107], qpid.instance_name=[LONG_STRING: Embedded Test Broker], qpid.close_when_no_route=[LONG_STRING: true], qpid.message_compression_supported=[LONG_STRING: true], qpid.confirmed_publish_supported=[LONG_STRING: true], qpid.virtualhost_properties_supported=[LONG_STRING: true], qpid.queue_lifetime_supported=[LONG_STRING: true]}, mechanisms=[80, 76, 65, 73, 78, 32, 67, 82, 65, 77, 45, 77, 68, 53, 32, 83, 67, 82, 65, 77, 45, 83, 72, 65, 45, 49, 32, 83, 67, 82, 65, 77, 45, 83, 72, 65, 45, 50, 53, 54], locales=[101, 110, 95, 85, 83]]
2018-08-15 19:55:07 FieldTable - FieldTable::writeToBuffer: Writing encoded length of 308...
2018-08-15 19:55:07 FieldTable - {product=[LONG_STRING: qpid], version=[LONG_STRING: 6.1.1], qpid.build=[LONG_STRING: 1775107], qpid.instance_name=[LONG_STRING: Embedded Test Broker], qpid.close_when_no_route=[LONG_STRING: true], qpid.message_compression_supported=[LONG_STRING: true], qpid.confirmed_publish_supported=[LONG_STRING: true], qpid.virtualhost_properties_supported=[LONG_STRING: true], qpid.queue_lifetime_supported=[LONG_STRING: true]}
2018-08-15 19:55:07 NonBlockingConnection - Written 379 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 443 byte(s)
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionStartOk[ clientProperties: {connection_name=[LONG_STRING: rabbitConnectionFactory#1800efd:1], product=[LONG_STRING: RabbitMQ], copyright=[LONG_STRING: Copyright (c) 2007-2017 Pivotal Software, Inc.], capabilities=[FIELD_TABLE: {exchange_exchange_bindings=[BOOLEAN: true], connection.blocked=[BOOLEAN: true], authentication_failure_close=[BOOLEAN: true], basic.nack=[BOOLEAN: true], publisher_confirms=[BOOLEAN: true], consumer_cancel_notify=[BOOLEAN: true]}], information=[LONG_STRING: Licensed under the MPL. See http://www.rabbitmq.com/], version=[LONG_STRING: 5.1.2], platform=[LONG_STRING: Java]} mechanism: PLAIN response: ******** locale: en_US ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SASL Mechanism selected: PLAIN Locale : en_US
2018-08-15 19:55:07 AMQPConnection_0_8Impl - Connected as: Subject:
Principal: guest
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionTuneBodyImpl: channelMax=256, frameMax=262136, heartbeat=0]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 1 ms.
2018-08-15 19:55:07 NonBlockingConnection - Written 20 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 36 byte(s)
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionTuneOk[ channelMax: 256 frameMax: 262136 heartbeat: 60 ]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 0 ms.
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionOpen[ virtualHost: / capabilities: null insist: false ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionCloseBodyImpl: replyCode=404, replyText=Unknown virtual host: '/', classId=10, methodId=40]
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 0 ms.
2018-08-15 19:55:07 NonBlockingConnection - Written 44 bytes
2018-08-15 19:55:07 NonBlockingConnection - Read 0 byte(s)
2018-08-15 19:55:07 NonBlockingConnection - Read 12 byte(s)
2018-08-15 19:55:07 RequestServiceImpl - Failure sending message to queue...storing for later delivery {java.io.IOException}
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionCloseOk
2018-08-15 19:55:07 NonBlockingConnection - Closing /0:0:0:0:0:0:0:1:56892
2018-08-15 19:55:07 BrokerDecoder - Frame handled in 0 ms.
2018-08-15 19:55:07 MultiVersionProtocolEngine - Closed
2018-08-15 19:55:07 ForgivingExceptionHandler - An unexpected connection driver error occured
java.net.SocketException: socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readUnsignedByte(Unknown Source)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:91)
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:164)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:580)
at java.lang.Thread.run(Unknown Source)
2018-08-15 19:55:07 TaskExecutorImpl - Running runnable org.apache.qpid.server.transport.AbstractAMQPConnection$1#c30ce0 through executor interface
2018-08-15 19:55:07 close - [con:3(guest#null)] CON-1002 : Close
2018-08-15 19:55:20 BrokerImpl - Assigning target sizes based on total target 207591833
2018-08-15 19:55:20 BrokerImpl - Assigning target size 207591833 to vhost VirtualHost[id=556d86e7-d4f7-4428-9a54-86b280bdd515, name=/, type=Memory]
2018-08-15 19:55:20 AbstractVirtualHost - Allocating target size to queues, total target: 207591833 ; total enqueued size 0

If your need is to mimic RabbitMQ behavior, I would suggest using rabbitmq-mock to avoid the need of a port (which can be an issue in CI runs) and improve startup time.
Simply add the dependency to your build tool, if you are using Maven:
<dependency>
<groupId>com.github.fridujo</groupId>
<artifactId>rabbitmq-mock</artifactId>
<version>1.0.14</version>
<scope>test</scope>
</dependency>
Then replace or override your Spring ConnectionFactory with:
#Bean
public ConnectionFactory connectionFactory() {
return new CachingConnectionFactory(MockConnectionFactoryFactory.build());
}
Both RabbitTemplate and SimpleMessageListenerContainer should behave as if they were connected to a real RabbitMQ broker.
Here is a complete sample test using Spring-Boot.

Your AMQP client is requesting a virtualhost that does not exist on the Broker. The Broker is replying "Unknown virtual host". Check the connection details that are passed by the client.
2018-08-15 19:55:07 AMQPConnection_0_8Impl - RECV ConnectionOpen[ virtualHost: / capabilities: null insist: false ]
2018-08-15 19:55:07 AMQPConnection_0_8Impl - SEND: Frame channelId: 0, bodyFrame: [ConnectionCloseBodyImpl: replyCode=404, replyText=Unknown virtual host: '/', classId=10, methodId=40]}}
Separately, I notice that you are using quite an old Broker version (6.1.1), I'd suggest choosing a newer release.

FYI:
Excellent and self-explaining example of RabbitMQ testing using rabbitmq-mock here:
rabbitmq-mock | SpringIntegrationTest.java
rabbitmqrabbitmq-mockspring-rabbitspring-amqpspring-integration-amqp

Related

Clustering Dockerized Elasticsearch with multiple Docker Host

Trying to make it clustering with docker compose.
I have two elasticsearch docker containers which are deployed in different Docker Hosts.
docker version: 18.06.3-ce
elasticsearch : 6.5.2
docker-compose.yml for docker-container-1
services:
elasticsearch:
restart: always
hostname: elasticsearch
image: docker-elk/elasticsearch:1.0.0
build:
context: elasticsearch
dockerfile: Dockerfile
environment:
discovery.type: zen
ports:
- 9200:9200
- 9300:9300
env_file:
- ./elasticsearch/elasticsearch.env
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
docker-compose.yml for docker-container-2
services:
elasticsearch:
restart: always
hostname: elasticsearch
image: docker-elk/elasticsearch:1.0.0
build:
context: elasticsearch
dockerfile: Dockerfile
environment:
discovery.type: zen
ports:
- 9200:9200
- 9300:9300
env_file:
- ./elasticsearch/elasticsearch.env
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
elasticsearch.yml on the elasticsearch-docker-container-1 on the Docker-Host 1
xpack.security.enabled: true
cluster.name: es-cluster
node.name: es1
network.host: 0.0.0.0
node.master: true
node.data: true
transport.tcp.port: 9300
path.data: /usr/share/elasticsearch/data
path.logs: /usr/share/elasticsearch/logs
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 1
discovery.zen.ping.unicast.hosts: ["host1:9300", "host2:9300","host1:9200", "host2:9200"]
network.publish_host: host1
elasticsearch.yml on the elasticsearch-docker-container-2 on the Docker-Host 2
xpack.security.enabled: true
cluster.name: es-cluster
node.name: es2
network.host: 0.0.0.0
node.master: true
node.data: true
transport.tcp.port: 9300
path.data: /usr/share/elasticsearch/data
path.logs: /usr/share/elasticsearch/logs
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 1
discovery.zen.ping.unicast.hosts: ["host1:9300", "host2:9300","host1:9200", "host2:9200"]
network.publish_host: host2
Below is the result of GET /_cluster/health?pretty and it shows that there is only one node.
{
"cluster_name" : "dps_geocluster",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 33,
"active_shards" : 33,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 30,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 52.38095238095239
}
According to the document below at least three elasticsearch nodes are required.
https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-node.html
Each elasticsearch container should be at different Docker host?
The following was the cause of error. After increasing the value of vm.max_map_count into 262144 with sysctl, it works fine.
elasticsearch_1 | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
Now number_of_nodes is 2.
{
"cluster_name" : "es-cluster",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 2,
"active_primary_shards" : 35,
"active_shards" : 37,
"relocating_shards" : 0,
"initializing_shards" : 2,
"unassigned_shards" : 31,
"delayed_unassigned_shards" : 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch" : 0,
"task_max_waiting_in_queue_millis" : 0,
"active_shards_percent_as_number" : 52.85714285714286
}

unable to access server in docker container from outside host machine

I have a linux machine (Host-591) hosting 2 VM instances. In the first VM instance (Docker03), inside a container, I have a Flask web server hosted, which runs on tcp/81 and publishes it. The host machine, Docker03 maps it to port tcp/5003.
From Docker03, I am able to access the Flask server:
root#Docker03:/home/ubuntu/docker/app3# curl http://192.168.122.103:5003/
Hello Root!
root#Docker03:/home/ubuntu/docker/app3#
But from the host linux machine, I am not able to access the server.
[root#Host-591 ~]# curl http://192.168.122.103:5003/
^C
Ping from the host machine to the server in the container inside Docker03 works fine.
[root#Host-591 ~]# ping 192.168.122.103 -c 1
PING 192.168.122.103 (192.168.122.103) 56(84) bytes of data.
64 bytes from 192.168.122.103: icmp_seq=1 ttl=64 time=0.225 ms
--- 192.168.122.103 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.225/0.225/0.225/0.000 ms
A simple telnet from the Host machine to the Flask server's port shows TCP connection can be established:
[root#Host-591 ~]# telnet 192.168.122.103 5003
Trying 192.168.122.103...
Connected to 192.168.122.103.
Escape character is '^]'.
^]
telnet> q
Connection closed.
[root#Host-591 ~]# ifconfig virbr0
virbr0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:1a:d4:4d txqueuelen 1000 (Ethernet)
RX packets 30436 bytes 7466531 (7.1 MiB)
RX errors 0 dropped 24 overruns 0 frame 0
TX packets 42414 bytes 65991140 (62.9 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
The iptables rules on Docker03 VM instance looks like:
root#Docker03:/home/ubuntu/docker/app3# iptables -t nat -vL -n
Chain PREROUTING (policy ACCEPT 1 packets, 84 bytes)
pkts bytes target prot opt in out source destination
1 84 DOCKER-INGRESS all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
3 204 DOCKER all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT 1 packets, 84 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 5 packets, 364 bytes)
pkts bytes target prot opt in out source destination
4 240 DOCKER-INGRESS all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
0 0 DOCKER all -- * * 0.0.0.0/0 !127.0.0.0/8 ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT 5 packets, 364 bytes)
pkts bytes target prot opt in out source destination
4 240 MASQUERADE all -- * docker_gwbridge 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match src-type LOCAL
0 0 MASQUERADE all -- * !docker_gwbridge 172.18.0.0/16 0.0.0.0/0
9 582 MASQUERADE all -- * !docker0 172.17.0.0/16 0.0.0.0/0
Chain DOCKER (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- docker_gwbridge * 0.0.0.0/0 0.0.0.0/0
0 0 RETURN all -- docker0 * 0.0.0.0/0 0.0.0.0/0
Chain DOCKER-INGRESS (2 references)
pkts bytes target prot opt in out source destination
3 180 DNAT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:5003 to:172.18.0.2:5003
1 84 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0
In the DOCKER-INGRESS chain, the pkt count increases when I try to access the server from Docker03 instance, but does not increase when I try to access it from the host machine (Host-591).
Inside Docker03:
root#Docker03:/home/ubuntu/docker/app3# ifconfig
...
docker_gwbridge Link encap:Ethernet HWaddr 02:42:a5:66:fb:c6
inet addr:172.18.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::42:a5ff:fe66:fbc6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3768 (3.7 KB) TX bytes:3560 (3.5 KB)
ens3 Link encap:Ethernet HWaddr 52:54:00:4d:a9:67
inet addr:192.168.122.103 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::5054:ff:fe4d:a967/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16582 errors:0 dropped:8 overruns:0 frame:0
TX packets:7988 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27505482 (27.5 MB) TX bytes:773745 (773.7 KB)
...
root#Docker03:/home/ubuntu/docker/app3# docker service ls
ID NAME MODE REPLICAS IMAGE
jgsuip3oda4e app3_web replicated 1/1 app3-web:v1
root#Docker03:/home/ubuntu/docker/app3# docker service inspect jgsuip3oda4e
[
{
"ID": "jgsuip3oda4ef2soefj0ce2oh",
"Version": {
"Index": 26
},
"CreatedAt": "2018-08-20T16:13:40.627151395Z",
"UpdatedAt": "2018-08-20T16:13:40.628064367Z",
"Spec": {
"Name": "app3_web",
"Labels": {
"com.docker.stack.namespace": "app3"
},
"TaskTemplate": {
"ContainerSpec": {
"Image": "app3-web:v1",
"Labels": {
"com.docker.stack.namespace": "app3"
}
},
"Resources": {},
"Placement": {},
"ForceUpdate": 0
},
"Mode": {
"Replicated": {
"Replicas": 1
}
},
"Networks": [
{
"Target": "giz5m1weca0xjlcsxjnvm5e81",
"Aliases": [
"web"
]
}
],
"EndpointSpec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 81,
"PublishedPort": 5003,
"PublishMode": "ingress"
}
]
}
},
"Endpoint": {
"Spec": {
"Mode": "vip",
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 81,
"PublishedPort": 5003,
"PublishMode": "ingress"
}
]
},
"Ports": [
{
"Protocol": "tcp",
"TargetPort": 81,
"PublishedPort": 5003,
"PublishMode": "ingress"
}
],
"VirtualIPs": [
{
"NetworkID": "s067fap1788lt9le1nfc5l2yh",
"Addr": "10.255.0.3/16"
},
{
"NetworkID": "giz5m1weca0xjlcsxjnvm5e81",
"Addr": "10.0.0.2/24"
}
]
},
"UpdateStatus": {
"StartedAt": "0001-01-01T00:00:00Z",
"CompletedAt": "0001-01-01T00:00:00Z"
}
}
]
root#Docker03:/home/ubuntu/docker/app3# docker network ls
NETWORK ID NAME DRIVER SCOPE
giz5m1weca0x app3_webnet overlay swarm
a2a6a0d8d2eb bridge bridge local
3d5bf5444e12 docker_gwbridge bridge local
97d487b3203e host host local
s067fap1788l ingress overlay swarm
efb9d06c92a8 none null local
root#Docker03:/home/ubuntu/docker/app3# docker network inspect docker_gwbridge
[
{
"Name": "docker_gwbridge",
"Id": "3d5bf5444e12adb0d8ed307144de2047372b5f56b2dead9718b414c8e6afa75b",
"Created": "2018-08-20T12:04:26.440509262-04:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.18.0.0/16",
"Gateway": "172.18.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Containers": {
"9eb13ae864ef07243c9b6c89713680248db9ba8e4e914e2f0173923c38d87d6f": {
"Name": "gateway_9eb13ae864ef",
"EndpointID": "48e44bfe94366c783f8bc59d1ed1bc3b8cefbbe534cdb4bf7cedfc4852b91213",
"MacAddress": "02:42:ac:12:00:03",
"IPv4Address": "172.18.0.3/16",
"IPv6Address": ""
},
"ingress-sbox": {
"Name": "gateway_ingress-sbox",
"EndpointID": "a9e15a62d6a678b2beb078f2eb99933c48ce44ebf4d2cc2912090ef75a12b75d",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.bridge.enable_icc": "false",
"com.docker.network.bridge.enable_ip_masquerade": "true",
"com.docker.network.bridge.name": "docker_gwbridge"
},
"Labels": {}
}
]
root#Docker03:/home/ubuntu/docker/app3# docker network inspect app3_webnet
[
{
"Name": "app3_webnet",
"Id": "giz5m1weca0xjlcsxjnvm5e81",
"Created": "2018-08-20T12:13:40.787096192-04:00",
"Scope": "swarm",
"Driver": "overlay",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "10.0.0.0/24",
"Gateway": "10.0.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Containers": {
"9eb13ae864ef07243c9b6c89713680248db9ba8e4e914e2f0173923c38d87d6f": {
"Name": "app3_web.1.8cejzgd75xul8brdjjjjnq0rb",
"EndpointID": "b5717c1dff888d993ff9a573b7967f90165c35e35774ca479b5d37cf0821e00d",
"MacAddress": "02:42:0a:00:00:03",
"IPv4Address": "10.0.0.3/24",
"IPv6Address": ""
}
},
"Options": {
"com.docker.network.driver.overlay.vxlanid_list": "4097"
},
"Labels": {
"com.docker.stack.namespace": "app3"
},
"Peers": [
{
"Name": "Docker03-03ead807e067",
"IP": "192.168.122.103"
}
]
}
]
Here is the docker compose file that I am using:
root#Docker03:/home/ubuntu/docker/app3# cat docker-compose.yml
version: '3'
services:
web:
image: "app3-web:v1"
ports:
- "5003:81"
networks:
- "webnet"
networks:
webnet:
root#Docker03:/home/ubuntu/docker/app3# netstat -tulpn | grep 5003
tcp6 0 0 :::5003 :::* LISTEN 1610/dockerd
The Dockerfile for the app looks like this:
root#Docker03:/home/ubuntu/docker/app3# cat web/Dockerfile
FROM python:3.4-alpine
ADD . /web
WORKDIR /web
RUN pip install --proxy <proxy_ip_address:port> --trusted-host pypi.python.org -r requirements.txt
EXPOSE 81
# set environment variable so that python does not buffer any output logs
ENV PYTHONUNBUFFERED 0
CMD ["python", "index.py"]
I tried to spin up another VM instance connected to the 192.168.122.0/24 network and access the Flask server, and it worked fine. It seems only access from outside the VMs is not working. Docker version I am using:
root#Docker03:/home/ubuntu/docker/app3# docker --version
Docker version 17.03.2-ce, build f5ec1e2
Any help is much appreciated.
Thanks,

torch7 size mismatch when feeding an image

I'm trying to do some stuff with a neural network in torch7. However when I run the code I get the error /home/thijser/torch/install/share/lua/5.1/nn/Linear.lua:57: size mismatch at /tmp/luarocks_cutorch-scm-1-6477/cutorch/lib/THC/generic/THCTensorMathBlas.cu:52
here is the code (or at least the minimal example where the problem occurs)
require 'torch'
require 'nn'
require 'image'
require 'optim'
require 'cutorch'
require 'cunn'
require 'loadcaffe'
local cmd = torch.CmdLine()
local function main(params)
cutorch.setDevice(1)
local loadcaffe_backend = 'nn'
local cnn = loadcaffe.load('models/VGG_ILSVRC_19_layers-deploy.prototxt', 'models/VGG_ILSVRC_19_layers.caffemodel', loadcaffe_backend):float()
cnn:cuda()
targetImage_caffe = image.load('tank.jpg', 3)
targetImage_caffe = targetImage_caffe:cuda()
netimage=cnn:forward(targetImage_caffe)
end
local params = cmd:parse(arg)
main(params)
And the full error log
/home/thijser/torch/install/bin/luajit: /home/thijser/torch/install/share/lua/5.1/nn/Container.lua:67:
In 39 module of nn.Sequential:
/home/thijser/torch/install/share/lua/5.1/nn/Linear.lua:57: size mismatch at /tmp/luarocks_cutorch-scm-1-6477/cutorch/lib/THC/generic/THCTensorMathBlas.cu:52
stack traceback:
[C]: in function 'addmv'
/home/thijser/torch/install/share/lua/5.1/nn/Linear.lua:57: in function </home/thijser/torch/install/share/lua/5.1/nn/Linear.lua:53>
[C]: in function 'xpcall'
/home/thijser/torch/install/share/lua/5.1/nn/Container.lua:63: in function 'rethrowErrors'
/home/thijser/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
temp.lua:24: in function 'main'
temp.lua:37: in main chunk
[C]: in function 'dofile'
...jser/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x5599d0cfa470
WARNING: If you see a stack trace below, it doesn't point to the place where this error occurred. Please use only the one above.
stack traceback:
[C]: in function 'error'
/home/thijser/torch/install/share/lua/5.1/nn/Container.lua:67: in function 'rethrowErrors'
/home/thijser/torch/install/share/lua/5.1/nn/Sequential.lua:44: in function 'forward'
temp.lua:24: in function 'main'
temp.lua:37: in main chunk
[C]: in function 'dofile'
...jser/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk
[C]: at 0x5599d0cfa470
The models can be downloaded by
cd models
wget -c https://gist.githubusercontent.com/ksimonyan/3785162f95cd2d5fee77/raw/bb2b4fe0a9bb0669211cf3d0bc949dfdda173e9e/VGG_ILSVRC_19_layers_deploy.prototxt
wget -c --no-check-certificate https://bethgelab.org/media/uploads/deeptextures/vgg_normalised.caffemodel
wget -c http://www.robots.ox.ac.uk/~vgg/software/very_deep/caffe/VGG_ILSVRC_19_layers.caffemodel
cd ..
print(cnn) gives an output of
nn.Sequential {
[input -> (1) -> (2) -> (3) -> (4) -> (5) -> (6) -> (7) -> (8) -> (9) -> (10) -> (11) -> (12) -> (13) -> (14) -> (15) -> (16) -> (17) -> (18) -> (19) -> (20) -> (21) -> (22) -> (23) -> (24) -> (25) -> (26) -> (27) -> (28) -> (29) -> (30) -> (31) -> (32) -> (33) -> (34) -> (35) -> (36) -> (37) -> (38) -> (39) -> (40) -> (41) -> (42) -> (43) -> (44) -> (45) -> (46) -> output]
(1): nn.SpatialConvolution(3 -> 64, 3x3, 1,1, 1,1)
(2): nn.ReLU
(3): nn.SpatialConvolution(64 -> 64, 3x3, 1,1, 1,1)
(4): nn.ReLU
(5): nn.SpatialMaxPooling(2x2, 2,2)
(6): nn.SpatialConvolution(64 -> 128, 3x3, 1,1, 1,1)
(7): nn.ReLU
(8): nn.SpatialConvolution(128 -> 128, 3x3, 1,1, 1,1)
(9): nn.ReLU
(10): nn.SpatialMaxPooling(2x2, 2,2)
(11): nn.SpatialConvolution(128 -> 256, 3x3, 1,1, 1,1)
(12): nn.ReLU
(13): nn.SpatialConvolution(256 -> 256, 3x3, 1,1, 1,1)
(14): nn.ReLU
(15): nn.SpatialConvolution(256 -> 256, 3x3, 1,1, 1,1)
(16): nn.ReLU
(17): nn.SpatialConvolution(256 -> 256, 3x3, 1,1, 1,1)
(18): nn.ReLU
(19): nn.SpatialMaxPooling(2x2, 2,2)
(20): nn.SpatialConvolution(256 -> 512, 3x3, 1,1, 1,1)
(21): nn.ReLU
(22): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(23): nn.ReLU
(24): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(25): nn.ReLU
(26): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(27): nn.ReLU
(28): nn.SpatialMaxPooling(2x2, 2,2)
(29): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(30): nn.ReLU
(31): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(32): nn.ReLU
(33): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(34): nn.ReLU
(35): nn.SpatialConvolution(512 -> 512, 3x3, 1,1, 1,1)
(36): nn.ReLU
(37): nn.SpatialMaxPooling(2x2, 2,2)
(38): nn.View(-1)
(39): nn.Linear(25088 -> 4096)
(40): nn.ReLU
(41): nn.Dropout(0.500000)
(42): nn.Linear(4096 -> 4096)
(43): nn.ReLU
(44): nn.Dropout(0.500000)
(45): nn.Linear(4096 -> 1000)
(46): nn.SoftMax
}
While print(targetImage_caffe:size()) gives me
3
660
1045
[torch.LongStorage of size 3]
Anybody know how to fix this or what I'm doing wrong?
The problem comes fro the fact that you are using VGG19 which is designed to be fed with 224 x 224 images. Since you are using a 660 x 1045 image (which is typically strange since most of the convnets use squared images) an error occur at module 39 (you can see it in the stack trace) because you want to aply a linear module with 25088 input dimensions to a tensor which has now around 327680 values (each pooling layer roughly divide the image's size by 4 and you have 512 features maps).
The solution is therefore to use 224 x 224 images. Therefore after the 5 pooling layers you will have a image of dimension (224 / 2^5) x (224 / 2^5) x 512 = 25088.

Firebase 3.6.0 - Login Authentication - Swift 3

I've recently moved from Parse to Firebase due to it shutting down. However, I am now encountering many issues. I'm just testing logging in using this code in my AppDelegate class. Whenever I run this, I get Thread 1: signal SIGABRT on the class. How exactly do I fix this?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
FIRApp.configure()
FIRAuth.auth()?.signIn(withEmail: "test#test.com", password: "123456", completion: { (user, error) in
if user != nil {
print(error?.localizedDescription)
} else {
print(user?.email)
}
})
return true
}
Pod file
# Uncomment this line to define a global platform for your project
# platform :ios, '10.0'
target 'Fire' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Fire
pod 'Firebase'
pod 'Firebase/Auth'
pod 'Firebase/Core'
pod 'Firebase/AdMob'
pod 'Firebase/Messaging'
pod 'Firebase/Database'
pod 'Firebase/Invites'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Crash'
pod 'Firebase/RemoteConfig'
pod 'Firebase/AppIndexing'
pod 'Firebase/Storage'
target 'FireTests' do
inherit! :search_paths
# Pods for testing
end
target 'FireUITests' do
inherit! :search_paths
# Pods for testing
end
end
Current error in the console:
objc[7008]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x118b4f910) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1188e2210). One of the two will be used. Which one is undefined.
2016-09-30 14:05:44.946754 Fire[7008:562611] bundleid: Natural-Development.Fire, enable_level: 0, persist_level: 0, propagate_with_activity: 0
2016-09-30 14:05:44.947828 Fire[7008:562611] subsystem: com.apple.siri, category: Intents, enable_level: 1, persist_level: 1, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
2016-09-30 14:05:45.063385 Fire[7008:562826] subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.063945 Fire[7008:562826] subsystem: com.apple.UIKit, category: HIDEventIncoming, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.074818 Fire[7008:562825] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 1, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0, enable_private_data: 0
2016-09-30 14:05:45.089816 Fire[7008:562611] subsystem: com.apple.UIKit, category: StatusBar, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.112479 Fire[7008:562611] subsystem: com.apple.SystemConfiguration, category: SCNetworkReachability, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.114628 Fire[7008:562611] subsystem: com.apple.network, category: , enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.114948 Fire[7008:562611] [] nw_resolver_create_dns_service_on_queue Starting host resolution app-measurement.com:0, flags 0x4000d000
2016-09-30 14:05:45.115464 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoSuchRecord(-65554) hostname=app-measurement.com. addr=::.0 ttl=60
2016-09-30 14:05:45.115 Fire[7008:562611] Configuring the default app.
2016-09-30 14:05:45.115705 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.232:0 ttl=375
2016-09-30 14:05:45.116125 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.221:0 ttl=375
2016-09-30 14:05:45.116941 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.117411 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.117625 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.221:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.118892 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.216:0 ttl=375
2016-09-30 14:05:45.119183 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.119420 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.216:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.119694 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.216:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.119926 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.236:0 ttl=375
2016-09-30 14:05:45.120200 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.120391 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.236:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.120679 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.236:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.137009 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.236:0#0 = 144.131.80.216:0#0
2016-09-30 14:05:45.138700 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.251:0 ttl=375
2016-09-30 14:05:45.141072 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.150509 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.251:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.151327 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.251:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.152173 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.251:0#0 = 144.131.80.216:0#0
2016-09-30 14:05:45.152589 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.251:0#0 = 144.131.80.236:0#0
2016-09-30 14:05:45.152901 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.227:0 ttl=375
2016-09-30 14:05:45.153323 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.153781 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.227:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.154232 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.227:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.154963 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.227:0#0 = 144.131.80.216:0#0
2016-09-30 14:05:45.155176 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.227:0#0 = 144.131.80.236:0#0
2016-09-30 14:05:45.155547 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.227:0#0 = 144.131.80.251:0#0
2016-09-30 14:05:45.155937 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.247:0 ttl=375
2016-09-30 14:05:45.156468 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.156915 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.157129 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.157679 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.216:0#0
2016-09-30 14:05:45.157 Fire[7008:562611] Firebase Crash Reporting: Successfully enabled
2016-09-30 14:05:45.158122 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.236:0#0
2016-09-30 14:05:45.158717 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.251:0#0
2016-09-30 14:05:45.159778 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.247:0#0 = 144.131.80.227:0#0
2016-09-30 14:05:45.160491 Fire[7008:562825] [] nw_resolver_host_resolve_callback flags=0x3 ifindex=0 error=NoError(0) hostname=app-measurement.com. addr=144.131.80.217:0 ttl=375
2016-09-30 14:05:45.161141 Fire[7008:562846] subsystem: com.apple.libsqlite3, category: logging, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 1, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.161647 Fire[7008:562847] [] tcp_connection_create_with_endpoint_and_parameters 1 play.googleapis.com 443
2016-09-30 14:05:45.162382 Fire[7008:562825] [] nw_host_stats_add_src recv too small, received 24, expected 28
2016-09-30 14:05:45.163649 Fire[7008:562847] [] tcp_connection_start 1 starting
2016-09-30 14:05:45.164405 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.232:0#0
2016-09-30 14:05:45.165486 Fire[7008:562611] subsystem: com.apple.securityd, category: OSStatus, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 2, enable_private_data: 0
2016-09-30 14:05:45.165396 Fire[7008:562847] [] nw_connection_create creating connection to play.googleapis.com:443
2016-09-30 14:05:45.166691 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.221:0#0
2016-09-30 14:05:45.166: <FIRInstanceID/WARNING> Failed to remove checkin auth credentials from Keychain Error Domain=com.google.iid Code=-34018 "(null)"
2016-09-30 14:05:45.167485 Fire[7008:562848] [] tcp_connection_create_with_endpoint_and_parameters 2 plus.google.com 443
2016-09-30 14:05:45.168079 Fire[7008:562847] [] tcp_connection_start starting tc_nwconn=0x7f95227046a0
2016-09-30 14:05:45.168586 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.216:0#0
2016-09-30 14:05:45.168951 Fire[7008:562848] [] tcp_connection_start 2 starting
2016-09-30 14:05:45.169: <FIRInstanceID/WARNING> Error failed to remove all tokens from keychain Error Domain=com.google.iid Code=-34018 "(null)"
2016-09-30 14:05:45.169287 Fire[7008:562847] [] __nw_connection_start_block_invoke 1 starting
2016-09-30 14:05:45.169565 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.236:0#0
2016-09-30 14:05:45.169854 Fire[7008:562848] [] nw_connection_create creating connection to plus.google.com:443
2016-09-30 14:05:45.170508 Fire[7008:562847] [] nw_endpoint_handler_start [1 play.googleapis.com:443 initial path (null)]
2016-09-30 14:05:45.171: <FIRInstanceID/WARNING> FIRInstanceID AppDelegate proxy enabled, will swizzle app delegate remote notification handlers. To disable add "FirebaseAppDelegateProxyEnabled" to your Info.plist and set it to NO
2016-09-30 14:05:45.171: <FIRInstanceID/WARNING> Failed to fetch APNS token Error Domain=com.firebase.iid Code=1001 "(null)"
202016-09-30 14:05:45.174 Fire[7008:562611] A reversed client ID should be added as a URL scheme to enable Google sign-in.
16-09-30 14:05:45.171034 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.251:0#0
2016-09-30 14:05:45.186541 Fire[7008:562848] [] tcp_connection_start starting tc_nwconn=0x7f9522406890
2016-09-30 14:05:45.186901 Fire[7008:562847] [] nw_connection_endpoint_report [1 play.googleapis.com:443 initial path (null)] reported event path:start
2016-09-30 14:05:45.188 Fire[7008:] <FIRAnalytics/INFO> Firebase Analytics v.3402000 started
2016-09-30 14:05:45.189 Fire[7008:] <FIRAnalytics/INFO> To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see google link)
2016-09-30 14:05:45.191242 Fire[7008:562817] [] tcp_connection_create_with_endpoint_and_parameters 3 device-provisioning.googleapis.com 443
2016-09-30 14:05:45.192630 Fire[7008:562825] [] sa_dst_compare_internal 144.131.80.217:0#0 = 144.131.80.227:0#0
2016-09-30 14:05:45.195343 Fire[7008:562847] [] nw_endpoint_handler_path_change [1 play.googleapis.com:443 waiting path (satisfied)]
2016-09-30 14:05:45.196090 Fire[7008:562817] [] tcp_connection_start 3 starting
2016-09-30 14:05:45.196 Fire[7008:562611] *** Terminating app due to uncaught exception 'com.firebase.appinvite', reason: 'App Invite configuration failed.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110f4b34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000011058f21e objc_exception_throw + 48
2 CoreFoundation 0x0000000110fb4265 +[NSException raise:format:] + 197
3 Fire 0x000000010c31cc93 -[GINInvite(FIRApp) configureAppInvite:] + 978
4 Fire 0x000000010c31c892 +[GINInvite(FIRApp) receivedReadyToConfigureNotification:] + 154
5 CoreFoundation 0x0000000110ee919c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
6 CoreFoundation 0x0000000110ee909b _CFXRegistrationPost + 427
7 CoreFoundation 0x0000000110ee8e02 ___CFXNotificationPost_block_invoke + 50
8 CoreFoundation 0x0000000110eabea2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 2018
9 CoreFoundation 0x0000000110eaaf3b _CFXNotificationPost + 667
10 Foundation 0x000000011005713b -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
11 Fire 0x000000010c22414a +[FIRApp sendNotificationsToSDKs:] + 296
12 Fire 0x000000010c222fee +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 324
13 Fire 0x000000010c222cfb +[FIRApp configure] + 302
14 Fire 0x000000010c1ddda4 _TFC4Fire11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 100
15 Fire 0x000000010c1de774 _TToFC4Fire11AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180
16 UIKit 0x000000011136568e -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290
17 UIKit 0x0000000111367013 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236
18 UIKit 0x000000011136d3b9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
19 UIKit 0x000000011136a539 -[UIApplication workspaceDidEndTransaction:] + 188
20 FrontBoardServices 0x0000000114ebb76b __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
21 FrontBoardServices 0x0000000114ebb5e4 -[FBSSerialQueue _performNext] + 189
22 FrontBoardServices 0x0000000114ebb96d -[FBSSerialQueue _performNextFromRunLoopSource] + 45
23 CoreFoundation 0x0000000110ef0311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
24 CoreFoundation 0x0000000110ed559c __CFRunLoopDoSources0 + 556
25 CoreFoundation 0x0000000110ed4a86 __CFRunLoopRun + 918
26 CoreFoundation 0x0000000110ed4494 CFRunLoopRunSpecific + 420
27 UIKit 0x0000000111368db6 -[UIApplication _run] + 434
28 UIKit 0x000000011136ef34 UIApplicationMain + 159
29 Fire 0x000000010c1dfccf main + 111
30 libdyld.dylib 0x00000001135aa68d start + 1
31 ??? 0x0000000000000001 0x0 + 1
)
2016-09-30 14:05:45.196440 Fire[7008:562825] [] sa_dst_compare_internal 144libc++abi.dylib: terminating with uncaught exception of type NSException
.131.80.217:0#0 = 144.131.80.247:0#0
(lldb)
There may be a couple of things that went wrong,
You did not install firebase/auth pod.
The firapp is not done configuring itself and you are calling a firebase function right away.
I think is most likely to be the first one. In that case open the podfile and add pod 'Firebase/Auth'
This question was solved by not installing all of Firebase's features/pods.

Running in Xcode 7.3, and macOS v 10.12 Beta. Error `DTAssetProviderService could not start DTXConnection with Simulator`. How can I solve this?

I have Xcode 8 beta and macOS 10.12. I ran project A in Xcode 8 beta. I switched back to 7.3 and got this error.
Error: DTAssetProviderService could not start DTXConnection with Simulator 'iPhone 6s Plus'. Check the system log for errors.
No amount of resetting the simulator, quitting simulator, quitting xcode, restarting my macbook, etc will work.
Then I tried various other projects in Xcode 7.3 (none in 8), and all are getting this error.
I have additional problems in Xcode 8 where none of my NSLog statements are printing to the console.
EDIT: I also cannot create brand new projects in Xcode 7.3 and run under macOS 10.12 without getting that error.
EDIT 2: If I create a branch new Single View application, and type NSLog(#"Hello World!"); into the viewDidLoad method, I don't get any logging statement to the console. I just get...
2016-06-17 16:20:12.622791 MyApp[6587:98125] Created DB, header sequence number = 252
2016-06-17 16:20:12.623998 MyApp[6587:98131] bundleid: com.lwt.MyApp, enable_level: 0, persist_level: 0, propagate_with_activity: 0
2016-06-17 16:20:12.636132 MyApp[6587:98131] subsystem: com.apple.UIKit, category: HIDEvents, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-17 16:20:12.640879 MyApp[6587:98125] Created DB, header sequence number = 252
2016-06-17 16:20:12.642933 MyApp[6587:98125] Created DB, header sequence number = 252
2016-06-17 16:20:12.644489 MyApp[6587:98125] Created DB, header sequence number = 252
2016-06-17 16:20:12.650247 MyApp[6587:98125] Created DB, header sequence number = 252
2016-06-17 16:20:12.688506 MyApp[6587:98125] subsystem: com.apple.BaseBoard, category: MachPort, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0
2016-06-17 16:20:12.709064 MyApp[6587:98126] subsystem: com.apple.FrontBoard, category: Common, enable_level: 0, persist_level: 0, default_ttl: 0, info_ttl: 0, debug_ttl: 0, generate_symptoms: 0, enable_oversize: 0, privacy_setting: 0

Resources