{"record":{"id":"815fc9b35cb1f2ab","repo":"apache/dolphinscheduler","slug":"bucketname-bucketname-does-not-exists-you-shou","errorCode":null,"errorMessage":"bucketName: <bucketName> does not exists, you should create it first","messagePattern":"bucketName: <bucketName> does not exists, you should create it first","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/log/remote/CosRemoteLogHandler.java","lineNumber":106,"sourceCode":"        } catch (Exception e) {\n            log.error(\"error while sending remote log from {} to tencent cos {}, reason:\", objectName, logPath, e);\n        }\n    }\n\n    @Override\n    public void close() throws IOException {\n        if (cosClient != null) {\n            cosClient.shutdown();\n        }\n    }\n\n    private void checkBucketNameExists(String bucketName) {\n        if (StringUtils.isBlank(bucketName)) {\n            throw new IllegalArgumentException(Constants.REMOTE_LOGGING_COS_BUCKET_NAME + \" is empty\");\n        }\n        boolean existsBucket = cosClient.doesBucketExist(bucketName);\n        if (!existsBucket) {\n            throw new IllegalArgumentException(\n                    \"bucketName: \" + bucketName + \" does not exists, you should create it first\");\n        }\n\n        log.debug(\"tencent cos bucket {} has been found for remote logging\", bucketName);\n    }\n}\n","sourceCodeStart":88,"sourceCodeEnd":113,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/log/remote/CosRemoteLogHandler.java#L88-L113","documentation":"CosRemoteLogHandler.checkBucketNameExists() calls cosClient.doesBucketExist(bucketName); when the bucket is absent it throws IllegalArgumentException telling you to create the bucket yourself. DolphinScheduler does not auto-create the COS bucket used for remote logs.","triggerScenarios":"Remote logging to COS enabled with a bucket name that does not exist in the configured region/account, checked during handler initialization.","commonSituations":"Typo in bucket name; bucket exists in a different region than the COS client's endpoint/region config; bucket deleted or access denied so doesBucketExist returns false.","solutions":["Create the bucket in Tencent COS console (or via cosclient.createBucket) matching remote.logging.cos.bucket.name.","Verify remote.logging.cos.region/endpoint matches the region where the bucket actually exists — region mismatch makes doesBucketExist return false.","Check the bucket name spelling and that your SecretId/SecretKey have permission to query the bucket."],"exampleFix":"// before\nremote.logging.cos.bucket.name=nonexistent-bucket\n\n// after\n// create in the same region as remote.logging.cos.region\nremote.logging.cos.bucket.name=dolphinscheduler-logs-1250000000","handlingStrategy":"validation","validationCode":"String bucket = config.getRemoteLoggingCosBucketName();\nif (bucket != null && !cosClient.doesBucketExist(bucket)) {\n    throw new IllegalStateException(\"COS bucket \" + bucket + \" does not exist in region \" + config.getRemoteLoggingCosRegion());\n}","typeGuard":null,"tryCatchPattern":"try {\n    initCosRemoteLogHandler();\n} catch (IllegalArgumentException e) {\n    log.error(\"COS bucket check failed: {} — create the bucket or fix region/credentials\", e.getMessage());\n}","preventionTips":["Create the bucket with the same name/region configured in remote.logging.* before enabling remote logging.","Keep remote.logging.cos.region in sync with the bucket's actual region.","Grant the configured SecretId/SecretKey permission to query the bucket."],"tags":["tencent-cos","remote-logging","resource-not-found"],"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-14T00:17:10.932Z"}