Product-apim: NPE prints at APIM side server log for migrated 3.1.0 Is-km setup

Created on 23 Mar 2020  ·  5Comments  ·  Source: wso2/product-apim

Description:

The apim server log has been printed the following exception when it calling the key template retriever.

Exception in thread "Timer-13" java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at java.util.Arrays$ArrayList.<init>(Arrays.java:3813)
    at java.util.Arrays.asList(Arrays.java:3800)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.loadKeyTemplatesFromWebService_aroundBody6(KeyTemplateRetriever.java:117)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.loadKeyTemplatesFromWebService(KeyTemplateRetriever.java:116)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.run_aroundBody0(KeyTemplateRetriever.java:55)
    at org.wso2.carbon.apimgt.gateway.throttling.util.KeyTemplateRetriever.run(KeyTemplateRetriever.java:51)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)

Steps to reproduce:

  • Setup APIM 3.0.0 with is-km 5.9
  • Create, Publish, Subscribe and invoke API for both tenant and super tenant users
  • Do the migration steps the for APIM 3.1.0 with is-km 5.10
  • Start the Iskm first and the APIM
  • APIM prints NPE for timer task to retrieve templates

Affected Product Version:

3.1.0

Environment details (with versions):

Mac Os

DBs:

Mysql, PostgreSQL


Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

Affecte3.1.0 Migration PrioritNormal TypBug WUM

Most helpful comment

In real deployment adding the following configuration to deployment.toml file resides in the /repository/conf folder will solve the issue

{code}
[resource_access_control]
default_access_allow= true
{code}

All 5 comments

This is reproducible in normal APIM3.1.0 - iskm5.10 setup.
It seems there is a difference between ResourceAccessControl configuration at identity.xml at Iskm and apim because iskm has been configured it as default-access="deny"
Therefore it shows authentication failure during the server startup when retrieving keytemplates

Solution:
We have to make the following config[1] to true at /modules/distribution/src/repository/resources/conf/default.json file.

_"resource_access_control.default_access_allow":true,_

[1] https://github.com/wso2/carbon-identity-framework/blob/master/features/identity-core/org.wso2.carbon.identity.core.server.feature/resources/org.wso2.carbon.identity.core.server.feature.default.json#L405

In real deployment adding the following configuration to deployment.toml file resides in the /repository/conf folder will solve the issue

{code}
[resource_access_control]
default_access_allow= true
{code}

Thanks. We will fix this issue via WUM.

@SiluniPathirana, yeah it worked for me. thanks.

Was this page helpful?
0 / 5 - 0 ratings