actions / actions/cache

actions/cache/save can not handle circular symbolic links in saved paths (ELOOP: too many symbolic links encountered)

Open
#1,460 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.6k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

The actions/cache/save@v4 action fails to create cache archive if there are "dead" circular symbolic links inside. The following error shows up in the output:

Warning: ELOOP: too many symbolic links encountered, stat '/home/runner/work/amneziawg-openwrt/amneziawg-openwrt/openwrt/staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/initial/lib/lib'
Warning: Cache save failed.

Problematic links:

$ find . -follow -printf ""
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/mips-openwrt-linux-musl/lib/lib’: Too many levels of symbolic links
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/initial/lib64/lib’: Too many levels of symbolic links
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/initial/lib/lib’: Too many levels of symbolic links
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/lib64/lib’: Too many levels of symbolic links
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/lib32/lib’: Too many levels of symbolic links
find: ‘./staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/lib/lib’: Too many levels of symbolic links

All these are circular symlinks, e.g.:

lrwxrwxrwx 1 runner docker    3 Sep  7 19:56 lib -> lib
lrwxrwxrwx 1 runner docker 3 Sep  7 19:56 staging_dir/toolchain-mips_24kc_gcc-11.2.0_musl/initial/lib/lib -> lib

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

Reproduce the failure with the reported circular links and the find . -follow -printf "" command, then trace the cache-save path that creates the archive. Verify behavior against paths containing self-referential symlinks and confirm that cache saving completes without the reported ELOOP warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.