Sometimes can't download Attachments in CA Mobile App, if URL password contains "+"

Document ID : KB000101624
Last Modified Date : 05/07/2018
Show Technical Document Details
Question:
Why do Attachments sometimes fail to download from the CA Mobile App, with an "HTTP Status 500" error?

But if you retry one or more times, it does work?

Go to MyTask, Workitem, Detail, and access the Attachments link.

Checking the access logfile, we find that a non-working URL has a plus symbol "+" character in the link.
But a working attempt does not have a "+." (Highlighted in red below.)

http://MY_SERVER:8050/workflow/getatt?attid=402605&userid=.....&password=cxFNAL0+RxZIFh0q1bzxXiA+GPN2jFf6ys.....

If you open it with a PC browser, the same error occurs.

In the case of an Apple phone user, it instead does not give an error, but is always loading after trying to access the Attachment.
Environment:
CA Service Management 3.1.13, Service Desk Manager 17.0 and 17.1
Answer:

ISSUE
This is a suspected issue, that is being reviewed in Defect DE41953.

When the outcome is known, this knowledge document will be updated with the solution.

ROOT CAUSE
The root cause is that randomly a "+" symbol is generated into the Attachment URL link, which is not being correctly handled by the Mobile App.

WORKAROUND
The workaround for now it so try the Attachment until a URL without a "+" is generated, at which point you should be able to access the Attachment.
Or to use the full CA SDM web client to access the Attachment.
Once the defect is reviewed, a formal solution may become available.

DEFECT INVESTIGATION - DE41953

The Mobile App has My Tasks, related tickets tab (Incident/Request/CO) tab and at the bottom we have an Attachments link to download Attachments related to that ticket. 

Tapping on that allows you to download the attachment. This forces the App to launch a browser with a URL like this: http://SDMHostName8050/workflow/getatt?attid=401784&userid=12345&password=sL6XosNYMiHX1tehyWtTt4Sykzq7ol2A1SP and it downloads the attachment.

The password is encrypted and dynamically/randomly generated by the app for that user session.

Problem: If the mentioned password gets generated by the app and it has a + sign in it, then the attachment download fails with an error: HTTP Status 500 - org.apache.cxf.interceptor.Fault

Steps to reproduce:
1) Ensure you have a user in SDM who has workflow tasks associated to a ticket and that ticket has an attachment
2) Login as that user to Service Management mobile app
3) Identify the ticket in the app and try to download attachments associated with the ticket. It works fine
4) Go back to Home screen and tap on My Tasks, identify the workflow task associated to the ticket in #1
5) Tap on the ticket icon (on top) associated to the Workflow task
6) Far below on the ticket detail screen, there's an attachment icon, tap on it
7) app opens a new browser window and tries to access the SDM mobile APP URL with something like below:
http://SDMHostName8050/workflow/getatt?attid=401784&userid=12345&password=sL6XosNYMiHX1tehyWtTt4Sykzq7ol2A1SP

8) If the password string here does not contain a + character, it works fine, attachment is downloaded
9) If the password string here does contain a + character, attachment is not downloaded as the browser errors with
HTTP Status 500 - org.apache.cxf.interceptor.Fault

java.lang.RuntimeException: org.apache.cxf.interceptor.Fault
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:336)
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

To be able to have the app randomize the password string with a "+" in it, you may need to try logging out of the app and logging in again.
You'll have to try this a few times to see the issue, as we can't control how the Mobile App. generates the + string in the password string above


HYPOTHESIS
The issue might not be with the user's real password itself, but the random encrypted password that we create to get the Attachment.
If that encrypted string contains the + character, then the problem arises.

EXAMPLE

SDM URL: http://MY_SERVER/CAisd/pdmweb3.exe
Mobile App URL: http://MY_SERVER:8050

Log into the Mobile App, there is one Task. 
From the Request Details (ticket: 4220 ) associated with that Task, there is one Attachment "capture.jpg."

Attempt 1: Tried to download it. It created a new browser session with a string like this:

http://MY_SERVER:8050/workflow/getatt?attid=401784&userid=01114142&password=sL6XosNYMiHX1tehyWtTt4Sykzq7ol2A1SPAqPipN8qnbOUEwYK9661m/tfyLHjA

It worked. NO errors

Attempt 2: Logged out of the app, and logged in again. Same credentials as previously, repeated the steps. 
This time the URL had a "+" in it. And because of the same it does not work:

http://MY_SERVER:8050/workflow/getatt?attid=401784&userid=01114142&password=/ez3WgwITZ425TIXuvWe+Zb+WmzfTrtE/BEs0v7MQrcScZdVadXpsxnpJslyYKtV

HTTP Status 500 - org.apache.cxf.interceptor.Fault

java.lang.RuntimeException: org.apache.cxf.interceptor.Fault
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:336)
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:241)
org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)
org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)