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

postgres:10.11 fails to start when PGPORT is passed #644

Closed
pkutsilina opened this issue Nov 28, 2019 · 4 comments · Fixed by #646
Closed

postgres:10.11 fails to start when PGPORT is passed #644

pkutsilina opened this issue Nov 28, 2019 · 4 comments · Fixed by #646
Labels

Comments

@pkutsilina
Copy link

pkutsilina commented Nov 28, 2019

When overriding default port with PGPORT env var on postgres:10.11, it fails to start:

docker run -e POSTGRES_DB=test -e POSTGRES_USER=test -e POSTGRES_PASSWORD=password -e PGPORT=5435 --network host postgres:10.11 -h 0.0.0.0
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Etc/UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... 
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
ok

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2019-11-28 14:29:44.349 UTC [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-11-28 14:29:44.369 UTC [48] LOG:  database system was shut down at 2019-11-28 14:29:43 UTC
2019-11-28 14:29:44.379 UTC [47] LOG:  database system is ready to accept connections
 done
server started
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.5435"?

Previous version postgres:10.10 works fine:

docker run -e POSTGRES_DB=test -e POSTGRES_USER=test -e POSTGRES_PASSWORD=password -e PGPORT=5435 --network host postgres:10.10 -h 0.0.0.0
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Etc/UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... 
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
ok

Success. You can now start the database server using:

    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....2019-11-28 14:30:45.403 UTC [43] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5435"
2019-11-28 14:30:45.433 UTC [44] LOG:  database system was shut down at 2019-11-28 14:30:45 UTC
2019-11-28 14:30:45.442 UTC [43] LOG:  database system is ready to accept connections
 done
server started
CREATE DATABASE


/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

2019-11-28 14:30:45.912 UTC [43] LOG:  received fast shutdown request
waiting for server to shut down....2019-11-28 14:30:45.919 UTC [43] LOG:  aborting any active transactions
2019-11-28 14:30:45.922 UTC [43] LOG:  worker process: logical replication launcher (PID 50) exited with exit code 1
2019-11-28 14:30:45.929 UTC [45] LOG:  shutting down
2019-11-28 14:30:45.997 UTC [43] LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

2019-11-28 14:30:46.052 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5435
2019-11-28 14:30:46.066 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5435"
2019-11-28 14:30:46.115 UTC [61] LOG:  database system was shut down at 2019-11-28 14:30:45 UTC
2019-11-28 14:30:46.133 UTC [1] LOG:  database system is ready to accept connections```

It affects dependents on postgres:10
@wglambert wglambert added the Issue label Dec 2, 2019
@wglambert
Copy link

Same issue as #637

@vmeow
Copy link

vmeow commented Dec 3, 2019

Also started seeing this issue (on postgres:9.5) as of 6 days ago, perhaps as a result of #642 which seems to remove custom port configuration.

@yosifkit
Copy link
Member

yosifkit commented Dec 3, 2019

To work around it, I would suggest using -p 5435 at the end of your line instead of -e PGPORT=5435 while we find a fix.

@tianon
Copy link
Member

tianon commented Dec 3, 2019

A proper fix is up at #646.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants