We were getting errors running a content deployment job at a client site and the SharePoint logs on the source server was only showing the following details:

ContentDeploymentJob.DoServerToServer(): caught exception ‘System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

To debug this issue, I used the trusty ULS Viewer tool from Microsoft on both the source server and the destination server. The source server only returned that error on each run with no further information.

The destination server however, listed the following few errors:

A runtime exception was detected. Details follow.  Message: Access to the path ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867e’ is denied.  Technical Details: System.UnauthorizedAccessException: Access to the path ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867e’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
at Microsoft.SharePoint.Publishing.Administration.ContentDeploymentJob.<>c__DisplayClass44.<CreateDirectoryAsProcessAccount>b__43()
at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.<>c__DisplayClass4.<WriteFile>b__1()
at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.<>c__DisplayClass4.<WriteFile>b__0()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)

AND

Upload file ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867eExportedFiles.cab’ failed: Exception thrown was: Microsoft.SharePoint.Publishing.Administration.ContentDeploymentException: The file upload operation for ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867eExportedFiles.cab’ failed. Ensure that the import folder can be created and has sufficient disk space for the uploaded file. Exception : ‘Access to the path ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867e’ is denied.’ —> System.UnauthorizedAccessException: Access to the path ‘E:ContentDeployment7a00d1c5-38a6-4186-af54-c5ead00e867e’ is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, DirectorySecurity dirSecurity)
at Microsoft.SharePoint.Publishing.Administration.ContentDeploymentJob.<>c__DisplayClass44.<CreateDirectoryAsProcessAccount>b__43()
at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.<>c__DisplayClass4.<WriteFile>b__1()
at Microsoft.Office.Server.Security.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.<>c__DisplayClass4.<WriteFile>b__0()
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)     –
— End of inner exception stack trace —
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.<>c__DisplayClass4.<WriteFile>b__2(Exception exception)
at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.Office.Server.Diagnostics.ULS.SendWatsonOnExceptionTag(UInt32 tagID, ULSCatBase categoryID, String output, Boolean fRethrowException, TryBlock tryBlock, CatchBlock catchBlock, FinallyBlock finallyBlock)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.WriteFile(String filepath)
at Microsoft.SharePoint.Publishing.Internal.CodeBehind.ContentDeploymentUploadPage.OnPageLoad(Object sender, EventArgs e)

To resolve this issue, I had to change the permissions on the destination folder’s ContentDeployment folder to allow Full Control to the Farm Account. This change allowed the job to complete succesfully.

Hope this can help diagnose your own content deployment issues.