This is a migrated thread and some comments may be shown as answers.

HTML5 Report Viewer -401 Error on PUT method

3 Answers 288 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brandon
Top achievements
Rank 1
Brandon asked on 01 Jul 2014, 07:22 PM
Hi there, I've just recently purchased reporting, and am trying to get it up and running on our production website. I have run into a problem with the drilldown action on my first crosstab report - the PUT is generating a 401 error, though I'm not clear on why that would be. I am using Forms authentication for the website, and everything works well on the local development server. The only other wrinkle is that the application is that there are some URL Rewrite rules in effect to properly route traffic to the site, but it appears that the PUT URL is correct.

I haven't been able to find anything on the forums indicating others with this problem - but I thought I'd ask. Has anyone else experienced this or have any ideas on what might be amiss?

Thanks!

3 Answers, 1 is accepted

Sort by
0
Brandon
Top achievements
Rank 1
answered on 01 Jul 2014, 09:00 PM
My speculation is that this is caused by the IIS handlers in our hosted environment, so I removed WebDAV using the following web.config entries:

<modules runAllManagedModulesForAllRequests="true">
  <remove name="WebDAVModule" />
</modules>
<handlers>
  <remove name="WebDAV" />
</handlers

Unfortunately, that change results in a 500 server error for the PUT.



0
Stef
Telerik team
answered on 02 Jul 2014, 04:31 PM
Hello Brandon,

Please verify the process has the rights to read/write the cache storage, which can be managed as in the Configuring Cache article. You can also use Fiddler to detect the failed requests and check in Fiddler - Inspectors - Raw the content of responses.
Test also uninstalling WebDAV entirely.

If you need further help, open a support ticket and send us the log file created by Fiddler and a runnable demo project that reproduces the problem.

Regards,
Stef
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Brandon
Top achievements
Rank 1
answered on 14 Jul 2014, 12:23 PM
I ended up having a long conversation via a support ticket to finally tease out the solution to this problem, so I'm posting it here in case anyone else runs into a similar situation. The original problem manifested itself after deploying to our hosting provider's shared virtual server - I would receive a 401 (or sometimes a 405) error whenever I tried to use an interactive feature of a report. The interactive features of the HTML5 report viewer generate PUT requests back to the server, which worked fine on my ASP.Net development server but not in the production environment.

Some googling resulted in Stack Overflow articles indicating that WebDAV might be getting in the way. Most folks recommended simply uninstalling WebDAV as the solution, but that wasn't an option for me because it's a shared hosting environment. So, the next best thing was to add these lines to the web.config:
<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" runManagedModulesForWebDavRequests="true">
    <remove name="WebDAVModule" />
  </modules>
  <httpErrors existingResponse="PassThrough" />
  <handlers>
    <remove name="WebDAV" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
    <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
    <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
    <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
  </handlers>
</system.webServer>

Originally, I only had found advice to remove the WebDAV handler mapping and module; that resulted in 500 errors being returned, but with no details whatsoever from Web API to indicate what the problem was. Eventually I got the hosting provider to give me access to the IIS logs, and that revealed that PUT requests were generating 500.21 errors, which meant a missing module. One particular Stack Overflow article made mention of that and encouraged removing/remapping other handlers as well, but since the reporting services don't use them it didn't seem promising. Finally, a commenter on that SO post mentioned the runManagedModulesForWebDavRequests option, which fixed the 500 error and allowed the reports to run.

Hope this helps someone.




Tags
General Discussions
Asked by
Brandon
Top achievements
Rank 1
Answers by
Brandon
Top achievements
Rank 1
Stef
Telerik team
Share this question
or