actions / actions/toolkit

ArtifactClient emits an error instead of uploading symlinks to directories

Open
#803 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

artifact bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
If a symlink which points to a directory is passed as one of the files arguments to ArtifactClient.uploadArtifact(), then the following error is raised:

Error: EISDIR: illegal operation on a directory, read
Emitted 'error' event on ReadStream instance at:
    at internal/fs/streams.js:167:12
    at FSReqCallback.wrapper [as oncomplete] (fs.js:470:5) {
  errno: -21,
  code: 'EISDIR',
  syscall: 'read'
}

To Reproduce
Within an action:

  1. Create a symlink which points to a directory
  2. Attempt to upload it as an artifact
  3. Receive the above error

Slightly less literally:

Attempt to use https://github.com/fourieraudio/upload-artifact/tree/no-follow to upload an artifact which contains a symlink to a directory, with the new follow-symlinks variable set to false (see https://github.com/actions/upload-artifact/pull/201)

Expected behavior
A file, which is a symlink, is uploaded as an artifact.

Screenshots
N/A

Desktop (please complete the following information):
GitHub Actions Runner Ubuntu 20.04

Additional context
I was attempting to add support for archiving symlinks so that I could add support to upload-artifact.

I did have a stab at fixing this (see https://github.com/fourieraudio/toolkit/compare/main..symlink ) but I didn't seem to have much joy, and sadly ran out of time to debug this further.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the ArtifactClient.uploadArtifact() entry point and reproduce the failure with a symlink pointing to a directory and follow-symlinks set to false. Trace the upload path that produces the EISDIR error; done means the symlink is uploaded as an artifact without emitting the read error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.