Wednesday, February 13, 2013

AX SSRS Error: The request failed with HTTP status 401: Unauthorized.

In AX, when certain users attempt to access an SSRS report in an environment, they are getting the error 'The request failed with HTTP status 401: Unauthorized' (Figure 1 below). This was occurring for all reports for this user. Other users were able to access the report perfectly fine. The user was able to run everything perfectly the day before. The answer was Troubleshooting step 5 below: Log out of Windows instance and log back in. I'll provide the long troubleshooting steps below in case someone else's issue was different.

Figure 1 - Error message of interest

TROUBLESHOOTING STEPS:
This issue is a permissions issue somewhere. At this point, we need to determine if its an issue with the user accessing the report. You can do the below troubleshooting steps. This was the order I did it in but you don't have to do it in this order.
  1. SSRS server (server permissions)
  2. SSRS reports (SSRS permission restrictions)
  3. AX security issue (probably not but good to check)
  4. An issue with all users or just them
  5. An issue with local cache or something screwy with current windows session
Troubleshoot 1:
To help the users identify this issue, I usually ask them to do the following on the server where they are receiving this error:
  1. Click on the Start menu in Windows
  2. Type 'cmd' in the 'Search programs and files' search line in the start menu
  3. In the command prompt, type 'ping CDBRS-MAX01'
  4. Take a screenshot of the command responses and send back the results.
    1. The results should come back with the standard ping response of 'Reply from XX.XX.X.XXX: bytes=32...''.
If #4 got a weird response or an error message, the user doesn't have access to the server. Make sure they can ping the server and have them run it again.

Troubleshoot 2:
Having established they can access the report server, have the user access the report through the SSRS server. Have them do the following in the server where the AX client is erroring and if necessary, the SSRS report server itself:
  1. Go to internet explorer and access the SSRS report server (commonly 'http://[SSRSSERVERNAMEHERE]/reports'
  2. Once here, go to 'Dynamics AX' folder
  3. click on the report that is erroring
  4. Run the report and see if it runs. Just make sure required fields are populated.
If the report runs for them, SSRS security should be good. If it fails, make sure they're setup in the proper groups to run the reports and try again.

Troubleshoot 3:
Have the user run the report from a server other than the one where the user was encountering the error. I logged into the AOS on their machine under my name and did the hold shift+right click on the .axc file, enter their credentials so we were running AX as that user in my server instance, and try running the report.

Troubleshoot 4: 
Have other users attempt to run that report as well as others. Determine if its an issue with just that user. If no one is able to run the report or others, the reports may need to be deployed or the SSRS server settings need to be checked.

Troubleshoot 5:
This actually resolved the issue. Something went wrong with the user's Windows server session. I wasn't exactly sure what the issue was but having the user log out and log back in to the server resolved.

In this test, do the following:
  1. go to the person's terminal and watch them try to run the report
  2. hold shift+right click on the .axc file they were using to run the report and run as a different user. Use your own user
  3. In AX under your user in their terminal session, try to run the troubled report. 
  4. If it passes (it did in my instance), hold shift+right click on the .axc file and run as a different user, only this time use the person's credentials. For us, the user was able to run the report this way but not when just clicking on the .axc in the normal fashion
Your issue might be different but this was what it was for us so I decided to share.  Hope this helps!

No comments:

Post a Comment