0

I have an SQL Reporting Services 2016 (13.0.5103.6) Standard native instance which won't let me edit Reports (RDLs) with Report Builder 15.0.19611.0 or upload them via the Reports portal, it throws an exception and creates a memory dump. I can still execute/generate reports in the instance.

When opening report in Report Builder I get the client-side error of:

An unexpected error occurred in Report Processing. --->
Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. --->
System.Exception: For more information about this error navigate to the report server on the local server machine, or enable remote errors

On the server Reporting Services Log, the corresponding error log entry is:

processing!ReportServer_0-1!1ac8!12/23/2021-14:11:29:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: An unexpected error occurred in Report Processing. ---> System.ComponentModel.Win32Exception: The system cannot find the path specified
   at Microsoft.Win32.NativeMethods.CreateDirectory(String path, SafeLocalMemHandle acl)
   at System.CodeDom.Compiler.TempFileCollection.CreateTempDirectoryWithAce(String directory, String identity)
   at System.CodeDom.Compiler.TempFileCollection.GetTempFileName(String tempDir)
   at System.CodeDom.Compiler.TempFileCollection.EnsureTempNameCreated()
   at System.CodeDom.Compiler.TempFileCollection.AddExtension(String fileExtension, Boolean keepFile)
   at System.CodeDom.Compiler.CodeCompiler.FromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
   at System.CodeDom.Compiler.CodeCompiler.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] ea)
   at Microsoft.ReportingServices.RdlExpressions.VBExpressionCodeProvider.CompileAssemblyFromDomWithRetry(CompilerParameters options, CodeCompileUnit compilationUnit)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.InternalCompile(AppDomain compilationTempAppDomain, Boolean refusePermissions)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.<>c__DisplayClass2.<Compile>b__0()
   at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.<>c__DisplayClass1.<Run>b__0(Object state)
   at System.Security.SecurityContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Security.SecurityContext.Run(SecurityContext securityContext, ContextCallback callback, Object state)
   at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run(ContextBody callback)
   at Microsoft.ReportingServices.RdlExpressions.ExprHostCompiler.Compile(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, AppDomain compilationTempAppDomain, Boolean refusePermissions, PublishingVersioning versioning)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.Phase3(ParameterInfoCollection& parameters, Dictionary`2& groupingExprCountAtScope)
   at Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash)
   at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, PublishingErrorContext errorContext, String& reportDescription, String& report
library!ReportServer_0-1!1ac8!12/23/2021-14:11:29:: i INFO: Skipped creating a dump file for the error ReportProcessingException, because a dump with the identical stack trace (with signature 2668486527) was already created.

Assuming 'svcssrs' is the ADUser the SSRS instance is running under, using Procmon (Sysinternals) against ReportingServicesService.exe, I did notice a a CreateFile Operation failing with PATH NOT FOUND with paths such as C:\Users\svcssrs\AppData\Local\Temp\abcdefgh

C:\Users\svcssrs\AppData\Local\Temp\ exists and is under the full control of the 'svcssrs' user.

The RDL I'm working with is a very standard RDL file with Tablix, some MSSQL datasets using a shared Datasource, a few basic SSRS expressions, embedded images (not linked) and no embedded VB code or linked assemblies.

I have restored the SNK Encryption Key from a backup and I have also changed it afterwards with no change in behaviour.

How can I resolve this issue?

Vjz
  • 1
  • 2

2 Answers2

0

The issue was because the user profile folder C:\Users\svcssrs was deleted from the file system directly without deleting the User Profile via sysdm.cpl first. When the directory structure was recreated, it's suspected that other items related to the profile (eg: registry hive?) weren't created properly.

The issue was resolved by:

  1. Stopping the SSRS service
  2. Deleting the 'corrupted' 'svcssrs' user profile via sysdm.cpl
  3. Starting the SSRS service and letting it recreate the users profile
  4. Uploading the Backed Up Encryption Key (SNK) back to the SSRS instance.
Vjz
  • 1
  • 2
0

I just had similar problem, i.e. I could neither deploy reports with Visual Studio nor upload reports via the Report Manager. The only difference was that the Temp folder in the user profile was missing. The admin has recreated the folder and everything was working again.

The cause of the missing Temp folder was most problably a deletion by SilentCleanup (cleanmgr.exe) or Storage Sense (storsvc.exe). More details at %TEMP% folder that includes the logon session ID is deleted unexpectedly