Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect and warn about broken symlinks #4

Open
tfoote opened this issue Mar 1, 2022 · 0 comments
Open

Detect and warn about broken symlinks #4

tfoote opened this issue Mar 1, 2022 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@tfoote
Copy link
Owner

tfoote commented Mar 1, 2022

If you have a broken symlink inside of the working directory jekyll will crash.

/var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in initialize': No such file or directory @ rb_sysopen - /tmp/jekyll/xauth-1000-_1 (Errno::ENOENT)`

It would be helpful to detect this and give a more useful error message. As mounting the docker volume can break symlinks outside of the directory when invoked.

A traceback looks like this
docker run --rm -it -w /tmp/jekyll -v /home/tfoote/work/github/osrf/roscon2022-website:/tmp/jekyll -p 0.0.0.0:4000:4000 --network host  c42668237172 jekyll serve -w
WARNING: Published ports are discarded when using host network mode
Configuration file: /tmp/jekyll/_config.yml
            Source: /tmp/jekyll
       Destination: /tmp/jekyll/2022
 Incremental build: disabled. Enable with --incremental
      Generating... 
                    ------------------------------------------------
      Jekyll 4.2.1   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
Traceback (most recent call last):
	23: from /usr/local/bin/jekyll:23:in `<main>'
	22: from /usr/local/bin/jekyll:23:in `load'
	21: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
	20: from /var/lib/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	19: from /var/lib/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	18: from /var/lib/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	17: from /var/lib/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	16: from /var/lib/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	15: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
	14: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	13: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
	12: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	11: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:36:in `process'
	10: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/commands/build.rb:65:in `build'
	 9: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:28:in `process_site'
	 8: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:78:in `process'
	 7: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/site.rb:181:in `read'
	 6: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:16:in `read'
	 5: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `read_directories'
	 4: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:48:in `each'
	 3: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/reader.rb:52:in `block in read_directories'
	 2: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `has_yaml_header?'
	 1: from /var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `open'
/var/lib/gems/2.7.0/gems/jekyll-4.2.1/lib/jekyll/utils.rb:141:in `initialize': No such file or directory @ rb_sysopen - /tmp/jekyll/xauth-1000-_1 (Errno::ENOENT)
@tfoote tfoote added enhancement New feature or request help wanted Extra attention is needed labels Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant