Thursday, September 14, 2006

Login failures with ASP.NET 2.0 Membership

I sometimes end up with a puzzled look on my face after trying to log into one of my web applications and getting a "login failed" message back despite being sure I've got the username and password right. The usual culprit is that I've forgotten to change the applicationName attribute in the config for the Membership section (explained nicely in a post by Scott Guthrie), but despite checking and re-checking when I had the same problem yesterday, it just wouldn't let me log in.

I started doing some tests, and found that if I wrote the code to do so, it would happily retrieve the password for a given username for me, but if I then used that same username and password in a call to Membership.ValidateUser() it still failed.

To cut a long story short, the problem turned out to be that the transaction log for the database was full, and the disk had run out of space. As such it's one of those rare occurrences that you may never encounter, but as it's rather obscure and there's no indication of what the problem is when the login attempt fails, maybe this post will help someone with the same issue one day.