Hosting n8n-latest (via the image) on Cloud Run via PostgreSQL hosted in Google

Hi! I’m new to hosting n8n and hosting in general.

I’m hosting a PostgreSQL database via Google Cloud and trying to run n8n in Google Cloud Run, with it connected to the database.

I can successfully host n8n without the database, and I can also connect to the database without issues. However, when I try to connect n8n to the database via Cloud Run, I encounter the following errors:

“message: Cannot read properties of undefined (reading ‘database’)”
“The user-provided container failed to start and listen on the port defined provided by the PORT=5678 environment variable.”

I’ve tried using both port 8080 and port 5678, but the issue persists.

I am using the following environment variables:

DB_TYPE
DB_POSTGRESDB_DATABASE
DB_POSTGRESDB_HOST
DB_POSTGRESDB_PORT
DB_POSTGRESDB_USER
DB_POSTGRESDB_PASSWORD
DB_POSTGRESDB_SCHEMA
N8N_PORT

I’m also using the necessary n8n authentication variables. Additionally, I’ve set up the Cloud SQL connector to proxy the connection.

Is there something specific that I might be missing in my configuration?

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

latest version via docker.io/n8nio/n8n:latest

Hey @Casper_Seidenfaden

Can you share the full log output? It sounds like the env options may not be set correctly when n8n runs.

Do also have the storage configured or are you trying to run n8n without the persistent storage as that also changes things.

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