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

I encountered this issue when using the Java backend to dock with Firebase's FCM, which has been bothering me for a long time. I saw the relevant SDK stating that refreshing tokens is automatically done by the Firebase SDK #1855

Open
Sakura-MJ opened this issue May 31, 2023 · 0 comments

Comments

@Sakura-MJ
Copy link

com.google.firebase.messaging.FirebaseMessagingException: Unknown error while making a remote service call: Unexpected error refreshing access token at com.google.firebase.messaging.FirebaseMessagingException.withMessagingErrorCode(FirebaseMessagingException.java:51) at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingErrorHandler.createException(FirebaseMessagingClientImpl.java:293) at com.google.firebase.messaging.FirebaseMessagingClientImpl$MessagingErrorHandler.createException(FirebaseMessagingClientImpl.java:282) at com.google.firebase.internal.AbstractHttpErrorHandler.handleIOException(AbstractHttpErrorHandler.java:63) at com.google.firebase.internal.ErrorHandlingHttpClient.createHttpRequest(ErrorHandlingHttpClient.java:141) at com.google.firebase.internal.ErrorHandlingHttpClient.send(ErrorHandlingHttpClient.java:92) at com.google.firebase.internal.ErrorHandlingHttpClient.sendAndParse(ErrorHandlingHttpClient.java:72) at com.google.firebase.messaging.FirebaseMessagingClientImpl.sendSingleRequest(FirebaseMessagingClientImpl.java:127) at com.google.firebase.messaging.FirebaseMessagingClientImpl.send(FirebaseMessagingClientImpl.java:113) at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:137) at com.google.firebase.messaging.FirebaseMessaging$1.execute(FirebaseMessaging.java:134) at com.google.firebase.internal.CallableOperation.call(CallableOperation.java:36) at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:104) at com.google.firebase.messaging.FirebaseMessaging.send(FirebaseMessaging.java:86) at com.yhzygs.service.user.impl.UserPushAccountServiceImpl.sendSingleMessage(UserPushAccountServiceImpl.java:114) at com.yhzygs.service.user.impl.UserPushAccountServiceImpl.pushAll(UserPushAccountServiceImpl.java:53) at com.yhzygs.job.gamejob.PushEveryDayJob.process(PushEveryDayJob.java:33) at com.alibaba.schedulerx.worker.container.ThreadContainer.start(ThreadContainer.java:91) at com.alibaba.schedulerx.worker.container.ThreadContainer.run(ThreadContainer.java:59) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.io.IOException: Unexpected error refreshing access token at com.google.auth.oauth2.OAuth2Credentials.unwrapDirectFuture(OAuth2Credentials.java:323) at com.google.auth.oauth2.OAuth2Credentials.getRequestMetadata(OAuth2Credentials.java:170) at com.google.auth.oauth2.ServiceAccountCredentials.getRequestMetadata(ServiceAccountCredentials.java:967) at com.google.auth.http.HttpCredentialsAdapter.initialize(HttpCredentialsAdapter.java:96) at com.google.firebase.internal.FirebaseRequestInitializer.initialize(FirebaseRequestInitializer.java:55) at com.google.api.client.http.HttpRequestFactory.buildRequest(HttpRequestFactory.java:91) at com.google.firebase.internal.HttpRequestInfo.newHttpRequest(HttpRequestInfo.java:105) at com.google.firebase.internal.ErrorHandlingHttpClient.createHttpRequest(ErrorHandlingHttpClient.java:137) ... 17 more Caused by: java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J at com.google.api.client.http.ConsumingInputStream.close(ConsumingInputStream.java:40) at java.io.FilterInputStream.close(FilterInputStream.java:181) at java.util.zip.InflaterInputStream.close(InflaterInputStream.java:227) at java.util.zip.GZIPInputStream.close(GZIPInputStream.java:136) at java.io.BufferedInputStream.close(BufferedInputStream.java:483) at sun.nio.cs.StreamDecoder.implClose(StreamDecoder.java:378) at sun.nio.cs.StreamDecoder.close(StreamDecoder.java:193) at java.io.InputStreamReader.close(InputStreamReader.java:199) at com.google.gson.stream.JsonReader.close(JsonReader.java:1220) at com.google.api.client.json.gson.GsonParser.close(GsonParser.java:51) at com.google.api.client.json.JsonParser.parse(JsonParser.java:363) at com.google.api.client.json.JsonParser.parse(JsonParser.java:335) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:79) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:73) at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:460) at com.google.auth.oauth2.ServiceAccountCredentials.refreshAccessToken(ServiceAccountCredentials.java:572) at com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:257) at com.google.auth.oauth2.OAuth2Credentials$1.call(OAuth2Credentials.java:254) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457) at com.google.auth.oauth2.OAuth2Credentials$AsyncRefreshResult.executeIfNew(OAuth2Credentials.java:580) at com.google.auth.oauth2.OAuth2Credentials.asyncFetch(OAuth2Credentials.java:220) ... 24 more

gcf-owl-bot bot added a commit that referenced this issue Sep 5, 2023
…ile (#1855)

chore: for Java repos RenovateBot to ignore GitHub Actions workflow file

The actions used in the GitHub Actions workflow files do not appear in libraries' dependencies and mostly maintained by Java postprocessor templates.

IgnorePath option document: https://docs.renovatebot.com/configuration-options/
Source-Link: googleapis/synthtool@1543029
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-java:latest@sha256:88ba8dcc5c2c7792e1c3511381f4ab329002a1c42c512f66ca87ced572dfbf9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant