wso2 / product-apim

Welcome to the WSO2 API Manager source code! For info on working with the WSO2 API Manager repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
841 stars 784 forks source link

Regarding enable_secure_vault=true config in deployment.toml #7825

Closed msm1992 closed 2 years ago

msm1992 commented 4 years ago

Description:

In "Encrypting secured endpoint passwords" we have to add following config to deployment.toml

[apim] enable_secure_vault=true

Since there is already an array of tables defined as apim in deployment.toml, it throws a toml error on server start up.

JAVA_HOME environment variable is set to /usr/lib/jvm/jdk1.8.0_212
CARBON_HOME environment variable is set to /home/*****/Documents/APIM/Development_Builds/OAuth/25-3-2020/wso2am-3.1.0-SNAPSHOT
Using Java memory options: -Xms256m -Xmx1024m
[2020-03-25 11:56:37,191]  WARN {org.wso2.config.mapper.ConfigParser} - Configurations Changed in :repository/conf/deployment.toml
[2020-03-25 11:56:37,195]  WARN {org.wso2.config.mapper.ConfigParser} - Overriding files in configuration directory /home/sanjula/Documents/APIM/Development_Builds/OAuth/25-3-2020/wso2am-3.1.0-SNAPSHOT
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wso2.carbon.bootstrap.Bootstrap.loadClass(Bootstrap.java:70)
    at org.wso2.carbon.bootstrap.Bootstrap.main(Bootstrap.java:51)
Caused by: java.lang.StackOverflowError
    at java.util.HashMap$EntrySpliterator.<init>(HashMap.java:1669)
    at java.util.HashMap$EntrySet.spliterator(HashMap.java:1034)
    at java.util.Collection.stream(Collection.java:581)
    at net.consensys.cava.toml.MutableTomlTable.keyPathSet(MutableTomlTable.java:71)
    at net.consensys.cava.toml.MutableTomlTable.lambda$keyPathSet$1(MutableTomlTable.java:80)
    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
    at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at net.consensys.cava.toml.MutableTomlTable.keyPathSet(MutableTomlTable.java:92)
    at net.consensys.cava.toml.MutableTomlTable.lambda$keyPathSet$1(MutableTomlTable.java:80)
    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
    at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)

I could solve this by adding the config before any [[apim.*]] configs. Should we add a note on this to doc or are we going to revisit the config key ? @ruks please advice.

Steps to reproduce:

Add following config at the end of deployment.toml file and start the server.

Affected Product Version:

APIM 3.1.0

tharindu1st commented 4 years ago

Hi @msm1992 , We need to fix this in api-manager.xml.j2 to have in a subsection.

rmsamitha commented 4 years ago

Hi @msm1992 , this error is occurred in IS-KM-5.10.0 too, when we have added the required IS-KM configuration elements in the deployment.toml. i.e.

[[apim.gateway.environment]] [[apim.throttling.url_group]]

Once added these to the bottom of the the file, issue is fixed. So this should be fixed is-km too

ruks commented 2 years ago

Close since a solution is provided.