Can't follow symlinks: ENOENT: no such file or directory, lstat 'filename'
See original GitHub issueBehaviour
Steps to reproduce this issue
- Generate files inside
build_dir
- Create a symbolic link to a file within that same dir (analogous to running
ln -s ./filename.tar.gz ./filename
insidebuild_dir
) - Get the error from the title
Expected behaviour
Tell me what should happen
It should publish the symlinks (though I think GH pages does not support it) or copy the destination file/dir over the symlink before publishing.
Actual behaviour
Tell me what happens instead
I have two of such files, they all fail:
Cannot stat symlink rsa.db.tar.zst for ./pkgs/rsa.db: Error: ENOENT: no such file or directory, lstat 'rsa.db.tar.zst'
Cannot stat symlink rsa.files.tar.zst for ./pkgs/rsa.files: Error: ENOENT: no such file or directory, lstat 'rsa.files.tar.zst'
I ran ls -Ahl <build_dir>
after generating such files, and it outputs the following:
Run ls -Ahl /__w/rsaur/rsaur/pkgs
total 3.5M
-rw-r--r-- 1 builduser builduser 1.4M Dec 30 08:58 chili-sddm-theme-0.1.5-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 86K Dec 30 08:58 gamemode-1.6-3-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 201K Dec 30 08:58 gamescope-3.7.1-1-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 761K Dec 30 09:00 gdm-nox-3.36.3-6-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 58K Dec 30 09:00 gnome-shell-extension-arch-update-git-38+3+gbe86f9e-1-any.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 15K Dec 30 09:01 gnome-shell-extension-clock-override-git-5+47+g7a40543-1-any.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 5.6K Dec 30 09:01 gnome-shell-extension-no-annoyance-git-r34.f6e7691-1-any.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 12K Dec 30 08:58 lib32-gamemode-1.6-3-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 415K Dec 30 09:02 lib32-mangohud-0.6.1-2-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 118K Dec 30 09:00 libgdm-nox-3.36.3-6-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 405K Dec 30 09:02 mangohud-0.6.1-2-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 7.9K Dec 30 09:03 mangohud-common-0.6.1-2-x86_64.pkg.tar.zst
-rw-r--r-- 1 builduser builduser 6.6K Dec 30 09:03 nvidia-xrun-git-0.3.83.g270b6c0-1-x86_64.pkg.tar.zst
lrwxrwxrwx 1 root root 14 Dec 30 09:03 rsa.db -> rsa.db.tar.zst
-rw-r--r-- 1 root root 3.5K Dec 30 09:03 rsa.db.tar.zst
lrwxrwxrwx 1 root root 17 Dec 30 09:03 rsa.files -> rsa.files.tar.zst
-rw-r--r-- 1 root root 7.5K Dec 30 09:03 rsa.files.tar.zst
Configuration
- Repository URL (if public): https://github.com/ranisalt/rsaur/tree/71d4a8b843c72d4e6083b3435d7f46b702752b44
- Build URL (if public): https://github.com/ranisalt/rsaur/actions/runs/452353910
Those are the exact commit and build that fail.
Logs
Download the log file of your build and attach it to this issue.
Beware that the log is very long.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
failed to create symbolic link - no such file or directory [closed]
Edit: Ok, the problem seems to be that it when the path includes a space, it thinks the name stops at this space...
Read more >Symbolic Link: No such file or directory - Ask Ubuntu
It is apparent that the symbolic link is broken, because file -L cannot open the symbolic link /usr/bin/bla. In this case, do the...
Read more >Symbolic Links (The GNU C Library)
The symlink function makes a symbolic link to oldname named newname . The normal return value from symlink is 0 . A return...
Read more >The trouble with symbolic links - LWN.net
An application running as root may try to check that /data/mydir is a regular directory (not a symlink) before opening the file /data/mydir/passwd....
Read more >Is there a file that always exists and a 'normal' user can't lstat it?
The lstat(2) operation will fail with EACCES here. (Removing all permissions from the directory ensures that. Maybe you don't even need that ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jlstevens
Yes we can use symlinks on GitHub Pages but in some cases link target is not available or is based on an absolute path which cannot be resolved on the target branch.
@ranisalt
Thanks for pointing this out. I think we could mitigate this behavior here. I will take a look and keep you in touch.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.