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.

hashFiles fails silently when it encounters a broken symlink

See original GitHub issue

Describe the bug When the pattern passed to hashFiles() matches a broken symlink (a symlink that points to a non-existent file), hashFiles() silently fails and produces an empty hash. Example: https://github.com/formsort/formsort/runs/5096669434?check_suite_focus=true#step:4:139

To Reproduce Steps to reproduce the behavior:

  1. Create a repo
  2. Add a symlink to a non-existent file ln -s bla bla
  3. Create a workflow that uses hashFiles("**") in it
  4. Observe that the output of hashFiles("**") is empty witout any errors
  5. Now enable step debug logging: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
  6. Re-run the action
  7. Observe the unhandled promise rejection error, silently being swallowed:
    ##[debug](node:1536) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/runner/work/[redacted]'
    

Expected behavior hashFiles should either skip over broken symlinks or fail the whole job loudly, clearly indicating the error.

Runner Version and Platform

Version of your runner?

GitHub-hosted Ubuntu 20.04

Job Log Output

##[debug](node:1536) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, stat '/home/runner/work/[redacted]'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
nikola-jokiccommented, Feb 9, 2022

Hi @BYK,

I reproduced the issue. Working on the fix so you don’t have to bother creating an example repository 😊.

1reaction
nikola-jokiccommented, Feb 10, 2022

Hi @BYK, don’t worry about it 😊. Your issue description was good enough! I submitted a PR fixing this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Symlink broken right after creation
create a symlink called TARGET which is symbolically linked to the string SOURCE . If SOURCE is a relative path (that is, it...
Read more >
Why does ln -sf silently fail? - symlink
ln -f without -s must of course fail because you're asking it to increase the ref count on a non-existent inode. – Joseph...
Read more >
Fixing Broken Symlinks With Find and Replace - Techbit
The Problem. If a symlink is pointing at a file and the path changes (say a folder was renamed), the symlink is then...
Read more >
ftp.porcupine.org/mirrors/postfix-release/official...
Bugfix: the smtp server command tokenizer silently discarded the [] around [text], ... Cleanup: after "postfix reload", no more broken pipe complaints from ......
Read more >
man page dar section 1
COMMANDS: Only seven commands define what action will be done by dar: Archive creation, archive extraction, archive listing, archive testing, archive comparison ...
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