{"record":{"id":"fcdebaf4cc3b0a4f","repo":"prestodb/presto","slug":"google-credential-refreshing-error","errorCode":null,"errorMessage":"Google credential refreshing error","messagePattern":"Google credential refreshing error","errorType":"exception","errorClass":"ClientException","httpStatus":null,"severity":"error","filePath":"presto-client/src/main/java/com/facebook/presto/client/GCSOAuthInterceptor.java","lineNumber":80,"sourceCode":"\n    private Request attachGCSAccessToken(Request request)\n    {\n        AccessToken token = getCredentials().getAccessToken();\n        return request.newBuilder()\n                .addHeader(PRESTO_EXTRA_CREDENTIAL, GCS_CREDENTIALS_OAUTH_TOKEN_KEY + \"=\" + token.getTokenValue())\n                .build();\n    }\n\n    private synchronized GoogleCredentials getCredentials()\n    {\n        if (credentials == null) {\n            credentials = createCredentials();\n        }\n        try {\n            credentials.refreshIfExpired();\n        }\n        catch (IOException e) {\n            throw new ClientException(\"Google credential refreshing error\", e);\n        }\n        return credentials;\n    }\n\n    private GoogleCredentials createCredentials()\n    {\n        try (InputStream is = newInputStream(Paths.get(credentialsFilePath))) {\n            return GoogleCredentials.fromStream(is).createScoped(gcsOAuthScopeURLs);\n        }\n        catch (IOException e) {\n            throw new ClientException(\"Google credential loading error\", e);\n        }\n    }\n\n    private Collection<String> mapScopeStringToURLs(String gcsOAuthScopesString)\n    {\n        return StreamSupport\n                .stream(SCOPE_SPLITTER.split(gcsOAuthScopesString).spliterator(), false)","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-client/src/main/java/com/facebook/presto/client/GCSOAuthInterceptor.java#L62-L98","documentation":"getCredentials calls refreshIfExpired on the GoogleCredentials used to sign GCS requests; an IOException during the OAuth token refresh (network failure or revoked/expired credential) is wrapped in this ClientException, so requests to GCS cannot be authenticated.","triggerScenarios":"Thrown at presto-client/src/main/java/com/facebook/presto/client/GCSOAuthInterceptor.java:80 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the service-account key file is valid and not revoked","Check network access and system time (clock skew breaks token refresh)","Re-create the credentials file if the refresh token expired"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}