hasura/graphql-engine · error · errors.Error

cannot find [%s] | search stopped: %w

Error message

cannot find [%s] | search stopped: %w

What it means

While walking upward looking for the required files, CheckFilesystemBoundary rejected the next parent directory. This is a safety rail that stops the recursive search from escaping a filesystem boundary (e.g. crossing out of a mount, or past an allowed root), and the error lists the required files that could not be found before the boundary was hit.

Source

Thrown at cli/directory.go:101

	err = ValidateDirectory(startFrom)
	if err != nil {
		nextDir := filepath.Dir(startFrom)
		// to catch error gracefully in loop situation
		if nextDir == startFrom {
			return "", errors.E(
				op,
				fmt.Errorf(
					"failed recursively find config.yaml: search stopped due to a possible infinite filesystem traversal at %s",
					nextDir,
				),
			)
		}

		err := CheckFilesystemBoundary(nextDir)
		if err != nil {
			return nextDir, errors.E(
				op,
				fmt.Errorf(
					"cannot find [%s] | search stopped: %w",
					strings.Join(filesRequired, ", "),
					err,
				),
			)
		}

		return recursivelyValidateDirectory(nextDir)
	}

	return startFrom, nil
}

// validateDirectory tries to parse dir for the filesRequired and returns error
// if any one of them is missing.
func ValidateDirectory(dir string) error {
	var op errors.Op = "cli.ValidateDirectory"

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Run the command from inside the same filesystem/mount as the project directory
  2. Pass the project directory explicitly with the directory flag instead of relying on upward discovery
  3. Review any configured filesystem boundary option and widen it to include the project root

Example fix

# before
cd /tmp/work && mycli run   # boundary hit walking up from tmpfs
# after
mycli --dir /home/user/project run
Defensive patterns

Strategy: fallback

Validate before calling

cwd, _ := os.Getwd()
root, _ := filepath.Abs(projectRoot)
if !strings.HasPrefix(cwd+string(os.PathSeparator), root+string(os.PathSeparator)) {
    // avoid upward discovery across mounts; pass --dir explicitly
    log.Println("run from within", root, "or use --dir")
}

Try / catch

if err := ec.Validate(); err != nil {
    if strings.Contains(err.Error(), "search stopped") {
        // boundary hit: retry with an explicit directory inside the boundary
    }
}

Prevention

When it happens

Trigger: Calling the CLI from a subdirectory that lives on a different mount/filesystem than the project root, so the upward walk hits the mount boundary before finding config.yaml and migrations/.

Common situations: Temporary working dirs mounted separately (/tmp on tmpfs), container overlay layers, chroot environments, or running from a sibling repository with the boundary option configured to a narrow root.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/765f9809af550c44. Report an issue: GitHub.