jorge07 / symfony-6-es-cqrs-boilerplate

Symfony 6 DDD ES CQRS backend boilerplate.
MIT License
1.07k stars 187 forks source link

the docker service (worker) is not working #83

Closed blixit closed 5 years ago

blixit commented 5 years ago

I'm still getting this error:

workers_1        | rabbitmq:multiple-consumer [-m|--messages [MESSAGES]] [-r|--route [ROUTE]] [-l|--memory-limit [MEMORY-LIMIT]] [-d|--debug] [-w|--without-signals] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> <name> [<context>]
workers_1        | 
workers_1        | 2018-12-30T10:38:00+00:00 [error] Error thrown while running command "rabbitmq:multiple-consumer events". Message: "stream_socket_client(): unable to connect to tcp://0.0.0.0:5672 (Connection refused)"
workers_1        | 
workers_1        | In StreamIO.php line 141:
workers_1        |                                                                                
workers_1        |   stream_socket_client(): unable to connect to tcp://0.0.0.0:5672 (Connection  
workers_1        |    refused)                                                                    
workers_1        |                                                                                
workers_1        | 
workers_1        | rabbitmq:multiple-consumer [-m|--messages [MESSAGES]] [-r|--route [ROUTE]] [-l|--memory-limit [MEMORY-LIMIT]] [-d|--debug] [-w|--without-signals] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> <name> [<context>]

I tried to set many values like:

RABBITMQ_URL=amqp://guest:guest@rmq:5672 (default one) RABBITMQ_URL=amqp://guest:guest@0.0.0.0:5672 RABBITMQ_URL=amqp://guest:guest@rmq:15672 RABBITMQ_URL=amqp://guest:guest@0.0.0.0:15672

but it doesnt work. Could you help ?

Should I install something else ? the documentation doesnt say anything about that.

jorge07 commented 5 years ago

Hey @blixit is your rabbitmq service running? Type docker ps and docker logs XXX see if it ready.

blixit commented 5 years ago

yes, rabbitmq is up. here is my docker log:

02bf73954e6a        jorge07/alpine-php:7.2-dev-sf                         "/sbin/tini -- /app/…"   About an hour ago   Restarting (1) Less than a second ago                                                                                                symfony4escqrsboilerplate_workers_1
fcbc63dd47d1        nginx:1.11-alpine                                     "nginx -g 'daemon of…"   About an hour ago   Up 13 seconds                           443/tcp, 0.0.0.0:8087->80/tcp                                                                symfony4escqrsboilerplate_nginx_1
ad8f5037fcf3        jorge07/alpine-php:7.2-dev-sf                         "/sbin/tini -- super…"   About an hour ago   Up 14 seconds                           9000/tcp, 0.0.0.0:2323->22/tcp                                                               symfony4escqrsboilerplate_php_1
bf9eb7937a5a        docker.elastic.co/kibana/kibana:6.3.0                 "/usr/local/bin/kiba…"   About an hour ago   Up 15 seconds                           0.0.0.0:5601->5601/tcp                                                                       symfony4escqrsboilerplate_kibana_1
def853899b3d        mysql:5.7                                             "docker-entrypoint.s…"   About an hour ago   Up 16 seconds                           0.0.0.0:3306->3306/tcp, 33060/tcp                                                            symfony4escqrsboilerplate_mysql_1
0f0e99ad7174        docker.elastic.co/elasticsearch/elasticsearch:6.3.0   "/usr/local/bin/dock…"   About an hour ago   Up 16 seconds                           0.0.0.0:9200->9200/tcp, 9300/tcp                                                             symfony4escqrsboilerplate_elasticsearch_1
9c7a5f100443        rabbitmq:3-management                                 "docker-entrypoint.s…"   About an hour ago   Up 16 seconds                           4369/tcp, 5671/tcp, 0.0.0.0:5672->5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:15672->15672/tcp   symfony4escqrsboilerplate_rmq_1
jorge07 commented 5 years ago

can you copy here the docker logs symfony4escqrsboilerplate_rmq_1 output?

jorge07 commented 5 years ago

@blixit looking at your first message: RABBITMQ_URL=amqp://guest:guest@rmq:5672 <- this should be the config as the php container will only resolve rmq for the rabbit service

blixit commented 5 years ago

In my initial message i showed the 4 configurations I tested. yours belongs to the list. here is the error I get:

workers_1        | 2018-12-31T15:16:30+00:00 [error] Error thrown while running command "rabbitmq:multiple-consumer events". Message: "stream_socket_client(): unable to connect to tcp://rmq:5672 (Connection refused)"
workers_1        | 
workers_1        | In StreamIO.php line 141:
workers_1        |                                                                                
workers_1        |   stream_socket_client(): unable to connect to tcp://rmq:5672 (Connection ref  
workers_1        |   used)                                                                        
workers_1        |                                                                                
workers_1        | 
workers_1        | rabbitmq:multiple-consumer [-m|--messages [MESSAGES]] [-r|--route [ROUTE]] [-l|--memory-limit [MEMORY-LIMIT]] [-d|--debug] [-w|--without-signals] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command> <name> [<context>]
workers_1        | 

Here is the output from docker logs symfony4escqrsboilerplate_rmq_1:

 Starting RabbitMQ 3.7.7 on Erlang 20.3.8.3
 Copyright (C) 2007-2018 Pivotal Software, Inc.
 Licensed under the MPL.  See http://www.rabbitmq.com/

  ##  ##
  ##  ##      RabbitMQ 3.7.7. Copyright (C) 2007-2018 Pivotal Software, Inc.
  ##########  Licensed under the MPL.  See http://www.rabbitmq.com/
  ######  ##
  ##########  Logs: <stdout>

              Starting broker...
2018-12-31 15:16:33.855 [info] <0.249.0> 
 node           : rabbit@9c7a5f100443
 home dir       : /var/lib/rabbitmq
 config file(s) : /etc/rabbitmq/rabbitmq.conf
 cookie hash    : P6euPuJ+9iKMq+WqGJEzBA==
 log(s)         : <stdout>
 database dir   : /var/lib/rabbitmq/mnesia/rabbit@9c7a5f100443
2018-12-31 15:16:34.588 [info] <0.267.0> Memory high watermark set to 3139 MiB (3292087910 bytes) of 7848 MiB (8230219776 bytes) total
2018-12-31 15:16:34.609 [info] <0.269.0> Enabling free disk space monitoring
2018-12-31 15:16:34.609 [info] <0.269.0> Disk free limit set to 50MB
2018-12-31 15:16:34.627 [info] <0.271.0> Limiting to approx 1048476 file handles (943626 sockets)
2018-12-31 15:16:34.627 [info] <0.272.0> FHC read buffering:  OFF
2018-12-31 15:16:34.627 [info] <0.272.0> FHC write buffering: ON
2018-12-31 15:16:34.630 [info] <0.249.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
2018-12-31 15:16:34.694 [info] <0.249.0> Waiting for Mnesia tables for 30000 ms, 9 retries left
2018-12-31 15:16:34.694 [info] <0.249.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration.
2018-12-31 15:16:34.696 [info] <0.249.0> Priority queues enabled, real BQ is rabbit_variable_queue
2018-12-31 15:16:34.706 [info] <0.294.0> Starting rabbit_node_monitor
2018-12-31 15:16:34.763 [info] <0.249.0> Management plugin: using rates mode 'basic'
2018-12-31 15:16:34.765 [info] <0.326.0> Making sure data directory '/var/lib/rabbitmq/mnesia/rabbit@9c7a5f100443/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists
2018-12-31 15:16:34.777 [info] <0.326.0> Starting message stores for vhost '/'
2018-12-31 15:16:34.778 [info] <0.330.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index
2018-12-31 15:16:34.783 [info] <0.326.0> Started message store of type transient for vhost '/'
2018-12-31 15:16:34.784 [info] <0.333.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index
2018-12-31 15:16:34.790 [warning] <0.333.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch
2018-12-31 15:16:34.795 [info] <0.326.0> Started message store of type persistent for vhost '/'
2018-12-31 15:16:34.812 [info] <0.375.0> started TCP Listener on [::]:5672
2018-12-31 15:16:34.814 [info] <0.249.0> Setting up a table for connection tracking on this node: tracked_connection_on_node_rabbit@9c7a5f100443
2018-12-31 15:16:34.814 [info] <0.249.0> Setting up a table for per-vhost connection counting on this node: tracked_connection_per_vhost_on_node_rabbit@9c7a5f100443
2018-12-31 15:16:34.815 [info] <0.33.0> Application rabbit started on node rabbit@9c7a5f100443
2018-12-31 15:16:34.815 [info] <0.33.0> Application rabbitmq_web_dispatch started on node rabbit@9c7a5f100443
2018-12-31 15:16:34.815 [info] <0.33.0> Application amqp_client started on node rabbit@9c7a5f100443
2018-12-31 15:16:34.819 [info] <0.33.0> Application rabbitmq_management_agent started on node rabbit@9c7a5f100443
2018-12-31 15:16:34.879 [info] <0.430.0> Management plugin started. Port: 15672
2018-12-31 15:16:34.879 [info] <0.536.0> Statistics database started.
2018-12-31 15:16:34.879 [info] <0.33.0> Application rabbitmq_management started on node rabbit@9c7a5f100443
 completed with 3 plugins.
2018-12-31 15:16:35.383 [info] <0.5.0> Server startup complete; 3 plugins started.
 * rabbitmq_management
 * rabbitmq_management_agent
 * rabbitmq_web_dispatch
2018-12-31 15:16:38.503 [info] <0.546.0> accepting AMQP connection <0.546.0> (172.24.0.6:33730 -> 172.24.0.4:5672)
2018-12-31 15:16:38.512 [info] <0.546.0> connection <0.546.0> (172.24.0.6:33730 -> 172.24.0.4:5672): user 'guest' authenticated and granted access to vhost '/'
jorge07 commented 5 years ago

Did you use the make start command? If you retry the worker with docker-compose up workers gets connected?

jorge07 commented 5 years ago

I did a clone of the repo and tested successfully...

blixit commented 5 years ago

ok it's on me. make start worked for me. I didn't read properly the readme. Thank's for help.