Clustered Confluence Remote API Session Expires After 30 Minutes

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

This article applies to Confluence clustered 5.4 or earlier.

Symptoms

When using remote API scripts against a Confluence cluster, the session is expired after 30 minutes.

The following appears in the atlassian-confluence.log:

1 Remote error: com.atlassian.confluence.rpc.InvalidSessionException: User not authenticated or session expired. Call login() to open a new session

Cause

There is a token cache that is set to expire in 30 minutes by default.

Resolution

  • Locate and open the following file in a text editor: <confluence_home>/config/confluence-coherence-cache-config-clustered.xml

  • Find the following section:

    1 2 3 4 5 6 7 8 9 10 11 <replicated-scheme> <scheme-name>cache:com.atlassian.confluence.rpc.auth.TokenAuthenticationManager.tokens</scheme-name> <scheme-ref>default</scheme-ref> <backing-map-scheme> <local-scheme> <scheme-ref>local:default</scheme-ref> <high-units>5000</high-units> <expiry-delay>1800s</expiry-delay> </local-scheme> </backing-map-scheme> </replicated-scheme>
  • Edit the expiry-delay value as appropriate. Default is 1800 seconds (30 minutes).

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.