vxcontrol/pentagi · error

%w: resource already exists at %q

Error message

%w: resource already exists at %q

What it means

Error "%w: resource already exists at %q" thrown in vxcontrol/pentagi.

Source

Thrown at backend/pkg/server/services/flow_files.go:1919

				virtPath = src.destPath
			}

			// Within-batch collision check: two sources mapping to the same
			// virtual destination path is always an error.
			if seenVPaths[virtPath] {
				return fmt.Errorf("%w: two sources both target %q", errResourceConflict, virtPath)
			}
			seenVPaths[virtPath] = true

			// Phase 1 conflict pre-check: avoid IO when the destination
			// obviously conflicts. Phase 3 re-checks inside the TX.
			if !force {
				_, exists, dbErr := findResourceByPath(s.db, uid, virtPath)
				if dbErr != nil {
					return fmt.Errorf("checking %s: %w", virtPath, dbErr)
				}
				if exists {
					return fmt.Errorf("%w: resource already exists at %q", errResourceConflict, virtPath)
				}
			}

			f, openErr := os.Open(filePath)
			if openErr != nil {
				return fmt.Errorf("open %s: %w", filePath, openErr)
			}
			tmpPath, hash, size, saveErr := resources.SaveToTemp(f, blobsDir)
			f.Close()
			if saveErr != nil {
				return fmt.Errorf("save temp for %s: %w", filePath, saveErr)
			}
			pending = append(pending, pendingResourceUpload{
				name:    path.Base(virtPath),
				vPath:   virtPath,
				tmpPath: tmpPath,
				hash:    hash,
				size:    size,

View on GitHub (pinned to ea665308ba)

When it happens

Trigger: Thrown at backend/pkg/server/services/flow_files.go:1919 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/0eefe825d7b5880a. Report an issue: GitHub.