You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
django32-postgres docker: run 'postgres:13' (from 'postgres')
django32-postgres docker: health check 'docker.io/library/postgres:13' (from 'postgres')
django32-postgres docker: leave 'f45481a0ec' (from 'postgres') running
___________________________________________________________________ summary ___________________________________________________________________
ERROR: django32-postgres: 'docker.io/library/postgres:13' (from 'postgres') failed health check
Traceback (most recent call last):
File "/usr/bin/tox", line 33, in <module>
sys.exit(load_entry_point('tox==3.24.1', 'console_scripts', 'tox')())
File "/usr/lib/python3.9/site-packages/tox/session/__init__.py", line 44, in cmdline
main(args)
File "/usr/lib/python3.9/site-packages/tox/session/__init__.py", line 69, in main
exit_code = session.runcommand()
File "/usr/lib/python3.9/site-packages/tox/session/__init__.py", line 197, in runcommand
return self.subcommand_test()
File "/usr/lib/python3.9/site-packages/tox/session/__init__.py", line 225, in subcommand_test
run_sequential(self.config, self.venv_dict)
File "/usr/lib/python3.9/site-packages/tox/session/commands/run/sequential.py", line 22, in run_sequential
runtestenv(venv, config)
File "/usr/lib/python3.9/site-packages/tox/session/commands/run/sequential.py", line 73, in runtestenv
config.pluginmanager.hook.tox_runtest_pre(venv=venv)
File "/usr/lib/python3.9/site-packages/pluggy/hooks.py", line 286, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/lib/python3.9/site-packages/pluggy/manager.py", line 93, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/lib/python3.9/site-packages/pluggy/manager.py", line 84, in <lambda>
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
File "/usr/lib/python3.9/site-packages/pluggy/callers.py", line 208, in _multicall
return outcome.get_result()
File "/usr/lib/python3.9/site-packages/pluggy/callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "/usr/lib/python3.9/site-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/lib/python3.9/site-packages/tox_docker/__init__.py", line 338, in tox_runtest_pre
raise HealthCheckFailed(msg)
tox_docker.HealthCheckFailed: 'docker.io/library/postgres:13' (from 'postgres') failed health check
Maybe you need to specify the full path to pg_isready? I'm not sure what PATH exists when health checks are run (possibly it's empty).
If that fails, you could try docker run -e POSTGRES_PASSWORD=postgres -t -i --health-start-period 1s --health-interval 1s --health-timeout 1s --health-retries 30 --health-cmd "pg_isready --username postgres" postgres:13 to debug...
That should be equivalent to what tox-docker is running.
I'm using this code on my
tox.ini
:And the container is never reported as healthy:
Here's the output of
docker inspect...
:Using
docker exec -it c1 pg_isready --username postgres
exits zero. (and prints/var/run/postgresql:5432 - accepting connections
).Any ideas what I'm doing wrong?
The text was updated successfully, but these errors were encountered: