Click on the banner to learn about and purchase my database training on Azure

Reporting Services (SSRS) - Error deleting mobile reports (Error invoking authorization extension)

Views: 433 views
Reading Time: 4 minutes

Hello people,
Good evening.

In this post, I will demonstrate how to solve a very strange problem in SQL Server Reporting Services 2016, which occurs while trying to delete some mobile reports and receiving this error message:

Error invoking authorization extension.

As this message is not at all explanatory, I decided to try to analyze the Reporting Services log files (usually located in “C: \ Program Files \ Microsoft SQL Server \ MSRS13. Your_Instance \ Reporting Services \ LogFiles”) to try to identify any tips the source of the problem, but I found the following message in one of the files:

Microsoft.ReportingServices.Portal.WebHost! Library! B! 12/02/2016 - 14: 22: 00 :: and ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.AuthorizationExtensionException:, Microsoft.ReportingServices.Diagnostics.Utilities.AuthorizationExtensionException: Error invoking authorization extension. -> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.ReportingServices.Authorization.SdAndType.GetRightSecDesc (SecurityItemType crtItemType, Hashtable secDescHash, Byte [] & primSecDesc, Byte [] & secSecDesc)
at Microsoft.ReportingServices.Authorization.WindowsAuthorization.InnerCheckAccess (String userName, IntPtr userToken, SecurityItemType itemType, Byte [] secDesc, UInt32 & rightsMask, ReportSecDescType rptSecDescType)
at Microsoft.ReportingServices.Authorization.WindowsAuthorization. <> c__DisplayClassa. b__9 ()
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext. <> c__DisplayClass1. b__0 (Object state)
at System.Security.SecurityContext.Run (SecurityContext securityContext, ContextCallback Callback, Object state)
at Microsoft.ReportingServices.Diagnostics.RevertImpersonationContext.Run (ContextBody callback)
at Microsoft.ReportingServices.Authorization.WindowsAuthorization.CheckAccess (String userName, IntPtr userToken, Byte [] secDesc, FolderOperation requiredOperation)
at Microsoft.ReportingServices.Library.Security. <> c__DisplayClass1f. b__1c ()
at Microsoft.ReportingServices.Diagnostics.ExtensionBoundary.Invoke (Method m)

As you noticed, the error message was not very clear. I decided to try to open the report in the Microsoft SQL Server Mobile Report Publisher tool, and the error message below appeared:

sql-server-reporting-services-2016-error-invoking authorization-extension-5

I imagine this problem occurred because there were reports using a particular dataset, which was deleted without being removed from the report before (The tool should not allow deletion if there are dependencies).

Resolving the problem and deleting the files

As I could not get any solution using the graphical tools, I decided to try to solve it through the database, connecting in the instance where Reporting Services was installed and accessing the ReportServer database.

For those who have never used this database, the main 2 tables are:
- Datasets: Table that holds relationships between datasets and reports.


- Catalog: Table that holds reports and the entire structure and organization of Reporting Services objects. It is the main table of contents.


As there were several reports with this problem, where I was unable to delete them, I moved them to a folder called “Trash” and executed the queries below:

As a result, the “Trash” folder and all objects within it were successfully deleted from the database and no longer appear on the Reporting Services Web Portal.

Manual Solution: Editing the Report File

Another solution to this would be to download the report file and extract it to a folder (just like you do with a ZIP file). Opening this folder you will find the file sources.xml, which contains the datasets used by the report.

The file should have something like this:

Also edit the file metadata.xml, where this excerpt from the file is what interests us:

Now edit the file. definition.xml, which contains all the objects that make up the report, and look for all objects where the input is the name of the excluded dataset. The excerpt we are analyzing, are the descendant nodes of the tag , and has this structure:

Finally, inside the folder "date", delete the .json file whose title is the name of the deleted dataset. Now save everything back to the .RSMOBILE file you downloaded and edited and open it in Mobile Report Publisher.

Ready. Your report is opening again, without the dataset deleted. You can now post it again.

I hope you enjoyed the post and even more.