Home
%3CLINGO-SUB%20id%3D%22lingo-sub-302112%22%20slang%3D%22en-US%22%3ESharePoint%20On%20Premises-%20Error%20downloading%20files%20from%20IRM%20enabled%20library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-302112%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%224%22%3E%3CSTRONG%3EIssue%20in%20detail%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%224%22%3E%3CSTRONG%3E--------------------%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EUsers%20started%20complaining%20that%20the%20files%20are%20not%20getting%20downloaded%20from%20any%20document%20libraries%20that%20are%20protected%20with%20Information%20Rights%20Management%20Service.%20They%20know%20that%20it%20worked%20before%20but%20suddenly%20stopped%20working.%20While%20downloading%20the%20documents%20they%20are%20getting%20the%20error%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23800000%22%3E%22The%20document%20you%20tried%20to%20download%20could%20not%20be%20protected.%20You%20may%20need%20to%20contact%20the%20library%20administrator%20to%20help%20resolving.%20Error%20code%20is%3A%2080020009.%22%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3ESharePoint%20Administrators%20looked%20into%20the%20issue%20and%20found%20following%20errors%20in%20the%20ULS%20logs%20related%20to%20IRM%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%20dir%3D%22ltr%22%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3ESharePoint%20Foundation%20Information%20Rights%20Management%205806%20Critical%20Information%20Rights%20Management%20(IRM)%3A%20The%20email%20of%20the%20requesting%20user%20is%20empty.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20dir%3D%22ltr%22%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E%3CBR%20%2F%3ESharePoint%20Foundation%20Information%20Rights%20Management%205065%20Critical%20Information%20Rights%20Management%20(IRM)%3A%20There%20was%20a%20problem%20while%20trying%20to%20customize%20a%20base%20issuance%20license%20for%20a%20protected%20file.%20Current%20file%3A%20XXXXX%26nbsp%3BGUID%20of%20current%20list%3A%20%7BXXXXXXXXXXXX%7D%20An%20issuance%20licenses%20stored%20in%20an%20IRM%20protected%20file%20is%20customized%20from%20a%20generic%20issuance%20license%20template.%20Additional%20Data%20Error%20value%3A%200x80070057%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20dir%3D%22ltr%22%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E%3CBR%20%2F%3ESharePoint%20Foundation%20Information%20Rights%20Management%205820%20Critical%20Information%20Rights%20Management%20(IRM)%3A%20There%20was%20a%20problem%20while%20initializing%20IRM%20document.%20Status%20value%3A%20-1%2C%20error%20value%3A%200x80070057.%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20dir%3D%22ltr%22%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E%3CBR%20%2F%3ESharePoint%20Foundation%20Information%20Rights%20Management%205819%20Critical%20Information%20Rights%20Management%20(IRM)%3A%20There%20was%20a%20problem%20while%20ensure%20IRM%20client.%20Status%20value%3A%20-1%2C%20error%20value%3A%200x80020009.%26nbsp%3B%3CBR%20%2F%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EAll%20the%20errors%20pointed%20to%20IRM%20and%20upon%20checking%20it%20was%20confirmed%20that%20the%20IRM%20is%20configured%20correctly%20and%20the%20Service%20accounts%20are%20given%20the%20right%20privileges%26nbsp%3Bto%20use%20the%20service.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EOn%20further%20digging%20the%20ULS%20logs%20following%20error%20was%20discovered%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EGetting%20Error%20Message%20for%20Exception%20System.Web.HttpUnhandledException%20(0x80004005)%3A%20Exception%20of%20type%20'System.Web.HttpUnhandledException'%20was%20thrown.%20---%26gt%3B%20Microsoft.SharePoint.SPException%3A%20The%20document%20you%20tried%20to%20download%20could%20not%20be%20protected.%20You%20may%20need%20to%20contact%20the%20library%20administrator%20to%20help%20resolving.%20Error%20code%20is%3A%2080020009.%20---%26gt%3B%20System.Runtime.InteropServices.COMException%3A%20The%20document%20you%20tried%20to%20download%20could%20not%20be%20protected.%20You%20may%20need%20to%20contact%20the%20library%20administrator%20to%20help%20resolving.%20Error%20code%20is%3A%2080020009.%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String%20bstrUrl%2C%20String%20bstrWebRelativeUrl%2C%20Boolean%20bHonorLevel%2C%20Byte%20iLevel%2C%20OpenBinaryFlags%20grfob%2C%20String%20bstrEtagNotMatch%2C%20Object%20punkSPFileMgr%2C%20Boolean%20bHonorCustomIrm%2C%20IrmProtectionParams%20fileIrmSettings%2C%20UInt32%26amp%3B%20pdwVirusCheckStatus%2C%20String%26amp%3B%20pVirusCheckMessage%2C%20String%26amp%3B%20pEtagNew%2C%20String%26amp%3B%20pContentTagNew%2C%20SPFileInfo%26amp%3B%20pFileProps)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String%20bstrUrl%2C%20String%20bstrWebRelativeUrl%2C%20Boolean%20bHonorLevel%2C%20Byte%20iLevel%2C%20OpenBinaryFlags%20grfob%2C%20String%20bstrEtagNotMatch%2C%20Object%20punkSPFileMgr%2C%20Boolean%20bHonorCustomIrm%2C%20IrmProtectionParams%20fileIrmSettings%2C%20UInt32%26amp%3B%20pdwVirusCheckStatus%2C%20String%26amp%3B%20pVirusCheckMessage%2C%20String%26amp%3B%20pEtagNew%2C%20String%26amp%3B%20pContentTagNew%2C%20SPFileInfo%26amp%3B%20pFileProps)%20-%3CBR%20%2F%3E%20--%20End%20of%20inner%20exception%20stack%20trace%20---%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.SPGlobal.HandleComException(COMException%20comEx)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String%20bstrUrl%2C%20String%20bstrWebRelativeUrl%2C%20Boolean%20bHonorLevel%2C%20Byte%20iLevel%2C%20OpenBinaryFlags%20grfob%2C%20String%20bstrEtagNotMatch%2C%20Object%20punkSPFileMgr%2C%20Boolean%20bHonorCustomIrm%2C%20IrmProtectionParams%20fileIrmSettings%2C%20UInt32%26amp%3B%20pdwVirusCheckStatus%2C%20String%26amp%3B%20pVirusCheckMessage%2C%20String%26amp%3B%20pEtagNew%2C%20String%26amp%3B%20pContentTagNew%2C%20SPFileInfo%26amp%3B%20pFileProps)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.SPFile.GetFileStream(SPWeb%20web%2C%20String%20fileUrl%2C%20Boolean%20honorLevel%2C%20SPFileLevel%20level%2C%20OpenBinaryFlags%20openOptions%2C%20String%20etagNotMatch%2C%20SPFileStreamManager%20spMgr%2C%20SPFileRightsManagementSettings%20rightsManagementSettings%2C%20Boolean%20throwOnVirusFound%2C%20SPVirusCheckStatus%26amp%3B%20virusCheckStatus%2C%20String%26amp%3B%20virusCheckMessage%2C%20String%26amp%3B%20etagNew%2C%20String%26amp%3B%20contentTagNew%2C%20SPFileInfo%26amp%3B%20fileprops)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.SPFile.GetFileStream(OpenBinaryFlags%20openOptions%2C%20String%20etagNotMatch%2C%20String%26amp%3B%20etagNew%2C%20String%26amp%3B%20contentTagNew)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.ApplicationPages.Download.WriteFileInternal(String%20sourceUrl%2C%20SPFile%20file)%20%3CBR%20%2F%3E%20at%20Microsoft.SharePoint.ApplicationPages.Download.OnLoad(EventArgs%20e)%20%3CBR%20%2F%3E%20at%20System.Web.UI.Control.LoadRecursive()%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.ProcessRequestMain(Boolean%20includeStagesBeforeAsyncPoint%2C%20Boolean%20includeStagesAfterAsyncPoint)%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.HandleError(Exception%20e)%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.ProcessRequestMain(Boolean%20includeStagesBeforeAsyncPoint%2C%20Boolean%20includeStagesAfterAsyncPoint)%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.ProcessRequest(Boolean%20includeStagesBeforeAsyncPoint%2C%20Boolean%20includeStagesAfterAsyncPoint)%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.ProcessRequest()%20%3CBR%20%2F%3E%20at%20System.Web.UI.Page.ProcessRequest(HttpContext%20context)%20%3CBR%20%2F%3E%20at%20System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()%20%3CBR%20%2F%3E%20at%20System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep%20step)%20%3CBR%20%2F%3E%20at%20System.Web.HttpApplication.ExecuteStep(IExecutionStep%20step%2C%20Boolean%26amp%3B%20completedSynchronously)%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EFrom%20the%20above%20stack%20it%20was%20clear%20that%20its%20throwing%20exception%20at%3A%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E%3CSPAN%3EMicrosoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String%20bstrUrl%2C%20String%20bstrWebRelativeUrl%2C%20Boolean%20bHonorLevel%2C%20Byte%20iLevel%2C%20OpenBinaryFlags%20grfob%2C%20String%20bstrEtagNotMatch%2C%20Object%20punkSPFileMgr%2C%20Boolean%20bHonorCustomIrm%2C%20IrmProtectionParams%20fileIrmSettings%2C%20UInt32%26amp%3B%20pdwVirusCheckStatus%2C%20String%26amp%3B%20pVirusCheckMessage%2C%20String%26amp%3B%20pEtagNew%2C%20String%26amp%3B%20pContentTagNew%2C%20SPFileInfo%26amp%3B%20pFileProps)%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EResolution%3A%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E---------------%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3EFrom%20the%20stack%20it%20was%20understood%20that%20the%20error%20is%20thrown%20after%20Antivirus%20Check.%20Fix%20is%20to%20add%20all%20the%20AV%20exclusions%20mentioned%20in%20the%20article%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-gb%2Fhelp%2F952167%2Fcertain-folders-may-have-to-be-excluded-from-antivirus-scanning-when-y%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23000080%22%20size%3D%223%22%3ENote%3A%26nbsp%3BThis%20is%20applicable%20to%20all%20SharePoint%20On%20Premises%20Versions.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-302112%22%20slang%3D%22en-US%22%3E%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3EIssue%20Background%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E-----------------------%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%224%22%3EThere%20are%20few%20document%20libraries%20which%20are%20Information%20Rights%20Management%20(IRM)%20protected.%20While%26nbsp%3Bdownloading%20the%20files%20from%20the%20libraries%20that%20are%20IRM%20protected%2C%20users%20get%20an%20error%3A%20%22The%20document%20you%20tried%20to%20download%20could%20not%20be%20protected.%20You%20may%20need%20to%20contact%20the%20library%20administrator%20to%20help%20resolving.%20Error%20code%20is%3A%2080020009.%22%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-302112%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20On-Prem%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Support%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Issue in detail:

--------------------

Users started complaining that the files are not getting downloaded from any document libraries that are protected with Information Rights Management Service. They know that it worked before but suddenly stopped working. While downloading the documents they are getting the error:

 

"The document you tried to download could not be protected. You may need to contact the library administrator to help resolving. Error code is: 80020009."

 

SharePoint Administrators looked into the issue and found following errors in the ULS logs related to IRM:

 

SharePoint Foundation Information Rights Management 5806 Critical Information Rights Management (IRM): The email of the requesting user is empty. 


SharePoint Foundation Information Rights Management 5065 Critical Information Rights Management (IRM): There was a problem while trying to customize a base issuance license for a protected file. Current file: XXXXX GUID of current list: {XXXXXXXXXXXX} An issuance licenses stored in an IRM protected file is customized from a generic issuance license template. Additional Data Error value: 0x80070057 


SharePoint Foundation Information Rights Management 5820 Critical Information Rights Management (IRM): There was a problem while initializing IRM document. Status value: -1, error value: 0x80070057. 


SharePoint Foundation Information Rights Management 5819 Critical Information Rights Management (IRM): There was a problem while ensure IRM client. Status value: -1, error value: 0x80020009. 

 

All the errors pointed to IRM and upon checking it was confirmed that the IRM is configured correctly and the Service accounts are given the right privileges to use the service.

 

On further digging the ULS logs following error was discovered:

 

Getting Error Message for Exception System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Microsoft.SharePoint.SPException: The document you tried to download could not be protected. You may need to contact the library administrator to help resolving. Error code is: 80020009. ---> System.Runtime.InteropServices.COMException: The document you tried to download could not be protected. You may need to contact the library administrator to help resolving. Error code is: 80020009.
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps)
at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps) -
-- End of inner exception stack trace ---
at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)
at Microsoft.SharePoint.Library.SPRequest.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps)
at Microsoft.SharePoint.SPFile.GetFileStream(SPWeb web, String fileUrl, Boolean honorLevel, SPFileLevel level, OpenBinaryFlags openOptions, String etagNotMatch, SPFileStreamManager spMgr, SPFileRightsManagementSettings rightsManagementSettings, Boolean throwOnVirusFound, SPVirusCheckStatus& virusCheckStatus, String& virusCheckMessage, String& etagNew, String& contentTagNew, SPFileInfo& fileprops)
at Microsoft.SharePoint.SPFile.GetFileStream(OpenBinaryFlags openOptions, String etagNotMatch, String& etagNew, String& contentTagNew)
at Microsoft.SharePoint.ApplicationPages.Download.WriteFileInternal(String sourceUrl, SPFile file)
at Microsoft.SharePoint.ApplicationPages.Download.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 

From the above stack it was clear that its throwing exception at:

 

Microsoft.SharePoint.Library.SPRequestInternalClass.GetFileAsStream(String bstrUrl, String bstrWebRelativeUrl, Boolean bHonorLevel, Byte iLevel, OpenBinaryFlags grfob, String bstrEtagNotMatch, Object punkSPFileMgr, Boolean bHonorCustomIrm, IrmProtectionParams fileIrmSettings, UInt32& pdwVirusCheckStatus, String& pVirusCheckMessage, String& pEtagNew, String& pContentTagNew, SPFileInfo& pFileProps) 

 

Resolution:

---------------

 

From the stack it was understood that the error is thrown after Antivirus Check. Fix is to add all the AV exclusions mentioned in the article here.

 

Note: This is applicable to all SharePoint On Premises Versions.