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
838 stars 781 forks source link

Error in JMS connectivity when secure vault enabled. #12718

Closed shilmyhasan closed 2 years ago

shilmyhasan commented 2 years ago

Description:

There is an issue in JMS connectivity when secure vault enabled, which blocks all the main functionalities which rely on JMS.

[2022-03-21 15:53:32,190] ERROR - OutputAdapterRuntime Event dropped at Output Adapter 'cacheInvalidationJMSPublisher' for tenant id '-1234', begin 73, end 35, length 102 java.lang.StringIndexOutOfBoundsException: begin 73, end 35, length 102 at java.lang.String.checkBoundsBeginEnd(String.java:3319) ~[?:?] at java.lang.String.substring(String.java:1874) ~[?:?] at org.wso2.andes.jndi.Utils.resolveSystemProperty(Utils.java:71) ~[andes_3.3.22.jar:?] at org.wso2.andes.jndi.PropertiesFileInitialContextFactory.getInitialContext(PropertiesFileInitialContextFactory.java:128) ~[andes_3.3.22.jar:?] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ~[?:?] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ~[?:?] at javax.naming.InitialContext.init(InitialContext.java:236) ~[?:?] at javax.naming.InitialContext.(InitialContext.java:208) ~[?:?] at org.wso2.carbon.event.output.adapter.jms.internal.util.JMSConnectionFactory.(JMSConnectionFactory.java:84) ~[org.wso2.carbon.event.output.adapter.jms_5.2.41.jar:?] at org.wso2.carbon.event.output.adapter.jms.JMSEventAdapter.initPublisher(JMSEventAdapter.java:202) ~[org.wso2.carbon.event.output.adapter.jms_5.2.41.jar:?] at org.wso2.carbon.event.output.adapter.jms.JMSEventAdapter.connect(JMSEventAdapter.java:135) ~[org.wso2.carbon.event.output.adapter.jms_5.2.41.jar:?] at org.wso2.carbon.event.output.adapter.core.internal.OutputAdapterRuntime.publish(OutputAdapterRuntime.java:68) ~[?:?] at org.wso2.carbon.event.output.adapter.core.internal.CarbonOutputEventAdapterService.publish(CarbonOutputEventAdapterService.java:148) ~[?:?] at org.wso2.carbon.event.publisher.core.internal.EventPublisher.process(EventPublisher.java:428) ~[?:?] at org.wso2.carbon.event.publisher.core.internal.EventPublisher.sendEvent(EventPublisher.java:230) ~[?:?] at org.wso2.carbon.event.publisher.core.internal.EventPublisher.onEvent(EventPublisher.java:300) ~[?:?] at org.wso2.carbon.event.stream.core.internal.EventJunction.sendEvent(EventJunction.java:157) ~[?:?] at org.wso2.carbon.event.receiver.core.internal.management.InputEventDispatcher.onEvent(InputEventDispatcher.java:27) ~[?:?] at org.wso2.carbon.event.receiver.core.internal.EventReceiver.sendEvent(EventReceiver.java:294) ~[?:?] at org.wso2.carbon.event.receiver.core.internal.EventReceiver.processTypedEvent(EventReceiver.java:257) ~[?:?] at org.wso2.carbon.event.receiver.core.internal.EventReceiver$TypedEventSubscription.onEvent(EventReceiver.java:358) ~[?:?] at org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime.onEvent(InputAdapterRuntime.java:110) ~[?:?] at org.wso2.carbon.event.input.adapter.wso2event.internal.ds.WSO2EventAdapterServiceDS$1.receive(WSO2EventAdapterServiceDS.java:100) ~[?:?] at org.wso2.carbon.databridge.core.internal.queue.QueueWorker.run(QueueWorker.java:81) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]

Steps to reproduce:

Enable Secure Vault with below config

[secrets] admin_password = "[admin]"

[super_admin] username = "admin" password = "$secret{admin_password}" create_admin_account = true

Affected Product Version:

4.1.0

Environment details (with versions):


Optional Fields

Related Issues:

Suggested Labels:

Suggested Assignees:

chamilaadhi commented 2 years ago

As a workaround add following to the deployment.toml file

[apim.event_hub]
event_listening_endpoints = "tcp://localhost:5672"

This issue is coming from the fix done to andes from https://github.com/wso2/andes/pull/1041