Note that there are some explanatory texts on larger screens.

plurals
  1. PODevise return incorect user ID?
    text
    copied!<p>I get the error shown below on sign in (via Devise)</p> <p>Oddly, Rails/Devise seems to be returning a user id of '1' even though there is no user in my users table with an id of '1'. This seems to happen kind of randomly, I can't figure out what the problem is.</p> <p>Here's the latest error message. </p> <p>ODBC::Error: S1000 (9001) [Microsoft][SQL Server Native Client 11.0][SQL Server]The log for database '[redacted]' is not available. Check the event log for related error messages. Resolve any errors and restart the database.: EXEC sp_executesql N'UPDATE [users] SET [last_sign_in_at] = ''2012-11-12T16:58:34.020'', [current_sign_in_at] = ''2012-11-13T08:44:33.586'', [sign_in_count] = 69, [updated_at] = ''2012-11-13T08:44:33.630'' <strong>WHERE [users].[id] = 1;</strong> SELECT @@ROWCOUNT AS AffectedRows'</p> <p>Here's the request params:</p> <pre><code>{"utf8"=&gt;"✓", "authenticity_token"=&gt;"[redacted]=", "user"=&gt;{"email"=&gt;"jkramxx@xx.com", "password"=&gt;"[FILTERED]", "remember_me"=&gt;"0"}, "commit"=&gt;"Sign in"} </code></pre> <p>There actually is no user in the db with an id of "1", and theres nothing wrong with the server. The user jkramxx@xx.com has id of 60. ( user id 1 was deleted from the db a while ago). I thought it might be something in the session cookie so i deleted that as well).</p> <p>I've seen similar odd behavior in the console, where I have been able to log in, but when I examine current_user in the debugger it shows the user having an id of '1' even though when I examine the db directly (using SQL Server Mgmt Studio) the user has id of 34 and there is no user with id of 1. Sometimes this beahvior goes away when I restart the debugger. All very random.</p> <p>Any suggestions?</p> <p>(Ruby 1.9.3./Rails 3.2.8 SQL Server 10 using ruby-obdc gem)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload