{"record":{"id":"5c0ef864aee2c8c9","repo":"vxcontrol/pentagi","slug":"failed-to-open-uploaded-file-w-5c0ef8","errorCode":null,"errorMessage":"failed to open uploaded file: %w","messagePattern":"failed to open uploaded file: %w","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"backend/pkg/server/services/resources.go","lineNumber":343,"sourceCode":"\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\n\t\tsrc, openErr := fh.Open()\n\t\tif openErr != nil {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrInternal, fmt.Errorf(\"failed to open uploaded file: %w\", openErr))\n\t\t\treturn\n\t\t}\n\t\ttmpPath, hash, size, saveErr := resources.SaveToTemp(src, blobsDir)\n\t\tsrc.Close()\n\t\tif saveErr != nil {\n\t\t\tcleanupResourceUploads(pendingList)\n\t\t\tresponse.Error(c, response.ErrInternal, saveErr)\n\t\t\treturn\n\t\t}\n\n\t\tpendingList = append(pendingList, pendingResourceUpload{\n\t\t\tname:    name,\n\t\t\tvPath:   vPath,\n\t\t\ttmpPath: tmpPath,\n\t\t\thash:    hash,\n\t\t\tsize:    size,\n\t\t})\n\t}","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/resources.go#L325-L361","documentation":"Error \"failed to open uploaded file: %w\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/server/services/resources.go:343 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"}