Heroku Deployment Not working for Latest(0.232.1)

Describe the problem/error/question

We have tested N8N locally and are now looking to deploy it to Staging for further development and testing before moving to production.

Reading the process behind deploying on Heroku for N8N was similar to our on-premise deployment of Retool. Requiring us to create a Heroku App that uses the container runtime so that the Docker Image is built on deploy.

Thus, we setup a Heroku container to try and deploy the N8N Latest (0.232.1) release. We were able to configure the heroku app to have all the env variables, postgres and papertrail.

We forked and began to use: GitHub - n8n-io/n8n-heroku

We pushed up the git repo for a deployment, image built things were looking good. But inside of Papertrail post docker-build we can see the following inside error. In which N8N is not responsive at the associated Url provided by Heroku. It throws a 500.

Papertrail Log
Jun 15 13:17:18 [n8n-staging] Build succeeded
Jun 15 13:17:25 [n8n-staging] Starting process with command /entrypoint.sh
Jun 15 13:17:26 [n8n-staging] N8N will start on ‘21821’
Jun 15 13:17:26 [n8n-staging] postgres://:@ec2.compute-1.amazonaws.com:5432/**
Jun 15 13:17:28 [n8n-staging] License manager not initialized
Jun 15 13:17:28 [n8n-staging] UserSettings were generated and saved to: /home/node/packages/cli/.n8n/config
Jun 15 13:17:30 [n8n-staging] State changed from starting to crashed
Jun 15 13:17:30 [n8n-staging] Process exited with status 1
Jun 15 13:18:12 [n8n-staging] at=error code=H10 desc=“App crashed” method=GET path=“/” host=n8n-staging-c2d46655f640.herokuapp.com dyno= connect= service= status=503 bytes= protocol=https

Have tried rolling back to different versions of N8N. Unable to find a version that works.

Information on your n8n setup

  • n8n version: 0.232.1
  • Database (default: SQLite): Postgres 15.3
  • n8n EXECUTIONS_PROCESS setting (default: own, main): runs /entrypoint.sh from Web Dyno
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker / Container deploy on Heroku
  • Operating system:

Looking for Help in the following

  • Can anyone confirm they are able to run N8N on Heroku on the latest Postgres and Release? I see lots of support issues from years ago with folks struggling with deploying on Heroku. Curious if anyone can confirm this deploy is working (had past projects that failed to maintain their Heroku deployment) and want to de-risk our decision. If we can’t get this deployed we will have to move on.
  • Can anyone provide next steps on how to best triage and understand why the App is Crashing? My prediction potentially is that the PORT isn’t getting bound, I understand that Heroku has to handle a proxy between port 443 on the load-balancer back to N8N as indicated above it denotes which port it starts on.

Appreciate any help here.

Hey @Morgan_Craft,

Not sure if Papertrail removes data from the log but the database connection doesn’t look right to me.

Jun 15 13:17:26 [n8n-staging] postgres://:@ec2.compute-1.amazonaws.com:5432/**

Did you remove some of the data from the log? I do suspect looking at the error that the issue is likely to be with the database a quick way to test that would be to remove the Postgres options and see if it starts.

Yeah I removed username:password from the Postgres connection as it was sensitive information and I also scrubbed some of the other sensitive info. But Heroku auto-sets that information when you attach Postgres so the credentials are correct, but maybe there are other issues? I often have times with postgres needing to be ssl based. So maybe I’ll try disabling runtime with Postgres as a means to trouble shoot.

What is the specific steps to disable Postgres? Is there an environment variable/flag I need to set?

For anyone that comes here a followup that is missing here from docs.

When deploying to Heroku our account is an enterprise account so we don’t have access to the dynos listed in the one-button installer, so we had to configure everything my hand.

What ended up being the issue was we had to configure all of these additional ENV variables, don’t use the Heroku DATABASE_URL as it isn’t going to map.

DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=postgres
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_DATABASE=<your postgres dB>
DB_POSTGRESDB_USER=<your postgres dB user>
DB_POSTGRESDB_PASSWORD=<password>
2 Likes

That is a good find, It sounds like we might need to update the Heroku repo.

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