Galaxy Docker not starting on MACOS

I am trying to run Docker Galaxy on my MacBook Air 256Gb.
I downloaded yesterday Docker and I am following the instructions in GitHub - bgruening/docker-galaxy-stable: Docker Images tracking the stable Galaxy releases.. Downloaded data yesterday.

When I start Galaxy using the first command in the documentation (docker run -i -t -p 8080:80 bgruening/galaxy-stable /bin/bash) everything works OK - and I stop the container created.

Because I have only 256 Gb on my MacBook Air, I am using a new external WD Elements 5Tb drive. I formatted it and my computer sees /Volumes/Elements and I created a directory :Docker_Galaxy there.

I start a new container using the follwing command:

docker run -d -p 8080:80
-p 8021:21
-p 8022:22
-v /Volumes/Elements/Docker:/export/
bgruening/galaxy-stable

and I encounter problems:

  1. When I go to http://localhost:8080/, I get a 403 Forbidden nginx/1.14.0 (Ubuntu)
  2. When I see the logs inside the container, I see the follwing errors.

Would appreciate any advice.
Thanks !

uwsgi.log
migrate.versioning.repository DEBUG 2021-10-02 22:24:37,776 [p:1150,w:0,m:0] [MainThread] Repository lib/galaxy/model/migrate loaded successfully
migrate.versioning.repository DEBUG 2021-10-02 22:24:37,776 [p:1150,w:0,m:0] [MainThread] Config: OrderedDict([(‘db_settings’, OrderedDict([(‘repository_id’, ‘Galaxy’), (‘version_table’, ‘migrate_version’), (‘required_dbs’, ‘’)]))])
Traceback (most recent call last):
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2345, in _wrap_pool_connect
return fn()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 364, in connect
return _ConnectionFairy._checkout(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 495, in checkout
rec = pool._do_get()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/impl.py”, line 140, in _do_get
self.dec_overflow()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 69, in exit
exc_value, with_traceback=exc_tb,
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 178, in raise

raise exception
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/impl.py”, line 137, in _do_get
return self._create_connection()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 309, in _create_connection
return _ConnectionRecord(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 440, in init
self.__connect(first_connect_check=True)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 661, in _connect
pool.logger.debug(“Error on connect(): %s”, e)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 69, in exit
exc_value, with_traceback=exc_tb,
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 178, in raise

raise exception
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 656, in __connect
connection = pool._invoke_creator(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py”, line 114, in connect
return dialect.connect(*cargs, **cparams)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File “/galaxy_venv/lib/python3.7/site-packages/psycopg2/init.py”, line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “lib/galaxy/webapps/galaxy/buildapp.py”, line 48, in app_factory
app = galaxy.app.UniverseApplication(global_conf=global_conf, **kwargs)
File “lib/galaxy/app.py”, line 97, in init
self._configure_models(check_migrate_databases=self.config.check_migrate_databases, check_migrate_tools=check_migrate_tools, config_file=config_file)
File “lib/galaxy/config/init.py”, line 1226, in _configure_models
create_or_verify_database(db_url, config_file, self.config.database_engine_options, app=self, map_install_models=combined_install_database)
File “lib/galaxy/model/migrate/check.py”, line 35, in create_or_verify_database
new_database = not database_exists(url)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py”, line 474, in database_exists
return bool(get_scalar_result(engine, text))
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py”, line 448, in get_scalar_result
result_proxy = engine.execute(sql)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2243, in execute
connection = self._contextual_connect(close_with_result=True)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2311, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2349, in wrap_pool_connect
e, dialect, self
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 1591, in handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from
=e
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 178, in raise

raise exception
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/base.py”, line 2345, in _wrap_pool_connect
return fn()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 364, in connect
return _ConnectionFairy._checkout(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 495, in checkout
rec = pool._do_get()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/impl.py”, line 140, in _do_get
self.dec_overflow()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 69, in exit
exc_value, with_traceback=exc_tb,
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 178, in raise

raise exception
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/impl.py”, line 137, in _do_get
return self._create_connection()
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 309, in _create_connection
return _ConnectionRecord(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 440, in init
self.__connect(first_connect_check=True)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 661, in _connect
pool.logger.debug(“Error on connect(): %s”, e)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py”, line 69, in exit
exc_value, with_traceback=exc_tb,
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/util/compat.py”, line 178, in raise

raise exception
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/pool/base.py”, line 656, in __connect
connection = pool._invoke_creator(self)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py”, line 114, in connect
return dialect.connect(*cargs, **cparams)
File “/galaxy_venv/lib/python3.7/site-packages/sqlalchemy/engine/default.py”, line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File “/galaxy_venv/lib/python3.7/site-packages/psycopg2/init.py”, line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: Connection refused
Is the server running on host “localhost” (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host “localhost” (::1) and accepting
TCP/IP connections on port 5432?

(Background on this error at: Error Messages — SQLAlchemy 1.4 Documentation)
(base) root@9fc05c3184e1:~/logs#

I am no expert with this at all but I can try to do an attempt to help a little before someone else gives the real answer. The error means that galaxy can not connect with the postgres server. Because you use the image I think we can assume that postgres is just not running. A simple check that comes to my mind is to try running the container with -p 9002:9002 and after that go to http://localhost:9002 and check if you see the webpage of supervisorctl. On the webpage you can see if postgres is running and the possible error.

If you are comfortable with the commandline you could try someting like docker exec -it <container_name> supervisorctl stop postgresql and docker exec -it <container_name> supervisorctl start postgresql or run the commands in interactive mode.

The above does not do much but it can maybe determine if postgres itself is the problem.

Hello gbbio !
Thanks for your reply.
I added port 9002 as you recommended to start the container, and when I checked postgres I got an error message: “unix:///var/run/supervisor.sock no such file” .
Here is the deck to start the container and below the log of the commands:

(base) georgeweingart@Georges-MacBook-Air Docker_Programs % docker run -d -p 8080:80
-p 8021:21
-p 8022:22
-p 9002:9002
-v /Volumes/Elements/Docker_Galaxy:/export/
bgruening/galaxy-stable

LOG:

35458608e92fb4f1508b2077c491c26f02fa1b35199298ca0d93343a959931e8

(base) georgeweingart@Georges-MacBook-Air Docker_Programs %
(base) georgeweingart@Georges-MacBook-Air Docker_Programs % docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
35458608e92f bgruening/galaxy-stable “/sbin/tini – /usr/…” 36 seconds ago Up 7 seconds 443/tcp, 8800/tcp, 0.0.0.0:9002->9002/tcp, 0.0.0.0:8021->21/tcp, 0.0.0.0:8022->22/tcp, 0.0.0.0:8080->80/tcp naughty_williamson
42f071f2d145 bgruening/galaxy-stable “/sbin/tini – /usr/…” 2 days ago Exited (143) 24 minutes ago nifty_lovelace
(base) georgeweingart@Georges-MacBook-Air Docker_Programs % docker exec -it naughty_williamson supervisorctl stop postgresql
unix:///var/run/supervisor.sock no such file
(base) georgeweingart@Georges-MacBook-Air Docker_Programs % docker exec -it naughty_williamson supervisorctl start postgresql
unix:///var/run/supervisor.sock no such file
(base) georgeweingart@Georges-MacBook-Air Docker_Programs %

To summarize:
All I want to do is to be able to “external volume” to a new 5TB drive I bought as I am short in space on my MacBook Air

Maybe I need to reformat the external drive in a special mode?

Thanks!