{"record":{"id":"48e8f253d8f5601b","repo":"vxcontrol/pentagi","slug":"w-resource-q-not-found","errorCode":null,"errorMessage":"%w: resource %q not found","messagePattern":"%w: resource %q not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"backend/pkg/server/services/resources.go","lineNumber":700,"sourceCode":"\ttx := s.db.Begin()\n\tif tx.Error != nil {\n\t\treturn result, tx.Error\n\t}\n\n\t// ── Batch-load all source records in one query ────────────────────────────\n\tsrcs, err := findResourcesByPaths(tx, uid, srcPaths)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn result, err\n\t}\n\n\t// Verify every source exists.\n\tif len(srcs) != len(srcPaths) {\n\t\ttx.Rollback()\n\t\tfound := resourcesByPath(srcs)\n\t\tfor _, sp := range srcPaths {\n\t\t\tif _, ok := found[sp]; !ok {\n\t\t\t\treturn result, fmt.Errorf(\"%w: resource %q not found\", errResourceNotFound, sp)\n\t\t\t}\n\t\t}\n\t}\n\n\t// ── Within-batch target-basename conflict check ───────────────────────────\n\t// Two sources sharing a basename would both land at the same target path.\n\tbasenameToSrc := make(map[string]string, len(srcs))\n\tfor _, src := range srcs {\n\t\tif prev, conflict := basenameToSrc[src.Name]; conflict {\n\t\t\ttx.Rollback()\n\t\t\treturn result, fmt.Errorf(\n\t\t\t\t\"%w: sources %q and %q share the same base name %q\",\n\t\t\t\terrResourceConflict, prev, src.Path, src.Name,\n\t\t\t)\n\t\t}\n\t\tbasenameToSrc[src.Name] = src.Path\n\t}\n","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/vxcontrol/pentagi/blob/ea665308baaff015b226f308438a68d929d0f29b/backend/pkg/server/services/resources.go#L682-L718","documentation":"Error \"%w: resource %q not found\" thrown in vxcontrol/pentagi.","triggerScenarios":"Thrown at backend/pkg/server/services/resources.go:700 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"}