Skip to content

fix(store): tolerate chmod failures on the store volume at startup - #886

Merged
scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-store-chmod-eperm
Aug 26, 2026
Merged

scttbnsn merged 1 commit into
dev/v1.7from
fix/v1.7-store-chmod-eperm

Conversation

@scttbnsn

Copy link
Copy Markdown
Contributor

Fixes the startup crash reported in discussion #874.

The permission tightening added in 1.6.0 chmods the store directory and file unguarded, so mounts that reject chmod (NFS/CIFS volumes, non-root containers, some volume drivers) crashed the whole process at startup with EPERM: operation not permitted, chmod '/store' — a regression from 1.5.2 that blocks upgrades.

Hardening shouldn't be fatal: EPERM/EACCES/ENOTSUP/EROFS now log a warning with the code and continue. ENOENT on the file stays silent as before; any other code still throws.

Parameterized tests over all four tolerated codes on both chmod paths, plus unexpected-code rethrow coverage.

@scttbnsn

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@vercel

vercel Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
drydock-website Ready Ready Preview Aug 26, 2026 8:38pm
drydockdemo-website Ready Ready Preview Aug 26, 2026 8:38pm

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 34 seconds.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0c6ace2b-67f8-4e64-b887-9cac592963e4

📥 Commits

Reviewing files that changed from the base of the PR and between c0b4e9f and 92e3642.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • app/store/index.test.ts
  • app/store/index.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chmod tolerance scoped to the four expected codes, rethrow preserved.

@ALARGECOMPANY ALARGECOMPANY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second approval.

@scttbnsn
scttbnsn merged commit c171980 into dev/v1.7 Aug 26, 2026
33 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.7-store-chmod-eperm branch August 26, 2026 21:11
scttbnsn added a commit that referenced this pull request Aug 27, 2026
* fix(api): map ws/wss forwarded protocols in websocket origin check

Some proxies (Traefik) forward the WebSocket upgrade's client-facing
scheme as ws/wss rather than http/https. Each pair carries the same
security level, so map ws -> http: and wss -> https: before comparing
against the browser's Origin; anything else is still rejected.

Backport of 64a5674 (PR #887) from dev/v1.7 to the v1.6 maintenance
line.

* fix(store): tolerate chmod failures on the store volume at startup

Some volume mounts (NFS/CIFS, non-root containers, certain volume
drivers) reject chmod outright. The permission tightening added in
1.6.0 chmod'd the store directory and file unconditionally, so those
mounts crashed the whole process at startup. Warn and continue on
EPERM/EACCES/ENOTSUP instead of throwing.

EROFS is deliberately excluded from the recoverable set: it means the
filesystem itself is read-only, so Loki's autosave (temp file plus
rename) would fail on every subsequent write. Treating it as
recoverable would leave a process that looks healthy while silently
persisting nothing, so it still fails fast at boot.

Squashed backport of 64a5674 c171980 (PR #886) and 8d0afe8 (PR #891)
from dev/v1.7 onto the v1.6 maintenance line, folded into one commit
so the EROFS bug #886 shipped and #891 fixed never exists as a
standalone state on this line.

* fix(debug): redact env pair values instead of names in debug dump

Container env vars appear in the dump as {key, value} pairs. The
generic redaction walker matched the pair's key property against the
"key" sensitive-token rule, so a var like HF_TOKEN had its name
redacted while the actual secret value was left in the clear. Pair
objects are now handled explicitly: the name always stays visible,
and the value is redacted only when the name itself looks sensitive.

Backport of 9b6cea5 (PR #885) from dev/v1.7 to the v1.6 maintenance
line.

* docs(changelog): record the three backported fixes under Unreleased

The v1.6.1-rc.3 version heading and its link definition are not part of
this PR. Following #872/#873, a backport adds bullets under the existing
`## [Unreleased]` heading and a separate `chore(release): roll release
identity forward` PR mints the version heading, updates the README and
docs version references, and rolls the fixtures in
scripts/changelog-links.test.mjs, scripts/release-docs-identity.test.mjs,
and scripts/release-identity.test.mjs to match.

This branch was successfully deployed

2 active deployments
Preview – drydock-website — 92e3642c Deployed Aug 26, 2026 by vercel[bot]
Preview – drydockdemo-website — 92e3642c Deployed Aug 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants