-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error in sessions_controller.rb:42 - on sign_in after application restart #941
Comments
I just encountered this error as well, running on Rails 5 on Heroku w/ Postgres. Somehow the
Not sure how that's happening; the only way I was able to replicate it locally was by bypassing DTA's callbacks when pushing a string into a User's I was able to workaround this by adding a small cleanup routine to the create sessions controller:
That works well but ideally I'd like to prevent those tokens values from ever being strings in the first place. |
Can someone that's having this problem provide steps to reproduce the issue? Please include anything about your setup that's different from the example app. I am unable to reproduce this issue by stopping and restarting the app as @gibo described. |
Suddenly I also started to have this issue. But my problem was that my user object was invalid in reason of a uniqueness validation checked before the gem update the tokens. Take a look if you guys has the same problem. |
@lynndylanhurley It's an absolutely standard set up.. however I did fix it by adding this to my migration
|
I'm specifically only running into this issue when deploying my rails app to Heroku. I noticed my local Postgres version is 9.6.2 and Heroku's is 9.6.4, but I'm not certain that is affecting anything. For me, this seems to happen after my initial User creation in my seed file when setting up the database. The workaround provided by @gibo fixes the issue, and the gem no longer creates string values for the tokens after signing into the app. Hopefully this helps track down the root cause. |
Closing since it's a duplicated of #681 and #121. @claycarpenter solution could be better than the migration solution, so maybe we can implement it here (but it's an ugly solution) |
I have a farily standard token auth app running on Rails 5 in production mode.
Main changes are:
Currently sign_in and sign_up work fine (with DB Seeds), however, it seems after the application is stopped and restarted, I get a 500.
Logs below.
Larger stack trace below...
The text was updated successfully, but these errors were encountered: