Permission denied running /tmp/collation-refresh*.sql after DB restore
Anonymous
FREEOP

a month ago

Hi Railway Support,

My PostgreSQL container fails during startup when trying to run a collation refresh SQL file created on the bind mount. The container logs show a filesystem permission error when psql attempts to read /tmp/collation-refresh*.sql.

Solved$10 Bounty

3 Replies

Railway
BOT

a month ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway about 1 month ago


Anonymous
FREEOP

a month ago

2026-07-21 17:38:19.259 UTC [18] LOG: starting PostgreSQL 18.4 (Debian 18.4-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit

2026-07-21 17:38:19.260 UTC [18] LOG: listening on IPv4 address "0.0.0.0", port 5432

2026-07-21 17:38:19.260 UTC [18] LOG: listening on IPv6 address "::", port 5432

2026-07-21 17:38:19.263 UTC [18] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2026-07-21 17:38:19.270 UTC [51] LOG: database system was interrupted; last known up at 2026-07-21 16:45:10 UTC

2026-07-21 17:38:19.653 UTC [51] LOG: database system was not properly shut down; automatic recovery in progress

2026-07-21 17:38:19.656 UTC [51] LOG: redo starts at 0/1BEF838

2026-07-21 17:38:19.656 UTC [51] LOG: invalid record length at 0/1BEF940: expected at least 24, got 0

2026-07-21 17:38:19.656 UTC [51] LOG: redo done at 0/1BEF908 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s

2026-07-21 17:38:19.662 UTC [49] LOG: checkpoint starting: end-of-recovery immediate wait

2026-07-21 17:38:19.674 UTC [49] LOG: checkpoint complete: wrote 0 buffers (0.0%), wrote 3 SLRU buffers; 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.014 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/1BEF940, redo lsn=0/1BEF940

2026-07-21 17:38:19.676 UTC [18] LOG: database system is ready to accept connections

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/1ee52fad-622d-4dfc-b5eb-746a1f9264a0/vol_krrpucw6w5m01los

Starting Container

collation-refresh: psql: error: /tmp/collation-refresh.FbO7lk.sql: Permission denied

IMG_7331.jpeg

Attachments


Status changed to Solved Anonymous about 1 month ago


Anonymous
FREEOP

a month ago

2026-07-21 17:38:19.259 UTC [18] LOG: starting PostgreSQL 18.4 (Debian 18.4-1.pgdg13+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 14.2.0-19) 14.2.0, 64-bit

2026-07-21 17:38:19.260 UTC [18] LOG: listening on IPv4 address "0.0.0.0", port 5432

2026-07-21 17:38:19.260 UTC [18] LOG: listening on IPv6 address "::", port 5432

2026-07-21 17:38:19.263 UTC [18] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"

2026-07-21 17:38:19.270 UTC [51] LOG: database system was interrupted; last known up at 2026-07-21 16:45:10 UTC

2026-07-21 17:38:19.653 UTC [51] LOG: database system was not properly shut down; automatic recovery in progress

2026-07-21 17:38:19.656 UTC [51] LOG: redo starts at 0/1BEF838

2026-07-21 17:38:19.656 UTC [51] LOG: invalid record length at 0/1BEF940: expected at least 24, got 0

2026-07-21 17:38:19.656 UTC [51] LOG: redo done at 0/1BEF908 system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.00 s

2026-07-21 17:38:19.662 UTC [49] LOG: checkpoint starting: end-of-recovery immediate wait

2026-07-21 17:38:19.674 UTC [49] LOG: checkpoint complete: wrote 0 buffers (0.0%), wrote 3 SLRU buffers; 0 WAL file(s) added, 0 removed, 0 recycled; write=0.004 s, sync=0.002 s, total=0.014 s; sync files=2, longest=0.001 s, average=0.001 s; distance=0 kB, estimate=0 kB; lsn=0/1BEF940, redo lsn=0/1BEF940

2026-07-21 17:38:19.676 UTC [18] LOG: database system is ready to accept connections

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/1ee52fad-622d-4dfc-b5eb-746a1f9264a0/vol_krrpucw6w5m01los

Starting Container

collation-refresh: psql: error: /tmp/collation-refresh.FbO7lk.sql: Permission denied

IMG_7331.jpeg

Attachments


Status changed to Awaiting Railway Response Railway about 1 month ago


Anonymous
FREEOP

a month ago

Please chown/chmod the generated SQL file on the bind mount so Postgres can read it:

sudo chown postgres:postgres /var/lib/containers/railwayapp/bind-mounts/1ee52fad-622d-4dfc-b5eb-746a1f9264a0/vol_krrpucw6w5m01los/tmp/collation-refresh*.sql sudo chmod 644 /var/lib/containers/railwayapp/bind-mounts/1ee52fad-622d-4dfc-b5eb-746a1f9264a0/vol_krrpucw6w5m01los/tmp/collation-refresh*.sql

Logs showing the error: collation-refresh: psql: error: /tmp/collation-refresh.*.sql: Permission denied

Please let me know when this is applied so I can restart/redeploy and confirm. Thanks.

IMG_7331.jpeg

Attachments


Status changed to Awaiting User Response nico about 1 month ago


Railway
BOT

23 days ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 23 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...