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

No such file or directory @ rb_sysopen #41

Closed
doktorbro opened this issue May 15, 2014 · 15 comments
Closed

No such file or directory @ rb_sysopen #41

doktorbro opened this issue May 15, 2014 · 15 comments

Comments

@doktorbro
Copy link

Proofer crashes on a Travis test with:

htmlproof 0.6.7 | Error:  No such file or directory @ rb_sysopen - <file path>

The PR is IIIF/api#105. The traced Travis build is https://travis-ci.org/IIIF/iiif.io/builds/25216529

I can reproduce the issue on my local machine with Ruby 1.9.3.

@doktorbro
Copy link
Author

After adding the missing file the issue is gone. But it is just a workaround. The question is, why Proofer tries to proof an non-existent file?

@gjtorikian
Copy link
Owner

It's more a feature then a bug. Basically, like every browser ever, Proofer expects there to be a top-level index.html file when you navigate to a folder. For pages with clean URLs (or just using Jekyll), checking for an index.html is really handy.

The workaround suggested was to add data-proofer-ignore to the anchor. I could in the future add an option to disable assumption of index.html but I have not seen it as a problem yet.

@parkr
Copy link
Contributor

parkr commented May 15, 2014

Basically, like every browser ever, Proofer expects there to be a top-level index.html file when you navigate to a folder.

If the link is to a folder, then it can be any number of things (index.html, index.htm, index.shtml, index.php, index.xml, etc) depending upon the server setup. You're not assuming there's going to be an index.html file for every folder level, right? Just for those directories being linked to?

@gjtorikian
Copy link
Owner

shifty eyes

file = File.join path, "index.html" if File.directory? File.expand_path file, @check.src

You're not assuming there's going to be an index.html file for every folder level, right? Just for those directories being linked to?

Yes. But now your mention of all those other file types has me in a tizzy. 😩

@parkr
Copy link
Contributor

parkr commented May 15, 2014

Yes. But now your mention of all those other file types has me in a tizzy.

I think HTMLProofer can assume either html, htm, or xhtml. But honestly... should this be a tool for legacy sites? 😉

shifty eyes

If @check.src is a dir, then I think it's safe to assume you should check for a common index file. Maybe that can be a config option? :trollface:

@gjtorikian gjtorikian reopened this May 15, 2014
@doktorbro
Copy link
Author

@gjtorikian The error occurs while you load the source files with outgoing links before you start to check anything: https://github.com/gjtorikian/html-proofer/blob/master/lib/html/proofer.rb#L25 Nevermind.

@nschonni
Copy link
Contributor

Yeah, I just ran into this one as well https://travis-ci.org/nschonni/wet-boew/builds/32812844#L2463
Slight difference was that there is no link to a folder root, but just rally long query string plus anchor link (I think that is what is tripping it, but there is no trace back)

@doktorbro
Copy link
Author

@nschonni Can you please provide the exact link?

This is your situation now, right?

# does not exist
dist/demos/texthighlight/index.html

# do exist
dist/demos/texthighlight/texthighlight-fr.html
dist/demos/texthighlight/texthighlight-en.html

@nschonni
Copy link
Contributor

@penibelst I believe the link it's having trouble with is ?txthl=avian%20influenza+world+cook+flu-like%20symptoms+Don't%20Forget...+causes%20sickness%20in%20birds,%20it%20can%20also%20infect%20people.#example from here https://github.com/wet-boew/wet-boew-dist/blob/4b3ea7429223726c674350737cd879bc31992c3e/demos/texthighlight/texthighlight-en.html#L136

You can grab the prebuilt site if you want to test it out https://github.com/wet-boew/wet-boew-dist

Oddly enough, if I add :followlocation => false and :disable_external => true then it runs, although then other missing trailing slashes are found, but it no longer crashes.

@doktorbro
Copy link
Author

I think #93 fixes all the mentioned issues.

@doktorbro
Copy link
Author

@nschonni The version 1.3.0 fixes your issue.

@nschonni
Copy link
Contributor

Thanks @penibelst! It's not crashing anymore, but it just stalls out completely https://travis-ci.org/nschonni/wet-boew/builds/33367787
I'll see if I can find a combo of options that lets it run again.

@doktorbro
Copy link
Author

@nschonni Can you please start Proofer with only one file?

HTML::Proofer.new("example.html").run

@nschonni
Copy link
Contributor

Yeah, running a smaller set help, but it's taking almost 10minutes to run on less than 200 pages now. Getting false positives for the href links, not sure if it's tripping on HTML5 elements, but this is the wrong thread for that 😉

@doktorbro
Copy link
Author

@nschonni External URLs are unpredictable. Try the timeout option:

HTML::Proofer.new(dir, {
  :timeout => 10 # seconds
}).run

If you see false positives, please open a new issue with examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants