Describe the problem/error/question
Title: Git node throws ENOENT: realpath '/files/git' — error path is truncated to parent directory, not the configured Repository Path
Environment:
- n8n version: [run
docker exec -it n8n n8n --versionto get the exact version] - Deployment: Self-hosted, Docker Compose, single container (
n8nio/n8n:latest) - Database: [SQLite default, unless you changed it]
- Node: Git node (
n8n-nodes-base.git), Operation: Pull
Bug description:
The Git node fails with ENOENT: no such file or directory, realpath '/files/git' even though the configured Repository Path field is set to /files/git/ea2sa-blogs — a valid, existing repository, not /files/git. The error consistently references the parent directory of the configured path, never the full path actually entered in the field.
Steps to reproduce:
- Mount a host directory into the container at
/files, withN8N_RESTRICT_FILE_ACCESS_TO=/filesset - Have a valid pre-existing git repository at
/files/git/ea2sa-blogs(confirmed clean, in sync with origin, via directgit -C /files/git/ea2sa-blogs statusrun inside the container) - Add a Git node, Operation = Pull, Repository Path =
/files/git/ea2sa-blogs - Execute the node
Expected behavior: Node performs git pull against /files/git/ea2sa-blogs.
Actual behavior: Node throws ENOENT: no such file or directory, realpath '/files/git' — note the path in the error is the parent directory, not the configured Repository Path.
Diagnostics already performed (ruling out config/permissions issues):
- Confirmed
/files/git/ea2sa-blogs/.gitexists with a full valid structure (HEAD,config,objects,refs, etc.) via the Read/Write Files from Disk node - Confirmed the repo is healthy directly via
docker exec -it n8n git -C /files/git/ea2sa-blogs status→ clean working tree, up to date withorigin/main - Confirmed
originremote is correctly set (git remote -v) - Confirmed the Repository Path field in the node UI literally displays
/files/git/ea2sa-blogs(no expression binding, no trailing whitespace — retyped manually) - Confirmed
N8N_RESTRICT_FILE_ACCESS_TO=/filesis satisfied, since/files/git/ea2sa-blogsis a subpath - Ruled out volume-mount issues — directory ownership and contents verified correct from inside the running container
Stack trace:
Error: ENOENT: no such file or directory, realpath ‘/files/git’
at realpath (node:internal/fs/promises:1181:10)
at Object.resolvePath (…/n8n-core/…/file-system-helper-functions.ts:50:24)
at ExecuteContext.execute (…/nodes-base/nodes/Git/Git.node.ts:303:36)```
Possible related issue: This may share a root cause with #30538 (Git node clone path resolution throwing fatal: destination path '.' already exists on n8n 2.20.9) — both point to the Git node’s internal path resolution logic (likely in file-system-helper-functions.ts’s resolvePath) computing or validating against the parent directory instead of the full configured path.
Information on your n8n setup
- **n8n version: 2.21.4
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: