awalsh128 / cache-apt-pkgs-action

Cache APT packages in GitHub Actions
Other
205 stars 35 forks source link

Additional repo / tar: Cowardly refusing to create an empty archive #76

Closed MichaelClerx closed 1 year ago

MichaelClerx commented 1 year ago

Hi, Thanks for creating this, it looks like it could really speed up our unit tests.

The slowest install we have is from a non-standard repo, and (maybe because of this?) the caching script runs into an error. The final lines shown are:

tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
Error: Process completed with exit code 123.

A full log is here: https://github.com/myokit/myokit/actions/runs/3707556270/jobs/6284113435

Any help with this would be much appreciated

MichaelClerx commented 1 year ago

The error code 123 seems to be a bit of a red herring: https://stackoverflow.com/questions/54016035/does-tar-exit-code-123-always-mean-empty-archive

Tar only returns 0, 1, or 2; and xars turns 1 and 2 into 123

MichaelClerx commented 1 year ago

Not sure it's anything to do with the additional repo either? Seems more likely to be something to do with the number of args being sent to tar --- but my understanding of the script is very limited :D

awalsh128 commented 1 year ago

I think it isn't parsing the package name correctly and then fails to archive the files (which causes the tar error). That is my cursory guess though. I can take a look in a few days. What would help in the meantime is to run this with debug set to true. Can you do that and post the results?

awalsh128 commented 1 year ago

I added a test for this but am unable to replicate the issue.

https://github.com/awalsh128/cache-apt-pkgs-action-ci/actions/runs/3796943120/jobs/6457479412

Could you follow the instructions from my last comment? This would help since I can't seem to replicate the issue.

NOTE: I inlined your Ubuntu dependencies script as part of the test.

https://github.com/awalsh128/cache-apt-pkgs-action-ci/blob/master/.github/workflows/dev_test.yml#L289

MichaelClerx commented 1 year ago

Thanks for looking into this! Sorry for the late reply, was away for christmas.

Have rewritten and simplified the test, but the issue still occurs: https://github.com/myokit/myokit/actions/runs/3803268251

Adding debug: true results in a warning Unexpected input(s) 'debug', valid inputs are ['packages', 'version', 'refresh']

This goes away when I switch from @latest to @dev: https://github.com/myokit/myokit/actions/runs/3803276847/jobs/6469547524

  • echo 'opt/intel/oneapi/lib/licensing/compiler/Intel Developer Tools EULA'
  • IFS=
  • read -r f tar: opt/intel/oneapi/lib/licensing/compiler/Intel: Cannot stat: No such file or directory tar: Developer: Cannot stat: No such file or directory tar: Tools: Cannot stat: No such file or directory tar: EULA: Cannot stat: No such file or directory

So looks as simple as spaces in the directory name? (I'm guessing these will only occur with non-standard repos, but not sure if that's true, or guaranteed to be true in the future?)

awalsh128 commented 1 year ago

No problem, sorry the flag isn't working for you. :/

Thanks for digging. I'll treat it as a space issue and see if it works. Will update in the next few days (holidays and all).

awalsh128 commented 1 year ago

This is due to the latest tag not being on the actual latest rev (see #72). I was letting v1.2.0+ soak but then didn't rev soon enough. Sorry for this silly problem. This explains the replication problem and why the debug input wasn't working.

The tag has been updated. Try to the run again and confirm it is working.

MichaelClerx commented 1 year ago

This is what I get now: https://github.com/myokit/myokit/actions/runs/3830142331/jobs/6517643436

awalsh128 commented 1 year ago

Thanks, I'll look into it. FYI, I need to revert the latest and v1 tag due to #83.

awalsh128 commented 1 year ago

83 has been addressed. Latest release has both tag updated.