Cloud Run configuration of n8n

Hello

I have deployed N8N community in cloudrun on GCP .
I want that my service have a peristant volume and cloudrun is a severless option that give as the possibility to mout a volmume on bucket google cloud storage and that is the best way to have data encryption and accessibility .

I mounted it in the configuration of cloud run but there is no data in the bucket .
The problem seem that i have to declare it in n8n , can i use enivronement variable to declare volume ?
If not there is another way to do it .

My question still in this type of deployment i dont want any suggestion of other deployment using vms ; firebase can be accepted .

Thanks

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:
  • **n8n version: Version 1.51.1
  • **Database : default SQLite
  • **n8n EXECUTIONS_PROCESS setting :(default: own, main)
  • **Running n8n via : Cloud Run
  • **Operating system: No OS Cloud run is severless i build an image to artifact registry using your docker image

It works fine i can access and do workflows but the problem still in the volume that i want to configure ir with Google Cloud Storage

Hey @Hamza_Ferjeni,

Welcome to the community :cake:

We don’t have a guide available for Cloud Run which means getting n8n working on it with the data will come down to your knowledge of that platform. If it isn’t making the folder I would make sure it is being mounted correctly and in the correct path but it may also be worth remembering that we don’t currently fully support serverless environments so while you don’t want any suggestions for other deployment options it may be the best option for now.

Hey @Jon

Thanks a lot .
is there a possibility to announce a volume in enviroment variable ?

That isn’t really how it works, the application doesn’t control the volume but we do expect you to mount your volume to /home/node/.n8n this path for the user data can be changed with an env option though but the volume will need to be writeable as well.

We are looking into hosting n8n on CloudRun.
Have you run into issues like hibernation? Any other issues?
Have you been able to resolve the volume mount issue?

Thank you!

I’m also trying to run it in Cloud Run. I’m able to easily mount GCS bucket, but during startup I see this warning:

Permissions 0666 for n8n settings file /home/node/.n8n/config are too wide. This is ignored for now, but in the future n8n will attempt to change the permissions automatically. To automatically enforce correct permissions now set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true (recommended), or turn this check off set N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=false.

Not sure if it impacts it anyhow, but the service doesn’t start with the error:

[31merrore[39m | e[31mLast session crashede[39m {"file":"crash-journal.js","function":"init"}"

(N8N_LOG_LEVEL is set to debug)

Ok, that was issue on my side. I’ve fixed it, and now I’m facing these errors:

User settings loaded from: /home/node/.n8n/config
(node:9) Warning: TypeError
module: @oclif/[email protected]
task: findCommand (audit)
plugin: n8n
root: /usr/local/lib/node_modules/n8n
message: Cannot read properties of undefined (reading 'database')
See more details with DEBUG=*
› Error: command start not found
Container called exit(2).

Env vars I have set:

DB_POSTGRESDB_DATABASE=n8n
DB_POSTGRESDB_PASSWORD=yyy
DB_POSTGRESDB_PORT=5432
DB_TYPE=postgres
N8N_TEMPLATES_ENABLED=true
DB_POSTGRESDB_USER=n8n
N8N_ENCRYPTION_KEY=yyy
GENERIC_TIMEZONE=Europe/Berlin
N8N_PROXY_HOPS=1
N8N_LOG_LEVEL=debug
N8N_EDITOR_BASE_URL=https://n8n.domain.com
DB_POSTGRESDB_SCHEMA=public
N8N_HOST=n8n.domain.com
N8N_ENFORCE_SETTINGS_FILE_PERMISSION=ture
DB_POSTGRESDB_HOST=/cloudsql/project:europe-west1:n8n/.s.PGSQL.5432

Any ideas where to start digging?

Same here. It seems that this is a good option but I haven’t tried yet:

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