Hi @Pilou (not Pilou at Framestore are you?)
$ docker image inspect --format '{{ .Id }}' cgwire/cgwire
sha256:db626e29b06875c3ae93d14504294b22cd0d4f5f9ab30ae05819685bf92974ff
$ docker container inspect --format '{{ .Image }}' cgwire
sha256:db626e29b06875c3ae93d14504294b22cd0d4f5f9ab30ae05819685bf92974ff
The next one threw an error.
$ docker exec -it cgwire su -l postgres -c "psql -d zoudb -c \"select email from person where role='admin';\""
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
And get ready for the big one…
$ docker exec -it cgwire /opt/zou/env/bin/zou create_admin admin@example.com
Traceback (most recent call last):
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 1122, in _do_get
return self._pool.get(wait, self._timeout)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/queue.py", line 145, in get
raise Empty
sqlalchemy.util.queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2147, in _wrap_pool_connect
return fn()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 387, in connect
return _ConnectionFairy._checkout(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 766, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 516, in checkout
rec = pool._do_get()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 1138, in _do_get
self._dec_overflow()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 1135, in _do_get
return self._create_connection()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 333, in _create_connection
return _ConnectionRecord(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 461, in __init__
self.__connect(first_connect_check=True)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 651, in __connect
connection = pool._invoke_creator(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 105, in connect
return dialect.connect(*cargs, **cparams)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 393, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/opt/zou/env/lib/python3.5/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/zou/env/bin/zou", line 4, in <module>
__import__('pkg_resources').run_script('zou==0.3.3', 'zou')
File "/opt/zou/env/lib/python3.5/site-packages/pkg_resources/__init__.py", line 750, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/opt/zou/env/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1524, in run_script
exec(code, namespace, namespace)
File "/opt/zou/env/lib/python3.5/site-packages/zou-0.3.3-py3.5.egg/EGG-INFO/scripts/zou", line 129, in <module>
manager.run()
File "/opt/zou/env/lib/python3.5/site-packages/flask_script/__init__.py", line 412, in run
result = self.handle(sys.argv[0], sys.argv[1:])
File "/opt/zou/env/lib/python3.5/site-packages/flask_script/__init__.py", line 383, in handle
res = handle(*args, **config)
File "/opt/zou/env/lib/python3.5/site-packages/flask_script/commands.py", line 216, in __call__
return self.run(*args, **kwargs)
File "/opt/zou/env/lib/python3.5/site-packages/zou-0.3.3-py3.5.egg/EGG-INFO/scripts/zou", line 58, in create_admin
role="admin"
File "/opt/zou/env/lib/python3.5/site-packages/zou-0.3.3-py3.5.egg/zou/app/services/persons_service.py", line 33, in create_person
role=role
File "/opt/zou/env/lib/python3.5/site-packages/zou-0.3.3-py3.5.egg/zou/app/models/base.py", line 67, in create
db.session.commit()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/scoping.py", line 157, in do
return getattr(self.registry(), name)(*args, **kwargs)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 906, in commit
self.transaction.commit()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 461, in commit
self._prepare_impl()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 441, in _prepare_impl
self.session.flush()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2171, in flush
self._flush(objects)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2291, in _flush
transaction.rollback(_capture_exception=True)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 2255, in _flush
flush_context.execute()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 389, in execute
rec.execute(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/unitofwork.py", line 548, in execute
uow
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 156, in save_obj
base_mapper, states, uowtransaction
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 279, in _organize_states_for_save
states):
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py", line 1105, in _connections_for_states
connection = uowtransaction.transaction.connection(base_mapper)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 294, in connection
return self._connection_for_bind(bind, execution_options)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 392, in _connection_for_bind
conn = self._parent._connection_for_bind(bind, execution_options)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/orm/session.py", line 403, in _connection_for_bind
conn = bind.contextual_connect()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2112, in contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2151, in _wrap_pool_connect
e, dialect, self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 1465, in _handle_dbapi_exception_noconnection
exc_info
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb, cause=cause)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 186, in reraise
raise value.with_traceback(tb)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/base.py", line 2147, in _wrap_pool_connect
return fn()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 387, in connect
return _ConnectionFairy._checkout(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 766, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 516, in checkout
rec = pool._do_get()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 1138, in _do_get
self._dec_overflow()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
raise value
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 1135, in _do_get
return self._create_connection()
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 333, in _create_connection
return _ConnectionRecord(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 461, in __init__
self.__connect(first_connect_check=True)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/pool.py", line 651, in __connect
connection = pool._invoke_creator(self)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/strategies.py", line 105, in connect
return dialect.connect(*cargs, **cparams)
File "/opt/zou/env/lib/python3.5/site-packages/sqlalchemy/engine/default.py", line 393, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/opt/zou/env/lib/python3.5/site-packages/psycopg2/__init__.py", line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I had a feeling this may be due to my version of Docker, called Docker Toolbox, which runs within a VM (VirtualBox). So I gave it a try on Docker running directly on Linux (Ubuntu 16.10), which worked and I could login from there.