Verdi Erel Ergün
Verdi Erel Ergün

Reputation: 1051

Trouble deploying to Heroku -- logs included

I'm running a Rails 3.09 Ruby 1.92 App on Bamboo stack on Heroku. The app works just fine in production mode running locally without problems. I'm trying to diagnose why the app won't run on Heroku. I'm getting a 500 Error Miscellaneous Server Error. Has anyone seen something like what's in the logs before?

This is my logs...

https://gist.github.com/2655795

Update: here's the updated log: https://gist.github.com/2655991

Update: I enabled config.whiny_nils = true in my production.rb file and now I am getting this error on Heroku but not running locally on my environment in production. I'm using Postgres locally.

G::Error: ERROR: null value in column "id" violates not-null constraint : INSERT INTO "sessions"

Upvotes: 0

Views: 438

Answers (2)

pushcx
pushcx

Reputation: 571

I bet you're migrating from MySQL.

Your table doesn't have a sequence, what pg uses instead of autoincrement. Instead of creating your table's id column with "id" integer NOT NULL,, use "id" serial,. Postgres will mention it's creating a sequence for you, and you can run \d tablename in the command line to see it.

Upvotes: 1

Kevin Bedell
Kevin Bedell

Reputation: 13414

Log into Heroku and run the following:

rake db:sessions:clear

It looks like you may have old session data laying around.

If you haven't done it before, you log into your Heroku instance by running:

heroku run bash --app my_app

Upvotes: 0

Related Questions