Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] If the used postgresql server has more than 3 databases docker-entrypoint.sh hangs #610

Closed
nipatiitti opened this issue Mar 7, 2023 · 1 comment · Fixed by #631
Labels

Comments

@nipatiitti
Copy link

Tag/version of Container Images
0.4.5

If the postgresql server has more than 3 databases postgresql will output --More-- at the end of \l command.

In the loop of wait_for_postgres in docker-entrypoint.sh

until psql $DATABASE_URL -c '\l'; do
	>&2 echo "Postgres is unavailable - sleeping"
	sleep 1
done

the psql $DATABASE_URL -c '\l' hangs because it's waiting for someone to press space and for --More-- to continue and the connection to end.

Fixes:

Monkeypatch version:
Create .psqlrc file with \pset pager off in it and mount it to /root/.psqlrc

Proper fix:
Add psql -P pager=off ... to the until line of the loop.

@nipatiitti nipatiitti added the bug label Mar 7, 2023
@maxking
Copy link
Owner

maxking commented Mar 10, 2023

Thanks @nipatiitti for the repo and proposed fixes, do you want to submit a PR with the fixes?

maxking added a commit that referenced this issue Jun 19, 2023
This allows for non-interactive use and doesn't hang on the user
input in certain conditions, like when the command output is large.

Fixes #610
maxking added a commit that referenced this issue Jun 20, 2023
This allows for non-interactive use and doesn't hang on the user
input in certain conditions, like when the command output is large.

Fixes #610
raph-topo pushed a commit to raph-topo/docker-mailman that referenced this issue Jun 26, 2023
This allows for non-interactive use and doesn't hang on the user
input in certain conditions, like when the command output is large.

Fixes maxking#610
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants