Wednesday, February 13, 2008

SQL error when importing customization.xml

Today I was deploying from a development environment to a test environment and part of this is moving the customizations made within the CRM GUI. I simply exported the customizations.xml and tried to import it to the test system. Only to get a very angry "SQL Error". Hmm... not very nice to see those, that usually means that somethings gone really bad, and you usually wish you hade just taken a complete backup of CRM.

Well, things only got worse when I tried to access CRM with the common url, I got a really nasty error saying that some custom attribute wasn't at all like some other custom attribute. No dah, my worst fears just got real and I could only face the fact that the CRM meta database had somehow become corrupt. Really bad, testing was supposed to begin today, so really bad timing (and timeplan).

So, what to do? Since I couldn't access CRM I couldn't get to the import cusomtizations page, so I had a look in the SDK for the direct URL to the import customizations page (it is under sitemap customizations). I tried to reimport the customizations file from my development server, only to find that CRM now found the xml "malformed" in this file. After some testing, I found that it acctually found all customizations files to be malformed, not only the first one. So, something really sinister is at hand. Time to log into the SQL-Server.

The first message that faced me was that one of the drives had to litte disk space... I had a look and found that the main data disk had only 2 MB free. So, this was probably it. First, there probably hadn't been space enough for commiting all the changes that were in the new customization file and then there hadn't been space enough to upload the new customizations file. The error message of mal-formed xml had just been an erroneous error message.

So, I freed some space on the disk and just to be sure, I re-installed CRM entirely (it was just a test environment after all) and imported the customization file, and all went well!

Well, there was acctually one thing, when I imported the customization file I got an error saying that at some row XXX in the file there was something wrong. At the specific row, was a tag for setting "displayInApplication" or something like that for the entity "Bulk Operation". I tried to remove the tag and import it, which worked. I later remembered that I hadn't installed Update Rollup 2, which I later confirmed was the cause of this error. I had exported from a CRM 3 UR2 system and imported into a standard CRM 3, hence the error. So, I would suggest not removing the tag but instead updateing your CRM :).

Gustaf Westerlund
Microsoft Dynamics CRM Consultant

WM-Data/Logica CMG
www.logicacmg.com

No comments:

Post a Comment