cabo / kramdown-rfc

An XML2RFC (RFC799x) backend for Thomas Leitner's kramdown markdown parser
MIT License
191 stars 81 forks source link

problem with redirect #27

Open boutil opened 8 years ago

boutil commented 8 years ago

Hi,

when trying to run the "stupid" example, I encounter the following problem. It was working before. Is it related with a change on the ietf.org website? Does it have to be reflected somewhere in the code of kramdown-rfc2629?

ruby -I ../lib/ ../bin/kramdown-rfc2629 stupid.mkd stupid.xml 
.refcache/reference.RFC.2119.xml: fetching
/usr/lib/ruby/2.3.0/open-uri.rb:225:in `open_loop': redirection forbidden: http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml -> https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml (RuntimeError)
        from /usr/lib/ruby/2.3.0/open-uri.rb:151:in `open_uri'
        from /usr/lib/ruby/2.3.0/open-uri.rb:717:in `open'
        from /usr/lib/ruby/2.3.0/open-uri.rb:35:in `open'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:436:in `block in get_and_cache_resource'
        from /usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:106:in `timeout'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:435:in `get_and_cache_resource'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:487:in `block in convert_img'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:482:in `scan'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:482:in `convert_img'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:125:in `block in inner_a'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in `map'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in `inner_a'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:130:in `inner'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:143:in `convert_p'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:125:in `block in inner_a'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in `map'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in `inner_a'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:130:in `inner'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:615:in `convert_root'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:118:in `convert1'
        from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:113:in `convert'
        from /usr/lib/ruby/vendor_ruby/kramdown/converter/base.rb:105:in `convert'
        from /usr/lib/ruby/vendor_ruby/kramdown/document.rb:120:in `method_missing'
        from ../bin/kramdown-rfc2629:341:in `<main>'

It may be related to the following mail on the xml2rfc mailing list about a browser problem similar to the error message:

https://mailarchive.ietf.org/arch/msg/xml2rfc/PEL8ZkS6uYaTG0ZhoSMYqV6cbIU

cabo commented 8 years ago

Hi Cédric,

Indeed, there is discussion today on the tools mailing list about a redirection problem, exacerbated by a certificate problem. I have to think about ways of making kramdown-rfc more robust to this kind of situation.

Grüße, Carsten

cabo commented 8 years ago

This appears to be a bug in the open-uri library, though.

Workaround at the moment:

XML_RESOURCE_ORG_PREFIX=https://xml2rfc.tools.ietf.org/public/rfc kramdown-rfc2629

(i.e., set the environment variable XML_RESOURCE_ORG_PREFIX to the value https://xml2rfc.tools.ietf.org/public/rfc before calling kramdown-rfc2629)

Grüße, Carsten

Carsten Bormann wrote:

Hi Cédric,

Indeed, there is discussion today on the tools mailing list about a redirection problem, exacerbated by a certificate problem. I have to think about ways of making kramdown-rfc more robust to this kind of situation.

Grüße, Carsten

On 28 Aug 2016 12:10, Cédric Boutillier wrote:

Hi,

when trying to run the "stupid" example, I encounter the following problem. It was working before. Is it related with a change on the ietf.org website? Does it have to be reflected somewhere in the code of kramdown-rfc2629?

ruby -I ../lib/ ../bin/kramdown-rfc2629 stupid.mkd stupid.xml
.refcache/reference.RFC.2119.xml: fetching /usr/lib/ruby/2.3.0/open-uri.rb:225:in open_loop': redirection forbidden: http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml -> https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml (RuntimeError) from /usr/lib/ruby/2.3.0/open-uri.rb:151:inopen_uri' from /usr/lib/ruby/2.3.0/open-uri.rb:717:in open' from /usr/lib/ruby/2.3.0/open-uri.rb:35:inopen' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:436:in block in get_and_cache_resource' from /usr/lib/ruby/2.3.0/timeout.rb:91:inblock in timeout' from /usr/lib/ruby/2.3.0/timeout.rb:33:in block in catch' from /usr/lib/ruby/2.3.0/timeout.rb:33:incatch' from /usr/lib/ruby/2.3.0/timeout.rb:33:in catch' from /usr/lib/ruby/2.3.0/timeout.rb:106:intimeout' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:435:in get_and_cache_resource' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:487:inblock in convert_img' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:482:in scan' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:482:inconvert_img' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:125:in block in inner_a' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:inmap' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in inner_a' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:130:ininner' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:143:in convert_p' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:125:inblock in inner_a' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:in map' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:123:ininner_a' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:130:in inner' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:615:inconvert_root' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:118:in convert1' from /home/boutil/src/ruby/kramdown-rfc2629/lib/kramdown-rfc2629.rb:113:inconvert' from /usr/lib/ruby/vendor_ruby/kramdown/converter/base.rb:105:in convert' from /usr/lib/ruby/vendor_ruby/kramdown/document.rb:120:inmethod_missing' from ../bin/kramdown-rfc2629:341:in `
'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cabo/kramdown-rfc2629/issues/27, or mute the thread https://github.com/notifications/unsubscribe-auth/AABaTms-WhnR8o-4KS1JlzN0PJsoUdT-ks5qkV6ZgaJpZM4Ju5Bk.

cabo commented 8 years ago

I pushed a 1.0.34 with a workaround installed. Please update:

gem update

cabo commented 8 years ago

Leaving this open, as the workaround still needs to be moved to the proper stable base URI.

jaimejim commented 8 years ago

I can confirm that gem update to kramdown-rfc2629-1.0.34.gem fixes the bug for me.

boutil commented 7 years ago

I tried 1.0.36, and the problem is fixed for me too. Thanks!

josephlhall commented 7 years ago

Heya, after updating to a newer kramdown-rfc2629 I get a message "Occasionally run certified-update" but I had to hunt around to figure out that was the executable provided by the following gem: https://github.com/stevegraham/certified

Would be good to make that a bit easier to figure out.