Skip to content

fix(core): error when restoring http cache with no outputs #30961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 1, 2025

Conversation

AgentEnder
Copy link
Member

Current Behavior

When restoring remote cache results that did not have any outputs, but the outputs array itself was not empty and using the http remote cache there is an OS Error hit with no such file or directory. This stems from the _copy call on a non-existant path.

Expected Behavior

We don't try to copy a non-existant path

Related Issue(s)

Fixes #30733

@AgentEnder AgentEnder requested review from a team as code owners April 30, 2025 23:06
@AgentEnder AgentEnder requested a review from Cammisuli April 30, 2025 23:06
Copy link

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Apr 30, 2025 11:35pm

Copy link

nx-cloud bot commented Apr 30, 2025

View your CI Pipeline Execution ↗ for commit 69c5852.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-ci ✅ Succeeded 37m 27s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 16s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 1s View ↗
nx documentation ✅ Succeeded 3m 18s View ↗

☁️ Nx Cloud last updated this comment at 2025-05-01 00:19:05 UTC

@AgentEnder AgentEnder force-pushed the fix/no-such-file-or-directory-http-cache branch from 0a9de6e to 69c5852 Compare April 30, 2025 23:33
@AgentEnder AgentEnder requested review from Copilot and removed request for Cammisuli April 30, 2025 23:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an error encountered when restoring the HTTP cache when no outputs exist by handling a missing file error gracefully.

  • Replaces the forced propagation of copy errors with a match block that handles the NotFound error specifically.
  • Introduces a helper method (underlying_io_error_kind) to extract the I/O error kind from the error chain.
Comments suppressed due to low confidence (1)

packages/nx/src/native/cache/cache.rs:304

  • [nitpick] The variable name 'sz' is not very descriptive. Consider renaming it to something like 'copied_bytes' to improve code clarity.
let sz = _copy(outputs_path, &self.workspace_root);

@AgentEnder AgentEnder enabled auto-merge (squash) April 30, 2025 23:43
@AgentEnder AgentEnder merged commit 91f5249 into master May 1, 2025
6 checks passed
@AgentEnder AgentEnder deleted the fix/no-such-file-or-directory-http-cache branch May 1, 2025 00:19
Copy link

github-actions bot commented May 7, 2025

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NX No such file or directory (os error 2) - when using the new remote cache from 20.8
2 participants