Brian McKeiver's Blog

Kentico CMS Quick Tip - Content Staging and Large Files

Content Staging is a really great feature of Kentico CMS. We use it all the time at BizStream. The major benefit that we get by using this feature is that it saves a ton of time when it comes to deploying content and object changes from our development servers to our client's production servers. However, earlier this week I ran into a slight issue with Content Staging. The dreaded synchronization failed error happened when I went to sync a new file in the Media Library. To be more specific the error I saw was:

The request failed with HTTP status 404: Not Found

A little background first. The whole idea of this feature is that when Content Staging is turned on, actions that are performed in the CMSSiteManager or CMSDesk are logged as task in the CMS. Then with the click of a button you can synchronize those tasks from your source server to a destination server. Content Staging is most useful when there is the case of more than one server environment, i.e.  development / staging / production.

Kentico CMS Content Staging

After taking a second look at the task that the sync service failed on, I noticed that the task was a CREATEOBJ task for creating a rather large .avi file. The file in question weighed in at over 60MB. This should have raised a bigger red flag for me than it did. I figured it was something to do with the file size, because other simple CREATEOBJ and UPDATEOBJ tasks were working.

After some trial and error, I reached out to the ever excellent Kentico Support team. They replied quickly with a simple explanation of how the Staging service works and pointed me in the right direction.

When the sync is executed, the data gets converted into an XML format - in case of file type, the XML also contains the binary data. This XML data is then sent over the web service as a string, a very long string and on the target the .Net framework fails when reading this very long string. This is why you are receiving a 404 error.

The ASP.Net framework can actually handles large files without issue. It's the default configuration of most web.config files that cause fun issues like this when you have large files that you are dealing with. 

The fix was quite simple actually. I just had to make sure the http request was able to finish before a timeout was hit and make sure the maximum request size was not being hit either. By default the maximum files size is slightly less than 30 MB. On IIS 7.0 to accomplish this you just need to check the following areas of the web.config file at the root of your Kentico CMS installation.

  maxRequestLength="2097152" executionTimeout="90" />

      maxAllowedContentLength="2147483648" />

What units are those large numbers in ?

  • maxRequestLength is specified in KB
  • executionTimeout is specified in Seconds
  • maxAllowedContentLength is specified in Bytes


Once those changes were made on both staging and live installations, the file sync'd over correctly, and I was back to being one happy developer. Special thanks to Kentico Support on this one.