When I try to start WSO2 IS I can see the below error.
TID: [-1234] [] [2022-12-05 21:31:08,401] [] ERROR {org.apache.catalina.core.ContainerBase} - A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [TenantContextRewriteValve[StandardEngine[Catalina].StandardHost[localhost]]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:926)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:263)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.wso2.carbon.tomcat.ext.service.ExtendedStandardService.startInternal(ExtendedStandardService.java:52)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:927)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.wso2.carbon.tomcat.internal.CarbonTomcat.start(CarbonTomcat.java:113)
at org.wso2.carbon.tomcat.internal.ServerManager$1.run(ServerManager.java:167)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [TenantContextRewriteValve[StandardEngine[Catalina].StandardHost[localhost]]]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:176)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:835)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1396)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1386)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:919)
... 9 more
Caused by: java.lang.NumberFormatException: For input string: "300ms"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.buildCacheConfig(IdentityConfigParser.java:278)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.buildConfiguration(IdentityConfigParser.java:177)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.<init>(IdentityConfigParser.java:74)
at org.wso2.carbon.identity.core.util.IdentityConfigParser.getInstance(IdentityConfigParser.java:81)
at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.getContextsToRewrite(TenantContextRewriteValve.java:134)
at org.wso2.carbon.identity.context.rewrite.valve.TenantContextRewriteValve.startInternal(TenantContextRewriteValve.java:61)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 20 more
The error log indicates that there is a string 300ms
is passed instead of a number. What are the steps that I can follow to solve this?
This error occurs when one of the configurations you have set up is passing 300ms
instead of 300
.
Usually, all the unit resolving configurations are at <IS_HOME>/repository/resources/conf/unit-resolve.json
file and since you have not added a configuration there you are getting the above error.
You can use the following steps to identify the place that you are having the error.
<IS_HOME>/repository/resources/conf/default.json
file and check for any configuration that has the value 300ms
.300ms
is "cache.default_timeout":"300ms"
default.json
file.cache.default_timeout
has been used at several places like cache.authentication_context_cache.timeout, cache.authentication_request_cache.timeout, ...
.j2
template.cache.authentication_context_cache.timeout, cache.authentication_request_cache.timeout, ...
are used at identity.xml.j2
file with the following config.<CacheManager name="IdentityApplicationManagementCacheManager">
<Cache id="framework_session_context_cache" name="AppAuthFrameworkSessionContextCache"
enable="{{cache.framework_session_context_cache.enable}}"
timeout="{{cache.framework_session_context_cache.timeout}}"
capacity="{{cache.framework_session_context_cache.capacity}}"
isDistributed="false"/>
....
</CacheManager>
300ms
, go to the file which reflects the template configurations in <IS_HOME>/repository/conf
directory.<IS_HOME>/repository/conf/identity/identity.xml
file. (because identity.xml.j2
is the template for identity.xml
file)300ms
in that file and you will notice a configuration similar to the following.<Cache id="authentication_error_cache" name="AuthenticationErrorCache"
enable="true"
timeout="300ms"
capacity="5000"
isDistributed="false"/>
To solve the above error, you can take two approaches,
deployment.toml
fileAlthough this is not the approach that you should use, if you put the below configuration after identifying the correct XML tag which is causing the error, the issue will be solved.
For the step 9's case we can see that we should configure the timeout of authentication_error_cache
.
To do that, you can put the following configuration in deployment.toml
and restart the IS.
[cache.authentication_error_cache]
timeout=300
unit-resolve.json
fileThe reason for above error is because the authentication_error_cache
unit resolve config is missing from the unit-resolve.json
file.
You can simply add the unit responsible for the issue to the unit-resolve.json
file and the issue will be solved.
For the above case, you can add the following to the unit-resolve.json
file.
"cache.authentication_error_cache.timeout": "ms",