Skip to main content

Error while getting access token for mosaic web api

In this article, we explain why document uploads to Wisdom may fail due to Mosaic API token errors and missing attachments.

Y
Written by Yusef Abulaynain
Updated over 4 months ago

For hosted customers please raise a new case online and reference the title of this article.
​

Problem

This error occurs when the OAuth token store is set to JDBC. You can confirm this by running the following SQL against the Mosaic database, see below.

select * from system_properties where name='oauth2TokenstoreType'

For a single instance deployment of Mosaic, the token store is not required and the 'In Memory' one is used instead which is not affected by this bug.
​
This is a race condition issue with Spring Security OAuth 2 JDBC token store, and it is described here:

Resolution

If Mosaic is deployed more than once and uses a load balancer then you will need to complete steps 1 and 2. If only a single instance of Mosaic is deployed, then you can skip steps 1 and 2.

  1. Configure each MIS instance to point to one instance of Mosaic (e.g., MIS on server 1 to point to Mosaic on server 1, MIS on server 2 to point to Mosaic on server 2), thereby skipping the load balancer. To do this, the mis.properties file needs to be amended on each MIS server and the value for mosaic.url and mosaic.api.url updated.

  2. Make any channel in Conexes that uses Mosaic Web API call one single Mosaic instance instead of the load balancer.

  3. Set the value for oauth2TokenstoreType system property (system_properties table) to IN_MEMORY by running the SQL below on the Mosaic database.

    update system_properties set value='IN_MEMORY' where name='oauth2TokenstoreType'
  4. Restart the Mosaic and MIS servers.

Did this answer your question?