question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't follow symlinks: ENOENT: no such file or directory, lstat 'filename'

See original GitHub issue

Behaviour

Steps to reproduce this issue

  1. Generate files inside build_dir
  2. Create a symbolic link to a file within that same dir (analogous to running ln -s ./filename.tar.gz ./filename inside build_dir)
  3. 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

Those are the exact commit and build that fail.

action .yml config here

Logs

Download the log file of your build and attach it to this issue.

log.txt

Beware that the log is very long.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
crazy-maxcommented, Jan 29, 2021

@jlstevens

Symlinks do indeed work on gh-pages

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

To me it was easy, I just use cp with the flag to copy the file when a symlink is encountered

Thanks for pointing this out. I think we could mitigate this behavior here. I will take a look and keep you in touch.

0reactions
stale[bot]commented, Feb 28, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found