This issue has been created
There is 1 update, 1 comment.
 
 
OpenId Connect / cid:jira-generated-image-avatar-75f2d828-fa68-40c7-8b60-5c2dcaf50ce4 OIDC-298 Open

OIDC Extension Manager action can fail due to stale classloader after dependency changes

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-df35e341-0869-498b-a552-389d9e7b5c7c Nikita Petrenko created this issue on 12/Jun/26 10:51
 
Summary: OIDC Extension Manager action can fail due to stale classloader after dependency changes
Issue Type: cid:jira-generated-image-avatar-75f2d828-fa68-40c7-8b60-5c2dcaf50ce4 Bug
Affects Versions: 2.20.3
Assignee: Unassigned
Created: 12/Jun/26 10:51
Priority: cid:jira-generated-image-static-major-9f473a1b-8c55-437e-bab3-f733debb3b5d Major
Reporter: Nikita Petrenko
Description:

Tested with local demo Jetty/HSQLDB 17.10.9. And also observed same situation on old version 16.10.17.

When upgrading, installing, uninstalling, or downgrading OpenID Connect Authenticator from an older version such as 2.20.3 (this is the version I originally used, the operation can fail because some OIDC/OAuth2 classes cannot be resolved from the current classloader.

This prevents components such as OIDCConsentStore, DefaultOAuth2TokenStore, or OIDCUserManager from being initialized properly. As a result, the extension upgrade/downgrade may fail with dependency initialization errors, for example:

Failed to get fields for class \[org.xwiki.contrib.oidc.consent.internal.store.OIDCConsentStore\] because the class \[org/xwiki/contrib/oidc/OIDCException\] couldn't be found in the ClassLoader.
Failed to get fields for class \[org.xwiki.contrib.oidc.internal.DefaultOAuth2TokenStore\] because the class \[org/xwiki/contrib/oidc/OAuth2Exception\] couldn't be found in the ClassLoader.
Extension \[org.xwiki.contrib.oidc:oidc-authenticator/2.20.3\] cannot be initialized because its dependency (\[org.xwiki.contrib.oidc:oauth2-store-2.20.3\]) could not.

A restart of XWiki usually resolves the issue, which suggests that the problem is related to stale extension classloaders or classes/components from the previous OIDC version still being cached during the extension operation.

However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9. on version 16.10.17 install or uninstall operation doesn't have it.

 
 

1 update

 
cid:jira-generated-image-avatar-df35e341-0869-498b-a552-389d9e7b5c7c Changes by Nikita Petrenko on 12/Jun/26 10:52
 
Description: Tested with local demo Jetty/HSQLDB 17.10.9. And also observed same situation on old version 16.10.17.

When upgrading
, installing, uninstalling, or downgrading {{OpenID Connect Authenticator}} from an older version such as 2.20.3 (this is the version I originally used ) , the operation can fail because some {{OIDC/OAuth2}} classes cannot be resolved from the current classloader.

This prevents components such as {{{}OIDCConsentStore{}}}, {{{}DefaultOAuth2TokenStore{}}}, or {{OIDCUserManager}} from being initialized properly. As a result, the extension upgrade/downgrade may fail with dependency initialization errors, for example:
{noformat}
Failed to get fields for class
\ [org.xwiki.contrib.oidc.consent.internal.store.OIDCConsentStore \ ] because the class \ [org/xwiki/contrib/oidc/OIDCException \ ] couldn't be found in the ClassLoader.
Failed to get fields for class
\ [org.xwiki.contrib.oidc.internal.DefaultOAuth2TokenStore \ ] because the class \ [org/xwiki/contrib/oidc/OAuth2Exception \ ] couldn't be found in the ClassLoader.
Extension
\ [org.xwiki.contrib.oidc:oidc-authenticator/2.20.3 \ ] cannot be initialized because its dependency ( \ [org.xwiki.contrib.oidc:oauth2-store-2.20.3 \ ]) could not.{noformat}
A restart of XWiki usually resolves the issue, which suggests that the problem is related to stale extension classloaders or classes/components from the previous OIDC version still being cached during the extension operation.

However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9
. , whereas on version 16.10.17 install or uninstall operation doesn't have it.
 
 

1 comment

 
cid:jira-generated-image-avatar-df35e341-0869-498b-a552-389d9e7b5c7c Nikita Petrenko on 12/Jun/26 11:00
 

However, in some cases, even restarting does not fully recover the installation state, making it impossible to install the target version. Adding note, this last situation with install I only observed randomly on 17.10.9,

Observing EM, I have only installed dependencies but not the root extension OpenID Connect Authenticator