gastownhall/beads · error

bulk dependency validation failed: %s

Error message

bulk dependency validation failed:
  %s

What it means

Aggregated validation error returned by bulkDepValidationError when one or more edges in a bulk dependency file fail validation. Each individual problem is joined with newlines after the header, so the full message lists every bad line. It guards `bd dep add --file` from partially applying an invalid batch.

Source

Thrown at cmd/bd/dep.go:747

			continue
		}

		resolved = append(resolved, current)
	}

	if len(errs) > 0 {
		for _, edge := range resolved {
			for _, cleanup := range edge.Cleanups {
				cleanup()
			}
		}
		return nil, bulkDepValidationError(errs)
	}
	return resolved, nil
}

func bulkDepValidationError(errs []string) error {
	return fmt.Errorf("bulk dependency validation failed:\n  %s", strings.Join(errs, "\n  "))
}

func dependencyStoreKey(s storage.DoltStorage) string {
	if locator, ok := storage.UnwrapStore(s).(storage.StoreLocator); ok {
		if cliDir := strings.TrimSpace(locator.CLIDir()); cliDir != "" {
			return "cli:" + filepath.Clean(cliDir)
		}
		if path := strings.TrimSpace(locator.Path()); path != "" {
			return "path:" + filepath.Clean(path)
		}
	}
	return fmt.Sprintf("instance:%p", s)
}

// depListAnchor is one resolved `bd dep list` argument: the canonical id, the
// store that actually holds it, and the routing handle that has to be closed.
type depListAnchor struct {
	fullID string

View on GitHub (pinned to 71377f2769)

Solutions

  1. Read each indented line in the error — it names the offending edge and reason.
  2. Fix the listed lines in the dependency file (correct issue IDs, use valid types: blocks, related, parent-child, discovered-from, etc.).
  3. Run `bd show <id>` for each referenced issue to confirm the IDs exist in this repo's database.
  4. Re-run the bulk add after corrections; the batch is all-or-nothing so no partial state needs cleanup.

Example fix

// before (deps.txt)
bd-1 blocks bd-99999   # bd-99999 does not exist
bd-2 bloks bd-3        # typo in type

// after (deps.txt)
bd-1 blocks bd-2
bd-2 related bd-3
Defensive patterns

Strategy: validation

Validate before calling

// lint deps.txt before applying: id<TAB|space>type<TAB|space>id
while read -r from t to; do
  case "$t" in blocks|related|parent-child|discovered-from) ;; *) echo "bad type: $t" >&2; exit 1;; esac
  bd show "$from" >/dev/null || { echo "unknown issue $from" >&2; exit 1; }
  bd show "$to" >/dev/null || { echo "unknown issue $to" >&2; exit 1; }
done < deps.txt

Try / catch

if err := addBulkDeps(file); err != nil {
	var verr *bulkValidation
	if errors.As(err, &verr) {
		for _, line := range strings.Split(verr.msg, "\n")[1:] {
			fmt.Fprintln(os.Stderr, line)
		}
		os.Exit(1)
	}
	return err
}

Prevention

When it happens

Trigger: readBulkDepEdges or validateBulkDepEdges collect per-edge errors (malformed IDs, bad dependency type, unknown issue, self-dependency) and find errs len > 0, so the entire batch is rejected with the joined list.

Common situations: Hand-written dependency files with typos in issue IDs; using an unsupported type keyword instead of blocks/blocks, parent-child, related, etc.; copying a file from another project whose issues don't exist locally.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/1f67d37e75714d9a. Report an issue: GitHub.