---
title: "A script from the artifact is not executable | Proofline"
description: "When files travel in a zip, execute permission and symbolic links depend on the tools at both ends."
url: https://proofline.sh/learn/zip-artifact-loses-permissions/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# A script from the artifact is not executable

When files travel in a zip, execute permission and symbolic links depend on the tools at both ends. If either matters to the reproduction, put a tar file inside the transfer and send a manifest.

Broken dependencies The Proofline team November 24, 2026 3 min read

## What survived in each path

The directory holds `run.sh` with mode 755 and `link`, a symlink to it.

| Path | `run.sh` | `link` |
| --- | --- | --- |
| `tar cf`, `tar xf` | 755 | A symlink |
| Python `zipfile`, written and extracted by `zipfile` | 664 | A regular file, a copy of the target |
| `zip -r`, `unzip` | 755 | A regular file with mode 755 |
| `zip -ry`, `unzip` | 755 | A symlink |

In the second row, the archive did record 755. Reading the entry's attributes showed `0o100755`, and `extractall` did not apply it. So "it is a zip" does not answer the question, and neither does listing the archive. The mode of extracted files also depends on the receiver's umask. Run with Python 3.12 on Linux.

For GitHub Actions, the [upload-artifact README](https://github.com/actions/upload-artifact#permission-loss) says: "File permissions are not maintained during zipped artifact upload. All directories will have `755` and all files will have `644`." It recommends a tar file uploaded with `archive: false`.

## Recognize it

| Message | Likely cause | Check |
| --- | --- | --- |
| `Permission denied` running the script | Execute bit lost | `ls -l` on the file |
| `Permission denied`, and the bit is set | A mount with `noexec`, or a directory without `x` | `findmnt -T .` |
| `required file not found` | A carriage return in the first line | [Line endings](/learn/crlf-changes-in-handoff/) |
| Two copies of a library that should be one | A symlink became a file | `find . -type l` on both sides |
| A file present on one machine and not on the other | Names that differ only in case | `find . \| sort -f \| uniq -di` |

`sh run.sh` works without the bit. That is a useful test and a poor fix, because the reproduction then runs under a different shell from the one named in its first line.

## Send a manifest

```
find . -type f ! -name MANIFEST -print0 | sort -z | xargs -0 sha256sum > MANIFEST
find . -printf '%p %M %y %l\n' | sort > MODES
```

On arrival:

```
sha256sum -c MANIFEST
find . -type f | wc -l; wc -l < MANIFEST
```

`sha256sum -c` checks the files it lists. In the fixture, an extra file in the directory did not make it fail: it printed `run.sh: OK` and exited 0. Compare the counts to see additions, and expect the manifests themselves in the difference. Contents do not include modes, so compare `MODES` too when a mode matters.

## Decide

If the reproduction is source code, send a commit; Git records the execute bit and symlinks. If it is a build output, use tar. If the receiver can only open zip files, make the first step explicit: `chmod +x run.sh`, and say which links were replaced by copies.

## Worked example

This example is fictional. A QA job downloads a CLI artifact and every test fails with `Permission denied`. The build job's own smoke test passed on the same commit. The modes differ: 755 before the upload and 644 after. The build team uploads a tar file instead. Two tests still fail, because the binary is linked against a library that exists only on the build image, and that was the real defect behind the first one.

Return to [handing over evidence](/learn/engineering-handoff-evidence/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [A script fails on your colleague's machine because its line endings changed](/learn/crlf-changes-in-handoff/)
    
    Broken dependencies The Proofline team November 24, 2026 3 min read
    
-   ### [Hand over enough evidence for the next engineer to decide](/learn/engineering-handoff-evidence/)
    
    Code review The Proofline team November 24, 2026 5 min read
