{"record":{"id":"c9336a59c968d8ee","repo":"apache/pulsar","slug":"cannot-read-gcs-service-account-credentials-file","errorCode":null,"errorMessage":"Cannot read GCS service account credentials file (wraps IOException for gcsManagedLedgerOffloadServiceAccountKeyFile)","messagePattern":"Cannot read GCS service account credentials file \\(wraps IOException for gcsManagedLedgerOffloadServiceAccountKeyFile\\)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java","lineNumber":126,"sourceCode":"\n        @Override\n        public BlobStore getBlobStore(TieredStorageConfiguration config) {\n            return BLOB_STORE_BUILDER.getBlobStore(config);\n        }\n\n        @Override\n        public void buildCredentials(TieredStorageConfiguration config) {\n            if (config.getCredentials() == null) {\n                try {\n                    String gcsKeyContent = Files.asCharSource(\n                            new File(config.getConfigProperty(GCS_ACCOUNT_KEY_FILE_FIELD)),\n                            Charset.defaultCharset()).read();\n                    config.setProviderCredentials(() -> new GoogleCredentialsFromJson(gcsKeyContent).get());\n                } catch (IOException ioe) {\n                    log.error().attr(\"file\",\n                            config.getConfigProperty(\"gcsManagedLedgerOffloadServiceAccountKeyFile\"))\n                            .log(\"Cannot read GCS service account credentials file\");\n                    throw new IllegalArgumentException(ioe);\n                }\n            }\n        }\n    },\n\n    AZURE_BLOB(\"azureblob\", new AzureBlobProviderMetadata()) {\n        @Override\n        public void validate(TieredStorageConfiguration config) throws IllegalArgumentException {\n            VALIDATION.validate(config);\n        }\n\n        @Override\n        public BlobStore getBlobStore(TieredStorageConfiguration config) {\n            ContextBuilder contextBuilder = ContextBuilder.newBuilder(config.getProviderMetadata());\n            ShadedJCloudsUtils.addStandardModules(contextBuilder);\n            contextBuilder.overrides(config.getOverrides());\n\n            if (config.getProviderCredentials() != null) {","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/apache/pulsar/blob/820761864ed8e2a7d2e52dd9763ad2ae117c1395/tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java#L108-L144","documentation":"GCS offload provider failed to read the service-account key file configured by gcsManagedLedgerOffloadServiceAccountKeyFile; the resulting IOException is wrapped because the credentials for the GCS blob store cannot be loaded.","triggerScenarios":"Thrown at tiered-storage/jcloud/src/main/java/org/apache/bookkeeper/mledger/offload/jcloud/provider/JCloudBlobStoreProvider.java:126 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the key file path exists and is readable","Ensure the JSON key file is a valid GCS service-account credential"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"820761864ed8e2a7d2e52dd9763ad2ae117c1395","analyzedAt":"2026-09-06T00:14:20.138Z","contentChangedAt":"2026-09-06T00:14:20.138Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}