CRM 2011 – an error occurred while connecting to the MSCRM_CONFIG database

I got this error today when suddenly and for no reason I could work out their CRM 2011 stopped working (this has happened twice in one week with two different customers).

I have blogged about this error before and if you have got this error then check out the blog below

This time it was the same except the previous solution wasn’t working, although I thought it should

When I was trying to diagnose the problem, I noticed the MSCRM_CONFIG database wasn’t attched but  also it wasn’t detached.

I also noticed there was another database created with a guid type name, when I opened the database I noticed it was basically a copy of the MSCRM_CONFIG database (in terms of tables).

I’m not sure how this happened but it looked like some kind of backup or transaction had caused a copy of the MSCRM_CONFIG database.  I looked at the physical files of the guid database and it had the physical name of MSCRM_CONFIG.mdf.

I think maybe the server lost power and when the server came back up the guid database opened it locked the MSCRM_CONFIG.mdf file so when the real MSCRM_CONFIG database tried to lock it couldn’t.

CRM cannot function if the MSCRM_CONFIG database is down because this is basically a systems setting type database with information for all the organisations on the server.

To resolve the problem I had to unattach the guid database and then attach the MSCRM_CONFIG database and it came up and everything was working again.

here is a screenshot of the dodgy guid database