question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression when no files/folders match path

See original GitHub issue

In cache@v1, the step would fail to create the cache:

Post job cleanup.
/bin/tar -cz -f /home/runner/work/_temp/2a248b52-7c16-40d2-99f3-7385c4e6783a/cache.tgz -C /home/runner/.nuget/packages .
/bin/tar: /home/runner/.nuget/packages: Cannot open: No such file or directory
/bin/tar: Error is not recoverable: exiting now
[warning]Tar failed with error: The process '/bin/tar' failed with exit code 2

But in cache@v2, it creates an empty tar file:

Post job cleanup.
/bin/tar --use-compress-program zstd -T0 -cf cache.tzst -P -C /home/runner/work/cache-test/cache-test --files-from manifest.txt
Cache saved successfully

Which then results in extracting the empty tar:

Run actions/cache@v2
Cache Size: ~0 MB (22 B)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/f096b41b-1e38-4cd8-a7be-ead81367a21b/cache.tzst -P -C /home/runner/work/cache-test/cache-test
Cache restored from key: Linux-nuget--v2

Also note that when there are no matches for hashFiles, it fills in with an empty string. I believe it used to fail with an error when hashFiles failed to match anything.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
brandurcommented, Jun 23, 2020

Sorry for the drive by, but wanted to give this one a light +1.

Upgrading to cache@v2 caused my build to fail, but in a fairly non-obvious way. Based on the Cache Size: ~0 MB (22 B) message (and thanks to this issue!), I was able to localize it a problem with the cache not being populated with anything, but even right now, it’s not clear to me why that’s the case — I double-, triple-, and quadruple-checked my paths, and there’s nothing obviously wrong.

Of course this is still suggestive of a problem on my end, but this would have been a lot faster to diagnose and debug if the cache action complained loudly if it determined an input path did not exist.

0reactions
bishal-pdMSFTcommented, Nov 24, 2022

Closing. Re-open with more context if this is still an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to skip the for loop when there are no matching files?
You can stop this behaviour by setting nullglob: shopt -s nullglob. From the linked page: nullglob is a Bash shell option which modifies ......
Read more >
Delete folders which not match a list - Unix Stack Exchange
Another solution that matches begin and end of the folder names: ... -type d tells find to only match directories, and not files....
Read more >
Batch script to get matching expression file name in a folder
By click right on windows logo in start bar choose "run" from the list and opene it. Then write this word "recent" and...
Read more >
Get-ChildItem -File -Filter *. no longer finds extension-less files ...
in Windows PowerShell and v6.1.3 you can match files that don't have a filename extension with provider filter -Filter *.
Read more >
How to list the file search through a given path for all files that ...
glob is mostly a filename pattern matching library, but it can be used to list items in the current directory by:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found