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!

3 comments:

  1. We ran into the error and it was caused by the following:
    We have 2 domains (A & B). The user's AD account is in domain A and he had an old AD account in domain B. He connected to Terminal Server in domain B to run AX using his credentials from domain A. AX worked fine, but SSRS reports did not. He got the "401 error". When I ran Internet Explorer it prompted me for credentials. It brought up his login from domain B. At one time the user's credentials from domain B had been entered in Internet Explorer (name and password) and saved.
    To correct the problem:
    I connected to IE and selected "Use another account" when prompted for credentials. I then entered his information from domain A and it worked properly from then on. I suggest you first try clearing their IE settings. I did it but it required a reboot and we couldn't kick everyone off our Terminal Server so I went with the option to re-enter his login information.

    ReplyDelete
  2. I was facing a same problem .. In my case i changed the destination of output from file to screen and report is viewing from there i am saving it whatever format i want ... Yes have to look in why it is not able to save it as output in file..


    Dinesh P.

    ReplyDelete
  3. Hello Justin,

    I am trying to deploy some of the standard ax 2012 r3 report, i am getting http 503 service unavailable error,
    There are thousand of report, i am able to deploy but some selected report, i am trying to deploy, i am getting error of service unavailable - 503
    It is very amazing, I have number of customer, i never got this kind of error in the past.
    Please help me to come out of this issue.
    Your prompt reply very much welcome
    --
    Thanks
    Mohammad Shahnawaz

    ReplyDelete