Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot borrow client error while updating enable_email_domain property to true #444

Open
dishelt opened this issue Jul 11, 2022 · 1 comment

Comments

@dishelt
Copy link

dishelt commented Jul 11, 2022

Description

Hi there!, hope everything goes well,

I updated the property enable_email_domain in deployment.toml for accepting usernames as emails. After that I received the next trace:

Can you please help me?. What other configuration is needed?.

I shared the output logs.

Steps to Reproduce

  • Setup enable_email_domain in deployment.toml

Affected Component

APIM

Version

APIM 4.1 as control plane

Environment Details (with versions)

No response

Relevant Log Output

`DataBridge user [email protected] connected
[2022-07-11 19:32:07,271] ERROR - DataEndpointConnectionWorker Error while trying to connect to the endpoint. Cannot borrow client for ssl://172.20.0.2:9712.
org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Cannot borrow client for ssl://172.20.0.2:9712.
        at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:145) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:59) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        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) ~[?:?]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointLoginException: Error while trying to login to data receiver :/172.20.0.2:9712
        at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:50) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:139) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        ... 6 more
Caused by: org.wso2.carbon.databridge.commons.exception.AuthenticationException: java.lang.NullPointerException
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
        at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryEventSender.processResponse(BinaryEventSender.java:163) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        at org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint.login(BinaryDataEndpoint.java:44) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]
        at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:139) ~[org.wso2.carbon.databridge.agent_5.2.41.jar:?]`

Related Issues

I dont know if there is a related issue like wso2/product-apim#12865

Suggested Labels

No response

@nadeepoornima
Copy link

Hi @dishelt,

Have you configured the email username under throttling configurations as follows?[1]

[tenant_mgt]
enable_email_domain= true

[apim.throttling]
username = "$ref{super_admin.username}@carbon.super"

[apim.throttling.policy_deploy]
username = "$ref{super_admin.username}@carbon.super"

[apim.throttling.jms]
username="admin!wso2.com!carbon.super"
password = "$ref{super_admin.password}"

Usually, Above error can happen if you have configured the email as username [1] feature in the API Manager level and without configuring the URL encoded username under the [apim.throttling.jms] block.
The "@" character is a reserved character in the WSO2 messaging component. Therefore, when specifying the username in JMS Connection URL, under apim.throttling.jms.username section in the <API-M_HOME>/repository/conf/deployment.toml file, "@" characters should be replaced by "!" character. An example is shown below.

[apim.throttling.jms] username="admin!wso2.com!carbon.super"

Please verify these configurations on your toml file. If not available, please add and see the issue fixed or not.

[1]. https://apim.docs.wso2.com/en/latest/install-and-setup/setup/security/logins-and-passwords/maintaining-logins-and-passwords/#setup-an-e-mail-login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants