[OPENAM-5488] Upgrade fails from OpenAM 11 to OpenAM 12 with NPE from OAuth2 client profile Created: 03/Feb/15  Updated: 20/Nov/16  Resolved: 20/Feb/15

Status: Resolved
Project: OpenAM
Component/s: oauth2, upgrade
Affects Version/s: 12.0.0
Fix Version/s: 12.0.1, 13.0.0

Type: Bug Priority: Major
Reporter: Abel Hoxeng Assignee: Charles Sparey
Resolution: Fixed Votes: 0
Labels: EDISON, release-notes
Remaining Estimate: 0h
Time Spent: 25h 1m
Original Estimate: 0h

Attachments: Text File amUpgrade.txt    
Issue Links:
is duplicated by OPENAM-5514 Upgrade failure while trying to look ... Resolved
Target Version/s:
Sprint: Sprint 77 - Sustaining
Support Ticket IDs:
Verified Version/s:


When upgrading from OpenAM 11.0.2 to OpenAM 12, a NPE occurs while looking for upgradable Oauth2 client profiles. This results in the user not being able to upgrade without removing OAuth2 client profiles.

Relevant stacktrace from the log file:

ERROR: An error occurred while trying to look for upgradable OAuth2 client profiles
	at org.forgerock.openam.upgrade.steps.UpgradeOAuth2ClientStep.addAttributeToMap(UpgradeOAuth2ClientStep.java:156)
	at org.forgerock.openam.upgrade.steps.UpgradeOAuth2ClientStep.findUpgradableConfigs(UpgradeOAuth2ClientStep.java:140)
	at org.forgerock.openam.upgrade.steps.UpgradeOAuth2ClientStep.initialize(UpgradeOAuth2ClientStep.java:85)
	at org.forgerock.openam.upgrade.UpgradeServices.<init>(UpgradeServices.java:92)
	at org.forgerock.openam.upgrade.UpgradeServices.getInstance(UpgradeServices.java:119)
	at com.sun.identity.config.upgrade.Upgrade.<init>(Upgrade.java:55)

Comment by Charles Sparey [ 20/Feb/15 ]

12.0.1 version checked in as revision 12627.
13.0.0 version merged in as revision 12628.

Comment by Charles Sparey [ 20/Feb/15 ]

The original implementation could throw an NPE under certain circumstances, if the attribute type had been previously created but the specific sub-config entry had not. The fix was to modify the the code so that in this scenario, an entry is created for the sub config prior to it being referenced.

The checkin versions are stated in the previous comment.

Comment by Filip Kubáň [X] (Inactive) [ 09/Apr/15 ]

verified fix on OpenAM 12.0.1-SNAPSHOT Build 13354

Generated at Mon Oct 19 21:40:27 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.