CircleCI-Public / CircleCI-Public/rust-orb

Error saving the cache

Open
#31 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
2
Forks
14
PR merge metrics
No merged PRs in 30d

Description

## Orb version: 1.8.0

## What happened:

The step "Process cache save" (for the `rust/build` command) failed with this error:
```
+ '[' -n '' ']'
+ mkdir -p /tmp/cargo_tmp
+ cp -r /home/circleci/.cargo /tmp/cargo_tmp/
cp: cannot create regular file '/tmp/cargo_tmp/.cargo/git/checkouts/some-redacted-crate/XXXXXXX/.git/objects/pack/pack-redacted.idx': Permission denied
cp: cannot create regular file '/tmp/cargo_tmp/.cargo/git/checkouts/some-redacted-crate/XXXXXXX/.git/objects/pack/pack-redacted.pack': Permission denied

Exited with code exit status 1
```

and the step "Process cache restore" (for the `rust/test` command) failed with this error:
```
+ '[' -d /tmp/cargo_tmp ']'
+ echo 'Cache directory found'
Cache directory found
+ '[' -n '' ']'
+ rm -r /home/circleci/.cargo
rm: remove write-protected regular file '/home/circleci/.cargo/git/db/some-redacted-crate/objects/pack/pack-redacted.idx'? rm: remove write-protected regular file '/home/circleci/.cargo/git/db/some-redacted-crate/objects/pack/pack-redacted.pack'? rm: cannot remove '/home/circleci/.cargo/git/db/some-redacted-crate/objects/pack': Directory not empty
```

I had to use this config to workaround these issues:
```yaml
- rust/build:
with_cache: false

- rust/test:
with_cache: false
```

## Expected behavior:

The command without disabling cache should work out of the box.

## Additional Information:

It is likely that this issue only happens for Rust projects with dependencies.

Contributor guide

No contributing guide indexed for this repository

Research direction

No source files or tests are named. Start by locating the cache handling used by the rust/build and rust/test commands, then reproduce the failure with a Rust dependency cache. Done means both commands work with caching enabled and no longer require with_cache: false.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.