Skip to main content

Data not sending to OSC RightNow after new clone

In this article, we explain why SSAFA RightNow integration to TRBL fails in mosmig after cloning, including 401 Unauthorized errors..

Y
Written by Yusef Abulaynain
Updated over 4 months ago

Error:

'ERROR
uk.co.corelogic.mosaic.interfaces.ssafa.rightnow.service.RightNowRestServiceI
pl - Failed to upload attachment
org.springframework.web.client.HttpClientErrorException$Unauthorized: 401
Unauthorized'

If you've cloned a test or dev database (e.g. MOSMIG) from live MOSPROD, you'll need to update the RightNow API details to point to the test instance of RightNow.

The configuration details are updated in Mosaic.

  1. Go to Tools, Configuration Tools, Interfaces, External system configuration.

  2. Expand and edit the RIGHTNOW entry.

  3. Set the username to api.mosaic. This shouldn't need changing as it is the same username as live.

  4. Set the password. The password should be known to SSAFA or they can request it from TRBL/Connect Assist.

📌 Note. We will save a copy of the password in Secret Server or Keepass but it could have changed since it was recorded.

The changes will not come into effect until Mosaic is restarted. Mosaic will restart automatically overnight, or a manual restart can be requested.

If there is still a problem with Mosaic feeding data to Rightnow or The Royal British Legion (TRBL) e.g. failing to upload documents, then check the framework.log for errors.

Any requests and responses from Rightnow can be queried in the table

MO_AUDIT_OUT_WEB_API_REQUESTS. See SQL below.

SELECT TOP 50 * FROM MO_AUDIT_OUT_WEB_API_REQUESTS
where REQUEST_TO_HOST_NAME='trbl--tst.custhelp.com'
order by request_datetime desc

Successful Rightnow requests will have a RESPONSE_STATUS of 201. A RESPONSE_STATUS of 401 would indicate a problem with the API account api.mosaic. This is likely to be either an incorrect password or the account is locked.

The full response will be in the column RESPONSE_BODY, see example below.

{"type":"https://trbl--tst.custhelp.com/services/rest/connect/exceptions/OSC-CREST-00014","title":"You are not authorised to use this site","status":401,"detail":"You are not authorized to use this site","instance":"https://trbl--tst.custhelp.com/services/rest/connect/v1.4/incidents/1120301/threads","o:errorCode":"OSC-CREST-00014"}

The error should also be present in the framework logs too, see example below.

ERROR uk.co.corelogic.mosaic.interfaces.ssafa.rightnow.service.RightNowRestServiceImpl - Failed to upload attachment
org.springframework.web.client.HttpClientErrorException$Unauthorized: 401 Unauthorized
Did this answer your question?