← Back to Upcase

"Invalid auth token" when deploying rails app


(Shankar Dhanasekaran) #1

I get this error

Invalid auth token

on my production website deployed using capistrano and puma. Just that error on a white screen and nothing else. How do I debug this?

I googled for similar error but all of them are dated and deal with browser specfic issue with Safari but for me opening the website in any browser gives this error.


(Geoff Harcourt) #2

If your application is working in development but not production?

If the app works in development mode but only fails in production, then it could be that you are not successfully setting your config.secret_token value. If you are (correctly) keeping this data out of source control and loading it from an environment variable, it’s possible the environment variable doesn’t exist on your production machine.

Take a look at config/initializers/secret_token.rb and see if you are setting Application::config.secret_token from a value in the ENV hash, then check to see if that value is being defined in your production machine’s environment configuration.

Hope this helps.


(Shankar Dhanasekaran) #3

yes, my application works on development but not in production.

I’m using rails 4 which doesn’t have secret_tokan, rather secret_key_base. It has value. Anything else that I can debug? Thanks for your help.


(Geoff Harcourt) #4

Next step is to get the log output. Can you capture the lines from log/production.log when you make a request and get that response and then post them here or link to a private Gist so we can try to trace back to the cause of the issue?