Skip to content

fix(up): skip unresolvable paths instead of failing the whole upload - #1043

Open
codyde wants to merge 2 commits into
masterfrom
railway/up-skip-broken-symlinks
Open

codyde wants to merge 2 commits into
masterfrom
railway/up-skip-broken-symlinks

Conversation

@codyde

@codyde codyde commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Problem

A single dangling symlink anywhere in the tree aborts railway up during indexing with No such file or directory, and no deployment is created. An exact-path .railwayignore rule cannot exclude it: follow_links(true) makes the walker stat the symlink target before the ignore rules are consulted for that entry, so the error is raised before matching happens.

Closes #1023.

Resolution

  • Treat a walk entry whose error is NotFound as skippable — a broken link, or a file removed mid-walk, has no contents to upload — and report it via reporter::warn, so it is structured under --json.
  • Any other error still fails the deploy; a permission or I/O error would mean a silently incomplete tarball.
  • Validate the root path up front. It reaches the walker as the same NotFound, and none of the three callers check it, so skipping it would turn a typo'd path into an empty but successful deploy.

Not follow_links(false): that regresses symlinked directories, which is what #296 fixed.

Verification

Real deploys, identical tree (backend/AGENTS.md dangling + /backend/AGENTS.md in .railwayignore):

before (5.30.4) after
exit code 1 0
deployment none created SUCCESS
--json stdout — valid JSON

Deployed app serves correctly, so real files still ship. Covered by 7 tests including symlinked-dir traversal, symlink loop stays fatal, and the missing-root and empty-dir/single-file boundaries.

codyde added 2 commits August 5, 2026 15:23
A dangling symlink anywhere in the tree aborted `railway up` during indexing
with "No such file or directory", creating no deployment. An exact-path
`.railwayignore` rule could not exclude it: `follow_links(true)` makes the
walker stat the symlink target before the ignore rules are consulted for that
entry, so the error is raised before matching happens.

Treat a walk entry whose error is `NotFound` as skippable — a broken link, or a
file removed mid-walk, has no contents to upload — and report it through
`reporter::warn` so it is structured under `--json`. Any other error still
fails the deploy, since that would mean a silently incomplete tarball.

Validate the root path up front: it reaches the walker as the same `NotFound`,
and no caller checks it, so skipping it would turn a typo'd path into an empty
but successful deploy.
@codyde codyde added the release/patch Author patch release label Aug 5, 2026 — with Railway App

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/patch Author patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

railway up fails when an exact-path .railwayignore rule matches a dangling symlink

1 participant