Fix failing on read-only file system even if the non-existence of file is already cached#4274
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pinact found unpinned actions in this repo.
Auto-fixable, but outside this PR's diff (run pinact run locally and commit):
.github/workflows/claude.yml:28—actions/checkout@v4→actions/checkout@34e114876b… # v4.3.1.github/workflows/claude.yml:33—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/contrib-tests.yml:28—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/contrib-tests.yml:30—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/model_card_consistency_reminder.yml:15—actions/checkout@v4→actions/checkout@34e114876b… # v4.3.1.github/workflows/python-prerelease.yml:34—actions/checkout@v4→actions/checkout@34e114876b… # v4.3.1.github/workflows/python-quality.yml:23—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/python-quality.yml:25—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/python-release.yml:16—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/python-release.yml:18—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/python-tests.yml:48—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/python-tests.yml:50—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/python-tests.yml:165—codecov/codecov-action@v3→codecov/codecov-action@ab904c41d6… # v3.1.6.github/workflows/python-tests.yml:185—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/python-tests.yml:187—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/python-tests.yml:234—codecov/codecov-action@v3→codecov/codecov-action@ab904c41d6… # v3.1.6.github/workflows/release-conda.yml:22—actions/checkout@v1→actions/checkout@50fbc622fc… # v1.2.0.github/workflows/release-conda.yml:25—conda-incubator/setup-miniconda@v2→conda-incubator/setup-miniconda@9f54435e0e… # v2.3.0.github/workflows/style-bot-action.yml:44—actions/github-script@v6→actions/github-script@d7906e4ad0… # v6.4.1.github/workflows/style-bot-action.yml:66—actions/github-script@v6→actions/github-script@d7906e4ad0… # v6.4.1.github/workflows/style-bot-action.yml:92—actions/checkout@v3→actions/checkout@f43a0e5ff2… # v3.6.0.github/workflows/style-bot-action.yml:137—actions/github-script@v6→actions/github-script@d7906e4ad0… # v6.4.1.github/workflows/style-bot-action.yml:154—actions/setup-python@v4→actions/setup-python@7f4fc3e22c… # v4.9.1.github/workflows/style-bot-action.yml:229—actions/github-script@v6→actions/github-script@d7906e4ad0… # v6.4.1.github/workflows/trufflehog.yml:11—actions/checkout@v4→actions/checkout@34e114876b… # v4.3.1.github/workflows/build_pr_documentation.yaml:12—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/build_repocard_examples.yaml:16—- actions/checkout@v2→- actions/checkout@ee0669bd1c… # v2.7.0.github/workflows/build_repocard_examples.yaml:18—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/update-inference-types.yaml:17—- actions/checkout@v3→- actions/checkout@f43a0e5ff2… # v3.6.0.github/workflows/update-inference-types.yaml:22—actions/setup-python@v2→actions/setup-python@e9aba2c848… # v2.3.4.github/workflows/update-inference-types.yaml:33—- actions/checkout@v3→- actions/checkout@f43a0e5ff2… # v3.6.0.github/workflows/update-inference-types.yaml:37—- actions/setup-node@v3→- actions/setup-node@3235b87634… # v3.9.1.github/workflows/update-inference-types.yaml:41—pnpm/action-setup@v2→pnpm/action-setup@eae0cfeb28… # v2.4.1.github/workflows/update-inference-types.yaml:71—peter-evans/create-pull-request@v7→peter-evans/create-pull-request@22a9089034… # v7.0.11
Need manual fix (pinact cannot resolve):
.github/workflows/build_documentation.yaml:12—huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main→ action can't be pinned.github/workflows/trufflehog.yml:15—huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main→ action can't be pinned.github/workflows/upload_pr_documentation.yaml:11—?→ action can't be pinned
ydshieh
commented
May 27, 2026
Comment on lines
+1553
to
+1559
| try: | ||
| no_exist_file_path.parent.mkdir(parents=True, exist_ok=True) | ||
| no_exist_file_path.touch() | ||
| except OSError as e: | ||
| logger.error( | ||
| f"Could not cache non-existence of file. Will ignore error and continue. Error: {e}" | ||
| ) |
Contributor
Author
There was a problem hiding this comment.
this is just indent
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Contributor
There was a problem hiding this comment.
Pinact found unpinned actions in this repo.
Auto-fixable, but outside this PR's diff (run pinact run locally and commit):
.github/workflows/model_card_consistency_reminder.yml:15—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-prerelease.yml:34—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:23—- actions/checkout@v6→- actions/checkout@de0fac2e45… # v6.0.2.github/workflows/python-quality.yml:25—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:57—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/python-tests.yml:174—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:293—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:348—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:435—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:555—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:690—- actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→- actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/release.yml:1018—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/style-bot-action.yml:184—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:17—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:20—actions/setup-python@v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/sync-hf-cli-skill.yml:46—actions/create-github-app-token@v3→actions/create-github-app-token@bcd2ba4921… # v3.2.0.github/workflows/sync-hf-cli-skill.yml:53—actions/checkout@v6→actions/checkout@de0fac2e45… # v6.0.2.github/workflows/sync-hf-cli-skill.yml:60—astral-sh/setup-uv@v7→astral-sh/setup-uv@37802adc94… # v7.6.0.github/workflows/sync-hf-cli-skill.yml:86—peter-evans/create-pull-request@v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1.github/workflows/build_repocard_examples.yaml:18—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:22—actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6→actions/setup-python@a309ff8b42… # v6.2.0.github/workflows/update-inference-types.yaml:37—- actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6→- actions/setup-node@48b55a011b… # v6.4.0.github/workflows/update-inference-types.yaml:71—peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8→peter-evans/create-pull-request@5f6978faf0… # v8.1.1
Contributor
|
This PR has been shipped as part of the v1.17.0 release. |
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.
For security reason, some CI workflows now using read-only (shared) file system of cache (but the cached files are already in the cache directory, from the CI workflows that have write permission).
This PR avoids such failures - add a condition
before trying to create directory and files.
TBH, it's not a hard failure as the log says
So it continues anyway. But the logic of this PR change is still valid IMO.
See a failing run
https://github.com/huggingface/transformers-test-ci/actions/runs/26447817457/job/78022469266
and a run that doesn't have this issue (running against this PR)
https://github.com/huggingface/transformers-test-ci/actions/runs/26500105668/job/78038233032
(the fetch hub objects step)
Note
Low Risk
Small guard around optional cache bookkeeping on 404; no change to download success paths or auth.
Overview
When the Hub returns 404 for a file,
huggingface_hubrecords that fact under.no_exist/<commit_hash>/<path>so later lookups can skip the network. The PR skipsmkdir/touchwhen that marker already exists.That avoids noisy read-only filesystem errors in CI jobs that mount a shared, pre-populated cache (writable in an earlier step, read-only afterward). Behavior is unchanged when the marker is missing and the cache is writable; commit-hash ref caching still runs either way.
Reviewed by Cursor Bugbot for commit 702a8f5. Bugbot is set up for automated code reviews on this repo. Configure here.