plandex-ai/plandex · error

error walking the path %s: %s

Error message

error walking the path %s: %s

What it means

GetChildProjectIdsWithPaths wraps any error returned by filepath.WalkDir in this message naming the walked directory (Cwd). The sentinel 'context timeout' is treated specially and returns partial results instead.

Source

Thrown at app/cli/fs/projects.go:112

				settings := settingsByAccount[currentUserId]

				if settings == nil {
					return nil
				}

				projectId := string(settings.Id)
				childProjectIds = append(childProjectIds, [2]string{path, projectId})
			}
		}
		return nil
	})

	if err != nil {
		if err.Error() == "context timeout" {
			return childProjectIds, nil
		}

		return nil, fmt.Errorf("error walking the path %s: %s", Cwd, err)
	}

	return childProjectIds, nil
}

View on GitHub (pinned to e2d772072e)

Solutions

  1. Fix or avoid the unreadable subdirectory named in the wrapped error
  2. Run the command as a user with read access to the whole tree, or skip restricted dirs
  3. If it was a timeout, increase the context deadline (timeout is handled separately)
  4. Re-run after resolving transient mount/IO issues

Example fix

// before
chmod 000 /project/secrets
plandex child-projects
// after
chmod 755 /project/secrets
plandex child-projects
Defensive patterns

Strategy: fallback

Validate before calling

if fi, err := os.Stat(Cwd); err != nil || !fi.IsDir() {
    return fmt.Errorf("cwd %s not walkable: %w", Cwd, err)
}

Try / catch

ids, err := GetChildProjectIdsWithPaths(ctx)
if err != nil {
    if strings.Contains(err.Error(), "context timeout") {
        // partial results already returned upstream
    } else {
        log.Warn("project scan failed; using no child projects", "err", err)
        ids = nil
    }
}

Prevention

When it happens

Trigger: filepath.WalkDir reports a non-timeout error — typically a directory that cannot be read (permission denied) or Stat failing on a file during traversal.

Common situations: Walking trees containing unreadable system or permission-restricted directories; dangling entries on failing mounts; racing deletion of files during the walk.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/2b39d824500d0c5c. Report an issue: GitHub.