-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 10.2.7, 10.2.11
-
Component/s: Platform - Application Links
-
1
-
Severity 3 - Minor
Issue Summary
Jira issue macro/Jira charts throws 'Failed to find org.hibernate.Session from the current thread' error when OAuth2 refresh token expires for a user in OAuth2.0 Applink setup
Steps to Reproduce
Unable to replicate locally. This bug behaviour would show up in OAuth2.0 Applink setup when a user's OAuth2 refresh token expires.
Expected Results
OAuth2 token should get automatically regenerated and user should be able to view Jira issue macro/Jira charts.
Actual Results
User sees 'Failed to find org.hibernate.Session from the current thread' error on Jira issue macro/Jira charts.
The below exception is thrown in the atlassian-confluence.log file:
2026-05-07 10:54:44,844 ERROR [xxxxxxxxx] [oauth.auth.threelo.ThreeLeggedOAuth2RequestFactoryImpl] refreshAccessToken Failed to refresh access token -- url: /rest/highlighting/1.0/panel-items | userName: xxxxxxxx | referer: xxxxxxxxx | traceId: xxxxxxx com.atlassian.oauth2.client.api.storage.token.exception.UnrecoverableTokenException: Token already marked as invalid at com.atlassian.oauth2.client.storage.DefaultTokenHandler.refreshTokenIfNeeded(DefaultTokenHandler.java:184) at com.atlassian.oauth2.client.storage.DefaultTokenHandler.lambda$getRefreshedToken$4(DefaultTokenHandler.java:173) at com.atlassian.oauth2.common.concurrent.KeyedLocks.executeWithLock(KeyedLocks.java:37) at com.atlassian.oauth2.client.storage.DefaultTokenHandler.getRefreshedToken(DefaultTokenHandler.java:172)
Workaround
- Revoke the existing OAuth2 authorisation in Jira:
- Impacted user logs into Jira directly
- Go to Profile → Personal Settings → Authorized Applications
- Locate the entry for the Confluence application link
- Click Revoke
- Check and Delete the corresponding row from AO_723324_CLIENT_TOKEN table on Confluence DB side
- Backup the Confluence database
- Locate the oAuth2 token in the Confluence database
select * FROM "AO_723324_CLIENT_TOKEN" where "EXTERNAL_ID" = '<USERNAME>';
Sample outputACCESS_TOKEN ACCESS_TOKEN_EXPIRATION CONFIG_ID EXTERNAL_ID ID LAST_REFRESHED LAST_STATUS_UPDATED REFRESH_COUNT REFRESH_TOKEN REFRESH_TOKEN_EXPIRATION STATUS ------------- ----------------------- ------------------------------------ ----------- ------------------------------------ -------------- ------------------- ------------- ------------- ------------------------ ------- {ATL_SECURED} 1778566075743 e66fa593-24b1-4d44-b77b-d0b90c1a7434 person2 8b6cb341-e80a-4ea0-953f-43075d1582aa (null) 1778562475764 0 {ATL_SECURED} 1781154475743 UNKNOWN - Delete the relevant row, e.g.
delete from "AO_723324_CLIENT_TOKEN" where "EXTERNAL_ID" = '<USERNAME>';
- This can be done whilst Confluence is running
- Navigate to Confluence Administration » General Configuration » Cache Management
- Click Flush All
- Clear browser session — close all browser tabs for both Confluence and Jira, clear cookies/cache for both domains, or use a fresh incognito session
- Re-authenticate fresh:
- Impacted user opens a Confluence page containing a Jira Issues macro
- Click the Authenticate prompt on the macro
- Complete the full OAuth2 consent flow on Jira (clicks Allow)
- Confirm the macro renders after redirect back to Confluence
- is related to
-
CONFSERVER-103781 Cannot re-authenticate OAuth2 App Link after it is revoked in the other app
-
- Gathering Impact
-
- mentioned in
-
Page Loading...