Reset Guest User fails: SQL Server 2019 Insert on User table failed #3732
Unanswered
vincent-polite
asked this question in
Error / Bug Report
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I was attempting to reset the behavior of my guest account because I realized that the login feature wasn't fully fleshed out yet (no forgot password functionality). When I used the option to reset the Guest account to system defaults, it failed, and my server crashed because the Guest account had been deleted.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect the feature to work without crashing the server. :) However, this might have been a database specific thing. I was able to fix it for myself by examining source code, but my dive was brief, so I wanted to report this in case there was a better way to handle this.
Resetting the guest user attempted to delete the guest account and reestablish it. Looking at the check where it looks for the Guest account, it looks for an account of id = 2, which is kind of a brittle check if someone messes with the user tables, but nonetheless...
I ended up having to do the following:
SET IDENTITY_INSERT OFF
INSERT Users (columns) (values)
SET IDENTITY_INSERT ON
with some appropriate flags to get by the Guest Account check and have a working system again.
I'm not sure if your code attempts to execute these commands and my database account just didn't have permissions, but it was successful at deleting the guest account which borked the system, but couldn't successfully insert a new account.
I did notice that somewhere along the way my user account ids had autoincremented their way to 11 even though I only had 4 active accounts, so not sure what database calls were going on there.
Host Info (please complete the following information):
Beta Was this translation helpful? Give feedback.
All reactions