arguman / arguman.org

Argument mapping and analysis platform
https://arguman.org
Other
1.39k stars 152 forks source link

Docker compose error #303

Closed taxpon closed 5 years ago

taxpon commented 8 years ago

I am trying to run this application on my local machine and followed instructions in README.md.

However, when I run docker-compose up, I failed to launch web container (other containers launched correctly) and got an error as following.

Traceback (most recent call last):
  File "web/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 197, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/code/web/newsfeed/models.py", line 167, in <module>
    class Entry(dict):
  File "/code/web/newsfeed/models.py", line 171, in Entry
    objects = EntryManager()
  File "/code/web/newsfeed/models.py", line 33, in __init__
    self.load()
  File "/code/web/newsfeed/models.py", line 36, in load
    self.collection = get_collection("newsfeed")
  File "/code/web/newsfeed/utils.py", line 28, in get_collection
    return getattr(connection, collection_name)
  File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 224, in inner
    self._setup()
  File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 357, in _setup
    self._wrapped = self._setupfunc()
  File "/code/web/newsfeed/utils.py", line 13, in get_connection
    port=getattr(settings, 'MONGODB_PORT', None)
  File "/usr/local/lib/python2.7/site-packages/pymongo/connection.py", line 222, in __init__
    max_pool_size, document_class, tz_aware, _connect, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 352, in __init__
    raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused

Am I doing something wrong? I did not make any modification in docker-compose.yaml

My machine info:

OS: OSX 10.11.5 (15F34)
docker: version 1.12.0-rc4, build e4a0dbc, experimental
docker-compose:  version 1.8.0-rc2, build c72c966
webuniverseio commented 7 years ago

I'm facing same problem.

Windows 10
Docker version 1.12.1, build 23cf638
docker-compose version 1.8.0, build d988a55

I tried to research where the problem is and so far I'm not getting any progress. When I navigate to localhost:27017, I see following response:

It looks like you are trying to access MongoDB over HTTP on the native driver port.

and in the output from docker-compose

mongodb_1  | 2016-10-29T16:04:05.031+0000 I NETWORK  [initandlisten] connection accepted from 172.18.0.1:47186 #1 (1 connection now open)
mongodb_1  | 2016-10-29T16:04:05.035+0000 I NETWORK  [initandlisten] connection accepted from 172.18.0.1:47188 #2 (2 connections now open)
mongodb_1  | 2016-10-29T16:04:05.036+0000 I NETWORK  [initandlisten] connection accepted from 172.18.0.1:47190 #3 (3 connections now open)
mongodb_1  | 2016-10-29T16:04:05.036+0000 I NETWORK  [conn1] end connection 172.18.0.1:47186 (2 connections now open)
mongodb_1  | 2016-10-29T16:04:05.111+0000 I NETWORK  [conn2] end connection 172.18.0.1:47188 (1 connection now open)

If I attach to mongo image however and run service mongod status I get:

Checking status of database: mongod apparently not running failed!

Research on that topic always leads me to log files which are supposed to be located at /var/log/mongodb/mongodb.log, but they don't seem to exist: cat: /var/log/mongodb/mongodb.log: No such file or directory.

Full output from console docker-compose up --force-recreate --build --no-color > log.txt is attached: log.txt

Any help on this is very much appreciated! Thank you.

kaokul commented 7 years ago

same issue

Recreating argumanorgmaster_mongodb_1
Starting argumanorgmaster_redis_1
Starting argumanorgmaster_db_1
Recreating argumanorgmaster_web_1
Attaching to argumanorgmaster_redis_1, argumanorgmaster_db_1, argumanorgmaster_mongodb_1, argumanorgmaster_web_1
redis_1    | 1:C 14 May 02:33:04.440 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis_1    |                 _._                                                  
redis_1    |            _.-``__ ''-._                                             
redis_1    |       _.-``    `.  `_.  ''-._           Redis 3.2.8 (00000000/0) 64 bit
redis_1    |   .-`` .-```.  ```\/    _.,_ ''-._                                   
redis_1    |  (    '      ,       .-`  | `,    )     Running in standalone mode
redis_1    |  |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
redis_1    |  |    `-._   `._    /     _.-'    |     PID: 1
redis_1    |   `-._    `-._  `-./  _.-'    _.-'                                   
redis_1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
redis_1    |  |    `-._`-._        _.-'_.-'    |           http://redis.io        
redis_1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
redis_1    |  |`-._`-._    `-.__.-'    _.-'_.-'|                                  
redis_1    |  |    `-._`-._        _.-'_.-'    |                                  
redis_1    |   `-._    `-._`-.__.-'_.-'    _.-'                                   
redis_1    |       `-._    `-.__.-'    _.-'                                       
redis_1    |           `-._        _.-'                                           
redis_1    |               `-.__.-'                                               
redis_1    | 
redis_1    | 1:M 14 May 02:33:04.441 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis_1    | 1:M 14 May 02:33:04.441 # Server started, Redis version 3.2.8
redis_1    | 1:M 14 May 02:33:04.441 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1    | 1:M 14 May 02:33:04.441 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
redis_1    | 1:M 14 May 02:33:04.441 * DB loaded from disk: 0.000 seconds
redis_1    | 1:M 14 May 02:33:04.441 * The server is now ready to accept connections on port 6379
db_1       | LOG:  database system was shut down at 2017-05-14 02:32:56 UTC
db_1       | LOG:  MultiXact member wraparound protections are now enabled
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=c56959e879a1
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] db version v3.2.3
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] git version: b326ba837cf6f49d65c2f85e1b70f6f31ece7937
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] modules: none
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] build environment:
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten]     distmod: debian71
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongodb_1  | 2017-05-14T02:33:05.625+0000 I CONTROL  [initandlisten] options: {}
mongodb_1  | 2017-05-14T02:33:05.629+0000 I -        [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
db_1       | LOG:  database system is ready to accept connections
db_1       | LOG:  autovacuum launcher started
mongodb_1  | 2017-05-14T02:33:05.629+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=2G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
mongodb_1  | 2017-05-14T02:33:06.492+0000 I CONTROL  [initandlisten] 
mongodb_1  | 2017-05-14T02:33:06.492+0000 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
mongodb_1  | 2017-05-14T02:33:06.492+0000 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
mongodb_1  | 2017-05-14T02:33:06.492+0000 I CONTROL  [initandlisten] 
mongodb_1  | 2017-05-14T02:33:06.493+0000 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongodb_1  | 2017-05-14T02:33:06.493+0000 I NETWORK  [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
mongodb_1  | 2017-05-14T02:33:06.494+0000 I NETWORK  [initandlisten] waiting for connections on port 27017
web_1      | Traceback (most recent call last):
web_1      |   File "web/manage.py", line 10, in <module>
web_1      |     execute_from_command_line(sys.argv)
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
web_1      |     utility.execute()
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
web_1      |     django.setup()
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
web_1      |     apps.populate(settings.INSTALLED_APPS)
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate
web_1      |     app_config.import_models(all_models)
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 197, in import_models
web_1      |     self.models_module = import_module(models_module_name)
web_1      |   File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
web_1      |     __import__(name)
web_1      |   File "/code/web/newsfeed/models.py", line 167, in <module>
web_1      |     class Entry(dict):
web_1      |   File "/code/web/newsfeed/models.py", line 171, in Entry
web_1      |     objects = EntryManager()
web_1      |   File "/code/web/newsfeed/models.py", line 33, in __init__
web_1      |     self.load()
web_1      |   File "/code/web/newsfeed/models.py", line 36, in load
web_1      |     self.collection = get_collection("newsfeed")
web_1      |   File "/code/web/newsfeed/utils.py", line 28, in get_collection
web_1      |     return getattr(connection, collection_name)
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 224, in inner
web_1      |     self._setup()
web_1      |   File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 357, in _setup
web_1      |     self._wrapped = self._setupfunc()
web_1      |   File "/code/web/newsfeed/utils.py", line 13, in get_connection
web_1      |     port=getattr(settings, 'MONGODB_PORT', None)
web_1      |   File "/usr/local/lib/python2.7/site-packages/pymongo/connection.py", line 222, in __init__
web_1      |     max_pool_size, document_class, tz_aware, _connect, **kwargs)
web_1      |   File "/usr/local/lib/python2.7/site-packages/pymongo/mongo_client.py", line 352, in __init__
web_1      |     raise ConnectionFailure(str(e))
web_1      | pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused
argumanorgmaster_web_1 exited with code 1
capricornusx commented 6 years ago

My full output from console docker-compose up --force-recreate --build --no-color > log.txt is attached:

log.txt

radhikavm commented 6 years ago

I am experiencing the same issue, any rough ideas to solve this

radhikavm commented 6 years ago

So it appears that when I substitute localhost with 172.17.0.1 in setting_local.py it works as expected