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
GCP PubSub Authorisation Issue In Java Using Service Account #2769
Comments
You can enable logging for the auth library to see if it provides any additional clues as to what is happening -- see the logging section of the Google java client library TROUBLESHOOTING.md for an example of how to do that. |
Thanks @burkedavison, I have a bearer token with me, can i decode this by any chance ?
Publish Request
I tried this
|
@westarle Can you please help with the question about decoding Bearer tokens? |
@shubhwip Does the token look like |
Describe the bug
I am facing below issue while publishing messages to various topics from one java service.
exception is com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action.\ncom.google.cloud.spring.pubsub.core.PubSubDeliveryException: Publishing to projects/testing-development/topics/testing-bacd-testing-1 topic failed.; nested exception is com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action.\n\tat com.google.cloud.spring.pubsub.core.publisher.PubSubPublisherTemplate$1.onFailure(PubSubPublisherTemplate.java:111)\n\tat com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)\n\tat com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1074)\n\tat com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1213)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)\n\tat com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)\n\tat com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)\n\tat com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)\n\tat com.google.api.core.SettableApiFuture.setException(SettableApiFuture.java:52)\n\tat com.google.cloud.pubsub.v1.Publisher$OutstandingBatch.onFailure(Publisher.java:545)\n\tat com.google.cloud.pubsub.v1.Publisher$OutstandingBatch.access$1600(Publisher.java:512)\n\tat com.google.cloud.pubsub.v1.Publisher$3.onFailure(Publisher.java:488)\n\tat com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)\n\tat com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1074)\n\tat com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1213)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)\n\tat com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)\n\tat com.google.api.gax.retrying.BasicRetryingFuture.handleAttempt(BasicRetryingFuture.java:200)\n\tat com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.handle(CallbackChainRetryingFuture.java:135)\n\tat com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.run(CallbackChainRetryingFuture.java:117)\n\tat com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1213)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)\n\tat com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)\n\tat com.google.api.core.AbstractApiFuture$InternalSettableFuture.setException(AbstractApiFuture.java:95)\n\tat com.google.api.core.AbstractApiFuture.setException(AbstractApiFuture.java:77)\n\tat com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)\n\tat com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)\n\tat com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1074)\n\tat com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)\n\tat com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1213)\n\tat com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:983)\n\tat com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:771)\n\tat io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:563)\n\tat io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:533)\n\tat io.grpc.internal.DelayedClientCall$DelayedListener$3.run(DelayedClientCall.java:463)\n\tat io.grpc.internal.DelayedClientCall$DelayedListener.delayOrExecute(DelayedClientCall.java:427)\n\tat io.grpc.internal.DelayedClientCall$DelayedListener.onClose(DelayedClientCall.java:460)\n\tat io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:553)\n\tat io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:68)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:739)\n\tat io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:718)\n\tat io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)\n\tat io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\nCaused by: com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action.\n\tat com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:55)\n\tat com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)\n\tat com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)\n\t... 24 common frames omitted\nCaused by: io.grpc.StatusRuntimeException: PERMISSION_DENIED: User not authorized to perform this action.\n\tat io.grpc.Status.asRuntimeException(Status.java:535)\n\t... 16 common frames omitted\n","context":"default"}
My Setup
We are trying to publish to many topics from one java service. We have created
topics1 => using a wrapper library over spring-cloud-gcp-pubsub and using it to publish to some of the topics
topics2 => using spring-cloud-gcp-pubsub directly to publish to other topics and this is behind a conditional property.
We are seeing above error for all the topics in topics1 when conditional property for topics2 is enabled.
### Attempts
I would like to find out what is this user who is not authorised. Is there some access_token invalidation happening ?
Thanks in advance.
The text was updated successfully, but these errors were encountered: