aarongustafson / jekyll-webmention_io

A Jekyll Plugin for rendering Webmentions via Webmention.io
https://aarongustafson.github.io/jekyll-webmention_io/
MIT License
139 stars 27 forks source link

the scheme https does not accept registry part: pixelfed.org' (or bad hostname?) (URI::InvalidURIError) #163

Closed xplosionmind closed 1 year ago

xplosionmind commented 3 years ago

Error when running bundle exec jekyll webmention. Log:

~/tommi.space [main] » bundle exec jekyll webmention
NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See https://github.com/sparklemotion/nokogiri/issues/2205 for more information.
Configuration file: /Users/tommi/tommi.space/_config.yml
[jekyll-webmention_io] Getting ready to send webmentions (this may take a while).
jekyll 4.2.1 | Error:  the scheme https does not accept registry part: pixelfed.org' (or bad hostname?)
/Users/tommi/.rbenv/versions/3.0.2/lib/ruby/3.0.0/uri/generic.rb:207:in `initialize': the scheme https does not accept registry part: pixelfed.org' (or bad hostname?) (URI::InvalidURIError)
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/3.0.0/uri/common.rb:82:in `new'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/3.0.0/uri/common.rb:82:in `for'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/3.0.0/uri/rfc2396_parser.rb:210:in `parse'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/webmention_io.rb:366:in `uri_ok?'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:47:in `block (2 levels) in process'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:33:in `each'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:33:in `block in process'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:32:in `each'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:32:in `process'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/bundler/gems/jekyll-webmention_io-65efd7dd058b/lib/jekyll/commands/webmention.rb:14:in `block (2 levels) in init_with_program'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.2/bin/jekyll:25:in `load'
    from /Users/tommi/.rbenv/versions/3.0.2/bin/jekyll:25:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:58:in `load'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:58:in `kernel_load'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli/exec.rb:23:in `run'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:478:in `exec'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:31:in `dispatch'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:25:in `start'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/exe/bundle:49:in `block in <top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/site_ruby/3.0.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'
    from /Users/tommi/.rbenv/versions/3.0.2/lib/ruby/gems/3.0.0/gems/bundler-2.2.31/exe/bundle:37:in `<top (required)>'
    from /Users/tommi/.rbenv/versions/3.0.2/bin/bundle:23:in `load'
    from /Users/tommi/.rbenv/versions/3.0.2/bin/bundle:23:in `<main>'
fancypantalons commented 3 years ago

So this looks like a busted URL to me. If you look at the error message it reports pixelfed.org'. Notice the stray single quote at the end of the host name. Can you just the link in the markdown text or wherever it's present to see if it's malformed?

xplosionmind commented 3 years ago

As mentioned in #162, the issue persist. Formatting is correct, 100% sure.

Note: in .jekyll-cache/webmention_io_outgoing.yml I see some links ending with a ' which should not be there. Content of the file is here.

fancypantalons commented 2 years ago

I just checked the source file and I see you're using HTML-style links instead of markdown links, which is almost certainly confusing some regular expression somewhere... I'll poke around and see if I can find the root cause, but the original code was almost certainly not written with that in mind!

Edit: Scratch that, I think the real issue is that the URLs are wrapped in single quotes, and the current regex doesn't account for that. Probably a minor fix, just working to replicate the issue, now, so I can test.

fancypantalons commented 2 years ago

@xplosionmind Alright, I was able to replicate the issue in a small test site and pushed a fix. Feel free to pull the main branch and give 'er a try.

xplosionmind commented 2 years ago

Uhm… I think there still is some sort of error, though not the same. Now no Webmentions at all are sent, when running bundle exec jekyll webmention:

Configuration file: /Users/tommi/tommi.space/_config.yml
[jekyll-webmention_io] Getting ready to send webmentions (this may take a while).
[jekyll-webmention_io] 0 webmentions sent.
fancypantalons commented 2 years ago

The change I made only impacts the webmention gathering/queuing phase which occurs when you run a site build (i.e. bundle exec jekyll build).

Can you check <cache>/webmention_io_outgoing.yml to confirm there are outstanding webmentions that are queued to be sent?

xplosionmind commented 2 years ago

Can you check <cache>/webmention_io_outgoing.yml to confirm there are outstanding webmentions that are queued to be sent?

Yes! There are! Is it normal that all of the links listed end with : false? Does it mean that the destination website has not been pinged yet?

fancypantalons commented 2 years ago

Yup, that's exactly what that means.

fancypantalons commented 1 year ago

Closing this based on the previously pushed fix. If there's still an issue we can reopen or start a new ticket!