Skip to content
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

Do not fail cache key computation in case of no 'pip-dependency-file' #83

Closed
wants to merge 1 commit into from
Closed

Do not fail cache key computation in case of no 'pip-dependency-file' #83

wants to merge 1 commit into from

Conversation

zigarn
Copy link

@zigarn zigarn commented Dec 4, 2021

@zigarn zigarn requested a review from a team as a code owner December 4, 2021 12:52
Copy link
Contributor

@dsayling dsayling left a comment

Choose a reason for hiding this comment

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

LGTM - @KyleTryon should be a patch release

@clementlecorre
Copy link

clementlecorre commented Feb 9, 2022

@KyleTryon @zigarn I have exactly the same problem. Can we merge the fix?

@zigarn
Copy link
Author

zigarn commented Feb 9, 2022

@clementlecorre Looks like this is not relevant anymore with latest version 2.0.0 released yesterday.

@clementlecorre
Copy link

I'm in version 2.0.0, but I have a similar bug....

error computing cache key: template: cacheKey:1:32: executing "cacheKey" at <checksum "/tmp/cci_pycache/lockfile">: error calling checksum: open /tmp/cci_pycache/lockfile: no such file or directory

I use the same command as the example, maybe it's also a configuration problem on my side

@zigarn
Copy link
Author

zigarn commented Feb 9, 2022

You got a new bug from new code...

What's the output of previous step "Link lockfile"?

@clementlecorre
Copy link

Step "Link lockfile" ✅

INFO: Linking ./Pipfile.lock to /tmp/cci_pycache/lockfile
CircleCI received exit code 0

To be more precise I have the error on the cache (step: "Restoring cache" ❌ ) (I quoted above), it is not blocking for the continuation.

Then I have an error on the step "Copy to cache directory" ❌

ln: failed to create hard link '/tmp/cci_pycache/lockfile': File exists

Exited with code exit status 1
CircleCI received exit code 1

@zigarn
Copy link
Author

zigarn commented Feb 9, 2022

It's clearly a bug with the new code, better to fill an issue about this. (a quick and dirty fix would be to add -f in

ln -s "${LOCK_FILE}" "${LOCKFILE_PATH}"

But would be better to investigate as it's weird to try to create this lock link multiple times. Unless you use this job multiple time?

@clementlecorre
Copy link

clementlecorre commented Feb 9, 2022

I use the step only once.

🎉 I think the bug comes from the "Copy to cache directory" step. I think the unlink is not working properly.

if [ -f "${LOCKFILE_PATH}" ]; then
unlink "${LOCKFILE_PATH}"
fi

circleci@ID:~/project$ ls -lah /tmp/cci_pycache/lockfile
lrwxrwxrwx 1 circleci circleci 14 Feb  9 14:23 /tmp/cci_pycache/lockfile -> ./Pipfile.lock
circleci@ID:~/project$ if [ -f "/tmp/cci_pycache/lockfile" ]; then echo "do unlink"; fi
circleci@ID:~/project$ ls -lah /tmp/cci_pycache/lockfile
lrwxrwxrwx 1 circleci circleci 14 Feb  9 14:23 /tmp/cci_pycache/lockfile -> ./Pipfile.lock
circleci@ID:~/project$ if [ -L "/tmp/cci_pycache/lockfile" ]; then echo "do unlink"; fi
do unlink

Helpers:

-f FILE
FILE exists and is a regular file
-L FILE
FILE exists and is a symbolic link (same as -h)

clementlecorre added a commit to clementlecorre/python-orb that referenced this pull request Feb 9, 2022
-f FILE
FILE exists and is a regular file
-L FILE
FILE exists and is a symbolic link (same as -h)

issue: CircleCI-Public#83 (comment)
@Jaryt
Copy link
Contributor

Jaryt commented Feb 9, 2022

@clementlecorre Looks like this is not relevant anymore with latest version 2.0.0 released yesterday.

I was hoping to address this PR with these changes, but to my dismay this issue has cropped up. Will track this on the open PR #89

@Jaryt Jaryt closed this Feb 9, 2022
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.

4 participants