{"record":{"id":"907aa11c2fe7979b","repo":"vxcontrol/pentagi","slug":"resources-alreadyexists","errorCode":"Resources.AlreadyExists","errorMessage":"resource %q is duplicated in upload request","messagePattern":"resource %q is duplicated in upload request","errorType":"http","errorClass":null,"httpStatus":409,"severity":"error","filePath":"backend/pkg/server/services/resources.go","lineNumber":321,"sourceCode":"\t\tif fh.Size < 0 {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrResourcesInvalidRequest,\n\t\t\t\tfmt.Errorf(\"file %q has invalid size %d\", name, fh.Size))\n\t\t\treturn\n\t\t}\n\t\ttotalSize += fh.Size\n\t\tif totalSize > resources.MaxUploadTotalSize {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrResourcesInvalidRequest,\n\t\t\t\tfmt.Errorf(\"total upload size exceeds the limit of %d bytes\", resources.MaxUploadTotalSize))\n\t\t\treturn\n\t\t}\n\n\t\tvPath := resources.FilePath(dirPath, name)\n\t\tif _, ok := seenPaths[vPath]; ok {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrResourcesAlreadyExists,\n\t\t\t\tfmt.Errorf(\"resource %q is duplicated in upload request\", vPath))\n\t\t\treturn\n\t\t}\n\t\tseenPaths[vPath] = struct{}{}\n\n\t\texists, err := s.resourceExists(uid, vPath)\n\t\tif err != nil {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tlogger.FromContext(c).WithError(err).Error(\"error checking resource existence\")\n\t\t\tresponse.Error(c, response.ErrInternal, err)\n\t\t\treturn\n\t\t}\n\t\tif exists {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrResourcesAlreadyExists,\n\t\t\t\tfmt.Errorf(\"resource %q already exists\", vPath))\n\t\t\treturn\n\t\t}\n","sourceCodeStart":303,"sourceCodeEnd":339,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/resources.go#L303-L339","documentation":"Error \"resource %q is duplicated in upload request\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/server/services/resources.go:321 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ea665308baaff015b226f308438a68d929d0f29b","analyzedAt":"2026-09-01T14:16:31.421Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}