Repository navigation
Conversation
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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ken-symlinks Resolved src/controllers/upload.rs on top of #1308 (kept intact: canonical archive root, filter_entry escape check, DeployTarball/skipped_symlinks). Re-applied is_missing_path, the up-front project_path existence check (placed before #1308's canonicalize so the error stays 'no such path'), and the NotFound skip in the walk loop. #1308's filter_entry does not cover dangling links: with follow_links(true) walkdir errors with NotFound before the filter ever sees the entry. The skip only drops entries, so it cannot reintroduce an escape. Moved this PR's tests into a separate unresolvable_path_tests module (master's tests module is unix-only) and adapted them to DeployTarball.bytes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A single dangling symlink anywhere in the tree aborts
railway upduring indexing withNo such file or directory, and no deployment is created. An exact-path.railwayignorerule 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
NotFoundas skippable — a broken link, or a file removed mid-walk, has no contents to upload — and report it viareporter::warn, so it is structured under--json.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.mddangling +/backend/AGENTS.mdin.railwayignore):--jsonstdoutDeployed 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.