Publish fails with out of memory exception

Problem

Publication process stops at upload stage or at finalize stage. Examining the problem shows either of two options:

Failed to upload document

A specific file could not be uploaded and publish engine retried to upload the file several times. Each time failed. Log message in publish.log is similar to:

2017-10-13 12:35:48 Warning: Failed to upload file: File item: Documents\<filename>.pdf The remote server returned an error: (500) Internal Server Error.

AssertWeb.log shows a more detailed error message on the same issue:

AssertWeb Verbose: 0 : 2017-10-13 12.35.46:ProcessRequest:/AssertWeb/Publisher/UploadHandler.ashx?site=<site>&item=...:(noSession):NT AUTHORITY\IUSR:Uploading Site:<site> Directory:Documents\en-US FileName: <filename>.pdf
AssertWeb Error: 0 : 2017-10-13 12.35.47:ProcessRequest:/AssertWeb/Publisher/UploadHandler.ashx?site=<site>&item=...:(noSession):NT AUTHORITY\IUSR:An error occured in UploadHandler when processing request to site: <site>
AssertWeb Error: 0 : System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Web.HttpRawUploadedContent.AddBytes(Byte[] data, Int32 offset, Int32 length)
   at System.Web.HttpRequest.GetEntireRawContent()
   at System.Web.HttpRequest.get_InputStream()
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.StoreFile(HttpContext context, SiteFileItem item)
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.ProcessDocument(HttpContext context, SiteFileItem item)
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.ProcessRequest(HttpContext context)

Failed to finalize publication

The database file could not be uploaded to the server. Publish.log contains something like this:

2017-09-27 05.42.44 Warning: Failure Remote publish failed Failed to upload all files to the remote server

AssertWeb.log shows a more detailed error message on the same issue:

AssertWeb Verbose: 0 : 2017-09-27 05.42.43:ProcessRequest:/AssertWeb/Publisher/UploadHandler.ashx?site=<site>&item...:(noSession):NT AUTHORITY\IUSR:Uploading Site:<site> Directory: FileName:RemoteSiteArchive.zip
AssertWeb Error: 0 : 2017-09-27 05.42.43:ProcessRequest:/AssertWeb/Publisher/UploadHandler.ashx?site=<site>&item...:(noSession):NT AUTHORITY\IUSR:An error occured in UploadHandler when processing request to site: <site>
AssertWeb Error: 0 : System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Web.HttpRawUploadedContent.AddBytes(Byte[] data, Int32 offset, Int32 length)
   at System.Web.HttpRequest.GetEntireRawContent()
   at System.Web.HttpRequest.get_InputStream()
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.StoreFile(HttpContext context, SiteFileItem item)
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.ProcessFile(HttpContext context, SiteFileItem item)
   at Signifikant.Assert.Web.Viewer.Publisher.UploadHandler.ProcessRequest(HttpContext context)

Solution

Problem is related to the software not being able to address enough memory. The error is commonly not that the server is not having enough memory, but rather that the application is not able to address enough memory. This typically happens for large sites with large number of files. If the uploaded file is heavy, e.g. a large pdf or the finalize stage with a large database the error may occur.

Solution is to run web viewer in 64 bit mode. Disable the 32 bit option in IIS to resolve the issue


64 bit mode supported from version 4.2.2

Note that running web viewer in 64 bit mode is supported from version 4.2.2.

Also note that installer may have problems with 64 bit mode, so you may need to set IIS to 32 bit mode at installation and then reset IIS to 64 bit after installation.

Temporary workaround

A temporary work around involve trying:

  1. Reset IIS prior to publish to free resources and memory
  2. Manually copy the files that failed to upload.