The process '/usr/bin/unzip' failed with exit code 9

I’m working on an action where I download an artifact from a different branch/commit using @actions/github and @actions/exec:

This sometimes fails to unzip with the exit code 9. As an example: https://github.com/getsentry/sentry/runs/900205530#step:2:57 – and here is the artifact it is trying to download and unzip: https://api.github.com/repos/getsentry/sentry/actions/artifacts/11885859

@billyvg,

I have created an issue ticket (actions/virtual-environments#1284) to help you report the problem to the appropriate engineering team for further investigation and evaluation.
You can follow this issue ticket and add your comments on it.

In addition, if possible please also check if this action only fails on some special environments, such as ubuntu-16.04 in your case. Does it also fail on other environments?

Hello, @billyvg
Could you please add an additional debug message to validate that a zip file was correctly downloaded with correct size and exists?

$ man unzip | grep -E "^ +9"
              9      the specified zipfiles were not found.

Ah, I will debug and make sure the file exists. Thanks

OK, I’ve removed {silent: true} on the curl command as well and it looks like curl fails downloading?

image

@billyvg,
This is a very suspicious small size for file - 34 bytes. What is the normal archive size?

50MB – I retried the workflow and this is a successful run: image

@billyvg
Could you please provide content of the failed archive(like cat visual-snapshots-base.zip )? Try to update logic if a file is very small try to download 2-3 times more?

Yeah I will retry the download when it fails – ideally we could leverage @actions/artifact more (What I’m doing here is downloading an artifact from a workflow on a different branch). I saw there are some internal modules in @actions/artifact as well e.g. https://github.com/actions/toolkit/blob/1cc56db0ff126f4d65aeb83798852e02a2c180c3/packages/artifact/src/internal/download-http-client.ts

1 Like

Agree I think it’s a good approach to download an artifact using @actions/artifact task.

Yeah to be clear, we can’t use @actions/artifact because it does not support download artifacts from other branches/workflows.

Thanks for the help!