{"record":{"id":"6b179c64b29e1edd","repo":"apache/dolphinscheduler","slug":"bucketname-bucketname-is-not-exists-you-need","errorCode":null,"errorMessage":"bucketName: ${bucketName} is not exists, you need to create them by yourself","messagePattern":"bucketName: (.+?) is not exists, you need to create them by yourself","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-storage-plugin/dolphinscheduler-storage-gcs/src/main/java/org/apache/dolphinscheduler/plugin/storage/gcs/GcsStorageOperator.java","lineNumber":258,"sourceCode":"        Blob blob = gcsStorage.get(BlobId.of(bucketName, resourceAbsolutePath));\n        return transformBlobToStorageEntity(blob);\n    }\n\n    private void checkBucketNameExists(String bucketName) {\n        if (StringUtils.isBlank(bucketName)) {\n            throw new IllegalArgumentException(StorageConstants.GOOGLE_CLOUD_STORAGE_BUCKET_NAME + \" is blank\");\n        }\n\n        boolean exist = false;\n        for (Bucket bucket : gcsStorage.list().iterateAll()) {\n            if (bucketName.equals(bucket.getName())) {\n                exist = true;\n                break;\n            }\n        }\n\n        if (!exist) {\n            throw new IllegalArgumentException(\n                    \"bucketName: \" + bucketName + \" is not exists, you need to create them by yourself\");\n        } else {\n            log.info(\"bucketName: {} has been found\", bucketName);\n        }\n    }\n\n    private StorageEntity transformBlobToStorageEntity(Blob blob) {\n        String absolutePath = transformGcsKeyToAbsolutePath(blob.getName());\n\n        ResourceMetadata resourceMetaData = getResourceMetaData(absolutePath);\n\n        StorageEntity entity = new StorageEntity();\n        entity.setFileName(new File(absolutePath).getName());\n        entity.setFullName(absolutePath);\n        entity.setDirectory(resourceMetaData.isDirectory());\n        entity.setType(resourceMetaData.getResourceType());\n        entity.setSize(blob.getSize());\n        entity.setRelativePath(resourceMetaData.getResourceRelativePath());","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-storage-plugin/dolphinscheduler-storage-gcs/src/main/java/org/apache/dolphinscheduler/plugin/storage/gcs/GcsStorageOperator.java#L240-L276","documentation":"After confirming the bucket name is non-blank, GcsStorageOperator.checkBucketNameExists lists the project's buckets and throws IllegalArgumentException if none matches the configured name. This fails fast so storage errors surface at startup instead of during resource operations.","triggerScenarios":"Initializing GcsStorageOperator when gcsStorage.list().iterateAll() contains no bucket whose name equals the configured resource.alibaba.cloud.google.storage.bucket.name — the bucket was never created or belongs to another project/credentials.","commonSituations":"Typo in the bucket name; bucket created in a different GCP project than the service account's; credentials lacking resourcemanager/projects.get / storage.buckets.list permission; bucket deleted.","solutions":["Create the bucket in the GCP project: gsutil mb gs://<bucket-name> or via Cloud Console","Correct the configured bucket name to match an existing bucket","Check the service account credentials/project and grant permission to list buckets"],"exampleFix":"// before\nresource.alibaba.cloud.google.storage.bucket.name=my-bukcet\n// after\nresource.alibaba.cloud.google.storage.bucket.name=my-bucket  # must exist in the project","handlingStrategy":"validation","validationCode":"try (Storage s = StorageOptions.getDefaultInstance().getService()) {\n    boolean found = Iterables.contains(\n        Iterables.transform(s.list().iterateAll(), Bucket::getName), bucketName);\n    if (!found) throw new IllegalStateException(\"Bucket missing: \" + bucketName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    new GcsStorageOperator(...);\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"is not exists\")) {\n        log.error(\"Create bucket first: gsutil mb gs://{}\", configuredBucket);\n    }\n}","preventionTips":["Create the bucket before configuring the operator","Confirm service account project matches the bucket's project","Grant the service account storage.buckets.list permission"],"tags":["gcs","configuration","bucket","gcp"],"backgroundTag":"resource-not-found","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}