You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/10 21:01:38 UTC

[GitHub] [pulsar-manager] tr-fteixeira opened a new issue, #481: broker authentication using Oauth2 causes "null" execption - MethodNotFound (hidden)

tr-fteixeira opened a new issue, #481:
URL: https://github.com/apache/pulsar-manager/issues/481

   When using oauth2 for the pulsar admin broker communication, this error is seen: 
   
   ```
   2022-08-01, 20:15:26.129 ERROR 17 JE[pool-2-thread-1]o.a.p.m.s.impl.ClustersServiceImpl
   : Failed to get clusters list.
   org.apache.pulsar.client.admin.PulsarAdminException$TimeoutException:java.util.concurrent.TimeoutException
       at org.apache.pulsar.client.admin.internal.ClustersImpl.getClusters(ClustersImpl.java:62)~[pulsar-client-admin-original-2.7.0.jar:2.7.0]
       at org.apache.pulsar.manager.service.impl.ClustersServiceImpl.getClustersList(ClustersServiceImpl.java:61)~[pulsar-manager.iar:na]
       at org. apache.pulsar.manager.service.impl.BrokerStatsServiceImpl.scheduleCollectStats(BrokerStatsServiceImpl.java:122)[pulsar-manager.jar:na]
       at sun.reflect. NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_312]
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)~[na:1.8.0_312]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.8.0_312]
       at java.1ang.reflect .Method.invoke(Method. java: 498) ~[na:1.8.0_3121
       at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65)[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
       at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[na:1.8.0_312]
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[na:1.8.0_312]
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[na:1.8.0_312]
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[na:1.8.0_312]
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)[na:1.8.0_312]
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)[na:1.8.0_312]Postedusing/giphy|GIFbyLooneyTunes
       at java.lang.Thread.run(Thread.java:748) [na:1.8.0_312]
   Caused by: java.util.concurrent.TimeoutException: null
       at java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1784)~[na:1.8.0_312]
       at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1928)~[na:1.8.0_312]
       at org.apache.pulsar.client.admin.internal.ClustersImpl.getClusters(ClustersImpl.java:55)~[pulsar-client-admin-original-2.7.0.jar:2.7.0]
       15 common frames omitted
   ```
   
   The relevant config is:
   ```
   backend.jwt.token=
   backend.broker.pulsarAdmin.authPlugin=org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2
   backend.broker.pulsarAdmin.authParams={"issuerUrl":"https://issuer.example.com/oauth/xxxxx","privateKey":"file:///pulsar-manager/privatekey/oauth.json","audience":"xxxxxxx"}
   ```
   Where `oauth.json` contains: 
   ```
   {"type":"client_credentials","client_id":"xxxxxx","client_secret":"xxxxxx","issuer_url":"https://issuer.example.com/oauth/xxxxx"}
   ```
   
   Even though it presents itself as a TimeoutException, debugging locally i was able to identify the error as a missing method on [this](https://github.com/apache/pulsar/blob/v2.7.0/pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/protocol/TokenClient.java#L100) call where `readValue(byte[],Class<T>)` does not exist. 
   
   Seems like there is a dependency conflict for `com.fasterxml.jackson`, where  `2.0.2.RELEASE` used by pulsar-manager forces a version downgrade to `2.9.5`, instead of the 2.11.1 required by the pulsar-client-admin library. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-manager] tr-fteixeira commented on issue #481: broker authentication using Oauth2 causes "null" execption - MethodNotFound (hidden)

Posted by GitBox <gi...@apache.org>.
tr-fteixeira commented on issue #481:
URL: https://github.com/apache/pulsar-manager/issues/481#issuecomment-1211273398

   I was able to work around the problem doing the following changes on `build.gradle` and rebuilding the image. 
   I am sure this is not the best way to solve it, but it works. 
   As this is a bit out of my ordinary alleyway, its all i can offer... hope it helps others =).
   
   ```
       compile (group: 'org.springframework.boot', name: 'spring-boot-starter', version: springBootVersion) {
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
       }
       compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion) {
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
       }
       compile (group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-zuul', version: springBootVersion) {
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
           exclude group: 'com.fasterxml.jackson.core', module: 'jackson-annotations'
       }
       compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.11.1'
       compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.1'
       compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.1'
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] broker authentication using Oauth2 causes "null" execption - MethodNotFound (hidden) [pulsar-manager]

Posted by "tr-fteixeira (via GitHub)" <gi...@apache.org>.
tr-fteixeira closed issue #481: broker authentication using Oauth2 causes "null" execption - MethodNotFound (hidden)
URL: https://github.com/apache/pulsar-manager/issues/481


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org