torsdag 31 januari 2013

CRM has encountered a problem

I recently ran into the annoying pop up when I closed a window saying CRM has encountered a problem... asking if I wanted to send a message to Microsoft. When I looked at the info about to be sent, the error message was "The disk is full".

This made me a bit worried since I just cleared trace logs since june on that machine after a lot of testing and reconfiguration of the ADFS and IFD. The disk was far from full I realized after logging in to the server and taking a look, no problems in the database either.

I tried to find similar errors but there were no real answers for me which turned me to Microsoft's forum where I asked a question about this.
The obvious answer I got was "Have you turned on trace and looked at the logs?". That was of course one thing I hadn't done, even though I had a look at the trace directory, and an almost as obvious return question as "have you published your changes".
The trace gave me a clue about where to look since the culprit was the "refresh.png" in the Activity Feeds addon.

This clue gave me a bit more to go on and there were indeed quite a few having problems with activity feeds i general and the refresh.png in particular. One thing that was common was that the error message in the trace gave the path as ".../refresh.png" when the web resource name is ".../msdyn_/refresh.png". The second path was accessable with a browser and the first one wasn't. Still I have had Activity Feeds work on several installations so the addon itself can't be the entire problem.

On the website for Activity Feeds I saw  few comments about Activity Feed not being available in this or that langage. That made me a bit curious since we had an English server installation with a Swedish MUI on top and the tennant I had problems with had Swedish as base language.
I opened the organization and enabled English, refreshed the Explorer and bingo, no problems anymore.

This raises a few questions. Why can Activity Feed translade a faulty URL when there is English provishoned? Why did the Swedish base language mess things up (I suppose) and why on earth is the error message sent to Microsoft "The disk is full".


The error messages in CRM is a story by itself so this is no "one hit wonder".

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se   

fredag 25 januari 2013

CRM 4.0 upgrade quits with error Attachment file size is too big.

I recently had an assignment to upgrade a CRM 4.0 to CRM 2011 which at first looked like a very straight forward upgrade since there were close to none customizations done to the system. That quickly changed when I started the upgrade process which halted with the error message "Attachment file size is too big". It seems no one encountered this problem since there wereno relevant examples of how to deal with it.


What seemed like a very straight forward migration upgrade soon turned into something of a stand still. I had installed the new server which went very good and the old database backup was restored to the new SQL server. It was a 16 GB database but there were no customizations to talk about.
I was rather pussled when the upgrade returned an error about Attachment size to big, I hadn't seen that before, nor had my colleague Gustaf Westerlund, and I didn't recall anything about it in the installation material either. The error message in the trace looked like this:


12:34:29| Error| Exception occured during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Action Microsoft.Crm.Tools.Admin.UpgradeNewSolutionAwareEntities failed.
InnerException:
Microsoft.Crm.CrmException: Attachment file size is too big.
at Microsoft.Crm.ObjectModel.AttachmentServiceBase.ValidateAttachmentFileSize(Int32 base64dataSize, ExecutionContext context)
at Microsoft.Crm.ObjectModel.AttachmentServiceBase.Update(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.MailMergeTemplateService.Update(IBusinessEntity entity, ExecutionContext context)
at Microsoft.Crm.ObjectModel.SolutionsUpgrade.SolutionAwareEntityUpgradeBase.Upgrade(ExecutionContext context)
at Microsoft.Crm.Tools.Admin.UpgradeNewSolutionAwareEntities.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.CrmAction.ExecuteAction(CrmAction action, IDictionary parameters, Boolean undo)

I turned to the safest place to find answers, the INTERNET.

Normally when I search for information about CRM I get a ton of links pointing in all types of directions. This time there were two pages total, not a good sign. It would be clear that almost none of them handled my particular problem, most of them pointed out that you need to set the attachment size in the settings of the organization which wasn't an option.
Or so I thought.

Since we wanted to rule out the customer's server I moved the database backup to one of our development servers which gave the same result. The next move was to import the database to a CRM4 server in our development environment, perhaps it would help to get a higher UR of CRM 4. The import to our development CRM 4 server went smooth, no problems at all. This made me very hopeful but that hope went right out the window when I made a new backup of the imported organization and restored it on the CRM 2011 server, still problems with too large attachments.

It didn't help to edit the web.config to increase attachment file size either. However, that I was able to import the organization to our CRM 4 server made me a bit hopeful. It was possible to import the organization to a CRM 4 server but not to upgrade it to a CRM 2011, how was this possible?

After snooping around in settings and general places of the CRM 4 organization I saw that the attachment file size set in CRM 4 was 0, which in the picture below is set to 5 MB (I don't have any english CRM 4.0 available at the moment, sorry). This might mean that it has no max file size in CRM 4 since it obviously had file attached to emails however the setting seems to have a different meaning in CRM 2011. I set the max file size to 36 MB and took a new backup of the organization database, moved it to the CRM 2011 server and did an import.


Bingo. The upgrade went smooth and I had an upgraded organization that I was able to log in to. I find it a bit odd that this haven't happened to anyone blogging before me though

Please let me know if this has helped you, it would be nice to know I'm not alone :)

Rickard Norström
Developer at CRM-Konsulterna
www.crmkonsulterna.se