Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Job Processor Errors with Large Files

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ThomasRambach
785 Views, 2 Replies

Job Processor Errors with Large Files

I have a custom job processor job running that works fine for most files, but for large drawings it's generating errors. Not sure how to debug or figure out what's going on. Any ideas?

 

Here's the error:

 

3/3/2020 7:44:44 AM Job failed while processing. (Exception: Autodesk.Connectivity.WebServices.VaultServiceErrorException: 0

Server stack trace: 
   at Autodesk.Connectivity.WebServices.ServiceBase`1.ServiceProxy`1.Invoke(MethodInfo methodInfo, Object[] args, TServiceInterface obj)
   at Autodesk.Connectivity.WebServices.RealProxy`1.Invoke(IMethodCallMessage methodCallMsg, MethodInfo methodInfo, InvokeDelegate invokeFunc)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Autodesk.Connectivity.WebServices.IFilestoreService.UploadFilePart(Stream filecontents)
   at Autodesk.Connectivity.WebServices.FilestoreServiceBase.UploadFilePart(Stream filecontents)
  at OFC.Vault.JobProcessor.JobExtension.UploadFileResource(WebServiceManager svcmgr, String filename, Byte[] fileContents) in JobExtension.cs:line 1136

 

 

 

This is the offending code:

 

        public static ACW.ByteArray UploadFileResource(WebServiceManager svcmgr, string filename, byte[] fileContents)
        {
            svcmgr.FilestoreService.FileTransferHeaderValue = new ACW.FileTransferHeader();
            svcmgr.FilestoreService.FileTransferHeaderValue.Identity = Guid.NewGuid();
            svcmgr.FilestoreService.FileTransferHeaderValue.Extension = System.IO.Path.GetExtension(filename);
            svcmgr.FilestoreService.FileTransferHeaderValue.Vault = svcmgr.WebServiceCredentials.VaultName;

            ACW.ByteArray uploadTicket = new ACW.ByteArray();
            int bytesTotal = (fileContents != null ? fileContents.Length : 0);
            int bytesTransferred = 0;
            do
            {
                int bufferSize = (bytesTotal - bytesTransferred); //% MAX_FILE_TRANSFER_SIZE;
                byte[] buffer = null;
                if (bufferSize == bytesTotal)
                {
                    buffer = fileContents;
                }
                else
                {
                    buffer = new byte[bufferSize];
                    Array.Copy(fileContents, (long)bytesTransferred, buffer, 0, (long)bufferSize);
                }

                svcmgr.FilestoreService.FileTransferHeaderValue.Compression = ACW.Compression.None;
                svcmgr.FilestoreService.FileTransferHeaderValue.IsComplete = (bytesTransferred + bufferSize) == bytesTotal ? true : false;
                svcmgr.FilestoreService.FileTransferHeaderValue.UncompressedSize = bufferSize;

                using (var fileContentsStream = new MemoryStream(fileContents))
                    uploadTicket.Bytes = svcmgr.FilestoreService.UploadFilePart(fileContentsStream);
                bytesTransferred += bufferSize;

            } while (bytesTransferred < bytesTotal);

            return uploadTicket;
        }

 

 

2 REPLIES 2
Message 2 of 3

Getting more clues. This is the error showing up in the ADMS FileStore logs that matches the error time with the Job Processor:

 

Exception(Inner): The maximum message size quota for incoming messages (52428800) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Stacktrace(Inner): 
Message 3 of 3

Resolved.

 

I bumped the Vault server web.config maxReceivedMessageSize up to a much higher number and the issue resolved itself. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums