Monday, February 20, 2012

Cannot login into Sitecore. [Friday Case]


A post about one of the most random problems ever. I was pulling my hair out for a while on this one, thus this definitely deserves the right to be highlighted in the “Friday Case” category.

As I have to install quite few versions of Sitecore locally (for every customer I work with actually), I came up with a sort of nomenclature for my local hostnames:

http://<sitecorever>X<rev>.local.com/

For example:

http://clean650x111230.local.com/
http://clean641x110720.local.com/

The decision to use “X” between version and revision was openly stolen from Andrew, a colleague of mine. This gives me and idea of which exact version I am using, plus provides with an ability to add all .local.com sites to Trusted Zone and fuggedaboutit.
The install happens via a PowerShell script which takes under a minute. Sweet.

Now just about recently I noticed that after install I cannot log into Sitecore anymore with the default credentials. The strangest thing ever, it works in any browser other than IE. The login page posts back without giving me any indication:

image

The log files were not particularly helpful either:

6344 10:01:56 INFO  AUDIT (sitecore\admin): Login
6860 10:01:57 INFO  AUDIT (sitecore\Anonymous): Logout
6860 10:01:57 WARN  Protected page accessed with no current user
4892 10:02:42 INFO  AUDIT (sitecore\admin): Login
3240 10:02:42 INFO  AUDIT (sitecore\Anonymous): Logout
3240 10:02:42 WARN  Protected page accessed with no current user

Then I noticed the difference between other instances where everything worked just fine. The difference was the underscore character in the hostname which I started using just recently:
http://clean_641x110720.local.com/

Did not take much time to find why:

Avoid using the underscore (_) character in machine names. Internet standards dictate that domain names conform to the host name requirements described in Internet Official Protocol Standards RFC 952 and RFC 1123. Domain names must contain only letters (upper or lower case) and digits. Domain names can also contain dash characters ( - ) as long as the dashes are not on the ends of the name. Underscore characters ( _ ) are not supported in the host name.

Mamma Mia! I should be reading the standards more. Had no idea.

Hope this helps in case if you find yourself breaking your neck like myself.

3 comments:

sanket said...

Hi,

This is happening to my client as well. Often, they are not able to login so have to reset the password and then they can log back in.
If I log in with those credentials in IE then it works fine for me.
I am unable to find much from the sitecore logs as it just says
INFO AUDIT (sitecore\username): Login.
The hostname doesn't have any underscore in my case and I am still not sure why it happens.

Brian Blackie said...

Alex - you are a friggin legend. I probably spent 4 hours trying to figure that one out before finally plugging that error message into the web. I created a whole new branch with backups from prod, etc

Alex Shyba said...

Thanks, Brian!

Glad it was helpful ;-)