{"record":{"id":"2dbff5f607bb3437","repo":"Tencent/WeKnora","slug":"bucket-q-does-not-exist-or-is-not-accessible","errorCode":null,"errorMessage":"bucket %q does not exist or is not accessible","messagePattern":"bucket %q does not exist or is not accessible","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/file/oss.go","lineNumber":131,"sourceCode":"\t\tpathPrefix:     pathPrefix,\n\t\tbucketName:     bucketName,\n\t\ttempBucketName: tempBucketName,\n\t}, nil\n}\n\n// CheckOssConnectivity tests OSS connectivity using the provided credentials.\nfunc CheckOssConnectivity(ctx context.Context, endpoint, region, accessKey, secretKey, bucketName string) error {\n\tclient, err := newOSSClient(endpoint, region, accessKey, secretKey)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\texists, err := client.IsBucketExist(ctx, bucketName)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to check OSS bucket: %w\", err)\n\t}\n\tif !exists {\n\t\treturn fmt.Errorf(\"bucket %q does not exist or is not accessible\", bucketName)\n\t}\n\treturn nil\n}\n\n// parseOssFilePath extracts bucket and object key from: oss://{bucket}/{objectKey}\nfunc parseOssFilePath(filePath string) (bucketName string, objectKey string, err error) {\n\tif !strings.HasPrefix(filePath, ossScheme) {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid OSS file path: %s\", filePath)\n\t}\n\n\trest := strings.TrimPrefix(filePath, ossScheme)\n\tparts := strings.SplitN(rest, \"/\", 2)\n\tif len(parts) != 2 || parts[0] == \"\" || parts[1] == \"\" {\n\t\treturn \"\", \"\", fmt.Errorf(\"invalid OSS file path: %s\", filePath)\n\t}\n\treturn parts[0], parts[1], nil\n}\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/file/oss.go#L113-L149","documentation":"OSS connectivity probe: IsBucketExist succeeded but reported the bucket absent, so credentials and endpoint work yet the configured bucket does not exist (or is invisible to this account); the probe fails as a configuration error.","triggerScenarios":"Thrown at internal/application/service/file/oss.go:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the bucket or correct its name in configuration","Verify the credentials belong to the account owning the bucket","Distinguish this configuration error from connectivity failures"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"988cbb03305e055d8ebb7d46d9ac6cc0803cd074","analyzedAt":"2026-09-02T14:41:08.344Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}