vxcontrol/pentagi · error

%w: resource %q not found

Error message

%w: resource %q not found

What it means

Error "%w: resource %q not found" thrown in vxcontrol/pentagi.

Source

Thrown at backend/pkg/server/services/resources.go:700

	tx := s.db.Begin()
	if tx.Error != nil {
		return result, tx.Error
	}

	// ── Batch-load all source records in one query ────────────────────────────
	srcs, err := findResourcesByPaths(tx, uid, srcPaths)
	if err != nil {
		tx.Rollback()
		return result, err
	}

	// Verify every source exists.
	if len(srcs) != len(srcPaths) {
		tx.Rollback()
		found := resourcesByPath(srcs)
		for _, sp := range srcPaths {
			if _, ok := found[sp]; !ok {
				return result, fmt.Errorf("%w: resource %q not found", errResourceNotFound, sp)
			}
		}
	}

	// ── Within-batch target-basename conflict check ───────────────────────────
	// Two sources sharing a basename would both land at the same target path.
	basenameToSrc := make(map[string]string, len(srcs))
	for _, src := range srcs {
		if prev, conflict := basenameToSrc[src.Name]; conflict {
			tx.Rollback()
			return result, fmt.Errorf(
				"%w: sources %q and %q share the same base name %q",
				errResourceConflict, prev, src.Path, src.Name,
			)
		}
		basenameToSrc[src.Name] = src.Path
	}

View on GitHub (pinned to ea665308ba)

When it happens

Trigger: Thrown at backend/pkg/server/services/resources.go:700 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01). Data as JSON: /api/errors/48e8f253d8f5601b. Report an issue: GitHub.