Does the docker-compose withPostgres work for anyone here?

Talking about this here: https://github.com/n8n-io/n8n/tree/master/docker/compose/withPostgres

I created and edited .env, downloaded init-data.sh and slightly edited docker-compose.yml

Getting this error:

n8n-db  | CREATE DATABASE
n8n-db  | /usr/local/bin/docker-entrypoint.sh: line 173: /docker-entrypoint-initdb.d/init-data.sh: Permission denied

the full logis:

n8n-db  | The files belonging to this database system will be owned by user "postgres".
n8n-db  | This user must also own the server process.
n8n-db  |
n8n-db  |
n8n-db  | The database cluster will be initialized with locale "en_US.utf8".
n8n-db  | The default database encoding has accordingly been set to "UTF8".
n8n-db  | The default text search configuration will be set to "english".
n8n-db  |
n8n-db  |
n8n-db  | Data page checksums are disabled.
n8n-db  |
n8n-db  |
n8n-db  | fixing permissions on existing directory /var/lib/postgresql/data ... ok
n8n-db  | creating subdirectories ... ok
n8n-db  | selecting dynamic shared memory implementation ... posix
n8n-db  | selecting default max_connections ... 100
n8n-db  | selecting default shared_buffers ... 128MB
n8n-db  | selecting default time zone ... Europe/Berlin
n8n-db  | creating configuration files ... ok
n8n-db  | running bootstrap script ... ok
n8n-db  | sh: locale: not found
n8n-db  | 2023-07-31 15:53:07.767 CEST [30] WARNING:  no usable system locales were found
n8n-db  | performing post-bootstrap initialization ... ok
n8n-db  | syncing data to disk ... ok
n8n-db  |
n8n-db  |
n8n-db  | initdb: warning: enabling "trust" authentication for local connections
n8n-db  | You can change this by editing pg_hba.conf or using the option -A, or
n8n-db  | --auth-local and --auth-host, the next time you run initdb.
n8n-db  |
n8n-db  |
n8n-db  | Success. You can now start the database server using:
n8n-db  |
n8n-db  |
n8n-db  |     pg_ctl -D /var/lib/postgresql/data -l logfile start
n8n-db  |
n8n-db  |
n8n-db  | waiting for server to start....2023-07-31 15:53:13.589 CEST [37] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
n8n-db  | 2023-07-31 15:53:13.594 CEST [37] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
n8n-db  | 2023-07-31 15:53:13.644 CEST [38] LOG:  database system was shut down at 2023-07-31 15:53:08 CEST
n8n-db  | 2023-07-31 15:53:13.662 CEST [37] LOG:  database system is ready to accept connections
n8n-db  |  done
n8n-db  | server started
n8n-db  | 2023-07-31 15:53:17.329 CEST [56] FATAL:  database "n8n" does not exist
n8n-db  | CREATE DATABASE
n8n-db  | /usr/local/bin/docker-entrypoint.sh: line 173: /docker-entrypoint-initdb.d/init-data.sh: Permission denied
n8n-db  |
n8n-db  |
n8n-db  |
n8n-db  |
n8n-db  | /usr/local/bin/docker-entrypoint.sh: sourcing /docker-entrypoint-initdb.d/init-data.sh

Is this about file permissions or about DB permissions?

It runs out it was a files permission issue. I am now a step further.

n8n-db  | PostgreSQL init process complete; ready for start up.
n8n-db  |
n8n-db  |
n8n-db  | 2023-07-31 16:01:29.172 CEST [1] LOG:  starting PostgreSQL 14.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
n8n-db  | 2023-07-31 16:01:29.172 CEST [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
n8n-db  | 2023-07-31 16:01:29.172 CEST [1] LOG:  listening on IPv6 address "::", port 5432
n8n-db  | 2023-07-31 16:01:29.224 CEST [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
n8n-db  | 2023-07-31 16:01:29.251 CEST [62] LOG:  database system was shut down at 2023-07-31 16:01:28 CEST
n8n-db  | 2023-07-31 16:01:29.267 CEST [1] LOG:  database system is ready to accept connections
n8n     | Last session crashed
n8n     | n8n ready on 0.0.0.0, port 5678
n8n     | Initializing n8n process
n8n     |
n8n     |
n8n     | Waiting for tunnel ...
n8n     | Tunnel URL: https://secret.hooks.n8n.cloud/
n8n     |
n8n     |
n8n     | IMPORTANT! Do not share with anybody as it would give people access to your n8n instance!
n8n     | Version: 1.0.5
n8n     |
n8n     |
n8n     | /usr/local/lib/node_modules/n8n/node_modules/localtunnel/lib/TunnelCluster.js:52
n8n     |           new Error(
n8n     |           ^
n8n     | Error: connection refused: hooks.n8n.cloud:33641 (check your firewall settings)
n8n     |     at Socket.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/localtunnel/lib/TunnelCluster.js:52:11)
n8n     |     at Socket.emit (node:events:513:28)
n8n     |     at Socket.emit (node:domain:489:12)
n8n     |     at emitErrorNT (node:internal/streams/destroy:151:8)
n8n     |     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
n8n     |     at processTicksAndRejections (node:internal/process/task_queues:82:21)
n8n exited with code 1

It looks like there have been major changes, n8n used to just work nice and simple behind traefik as a reverse proxy. Now I see stuff like some secure cloud tunnel stuff, and it seems to crash. :frowning:

Open for any hints and tips if someone can spot something.

Hey @ovizii,

That erorr looks like n8n is being started with the --tunnel option but we don’t include that in the GitHub example you linked to. Out of interest what was the slight edit you made to the compose file?

Thanks for spotting that!

I was trying to adapt my old docker-compose.yml to your new version and missed that command line with the --tunnel option.

Here is where I am coming from (just FYI).

Initially, I didn’t have my variables in .env but since init-data.sh is looking for them there, I removed them from my compose file and, well, I missed the line with command:

let me go back and try again.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.