{"record":{"id":"85d25862c357b37f","repo":"Tencent/WeKnora","slug":"invalid-obs-file-path-s","errorCode":null,"errorMessage":"invalid OBS file path: %s","messagePattern":"invalid OBS file path: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/application/service/file/obs.go","lineNumber":131,"sourceCode":"\t})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"OBS connectivity check failed: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (s *obsFileService) parseObsFilePath(filePath string) (string, error) {\n\tprefix := s.getPrifix()\n\n\tif strings.HasPrefix(filePath, prefix) {\n\t\trest := strings.TrimPrefix(filePath, prefix)\n\t\t// With proxy domain: path is {prefix}/{objectKey} (no bucket name)\n\t\tif s.proxyDomain != \"\" {\n\t\t\trest = strings.TrimPrefix(rest, \"/\")\n\t\t\tif rest != \"\" {\n\t\t\t\treturn rest, nil\n\t\t\t}\n\t\t\treturn \"\", fmt.Errorf(\"invalid OBS file path: %s\", filePath)\n\t\t}\n\t\t// Without proxy domain: path is {prefix}/{bucketName}/{objectKey}\n\t\tparts := strings.SplitN(rest, \"/\", 2)\n\t\tif len(parts) == 2 && parts[0] == s.bucketName && parts[1] != \"\" {\n\t\t\treturn parts[1], nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"invalid OBS file path: %s\", filePath)\n\t}\n\treturn filePath, nil\n}\n\nfunc (s *obsFileService) getPrifix() string {\n\tif s.proxyDomain != \"\" {\n\t\treturn s.proxyDomain + \"/\"\n\t}\n\treturn \"obs://\"\n}\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Tencent/WeKnora/blob/988cbb03305e055d8ebb7d46d9ac6cc0803cd074/internal/application/service/file/obs.go#L113-L149","documentation":"OBS path parser guard: the path matched the service prefix but no object key could be extracted — under a proxy domain the remainder was empty, or without one the bucket/key segments were missing/blank — so the path is malformed and rejected before any storage call.","triggerScenarios":"Thrown at internal/application/service/file/obs.go:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use paths exactly as returned by the OBS SaveFile/SaveBytes helpers","Verify proxy-domain configuration matches the path format","Validate path shape at ingestion"],"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"}