asciidoctor / asciidoctor-diagram

:left_right_arrow: Asciidoctor diagram extension, with support for AsciiToSVG, BlockDiag (BlockDiag, SeqDiag, ActDiag, NwDiag), Ditaa, Erd, GraphViz, Mermaid, Msc, PlantUML, Shaape, SvgBob, Syntrax, UMLet, Vega, Vega-Lite and WaveDrom.
http://asciidoctor.org
MIT License
442 stars 107 forks source link

asciidoctor: ERROR: <stdin>: line 123: Failed to generate image: 301 "Moved Permanently" #284

Closed anoff closed 4 years ago

anoff commented 4 years ago

I am a bit unsure where to file this issue. But trying to figure out what is going wrong I found out that the error only occurs with asciidoctor-diagram 2.0.2

I have a docker container that I use to build asciidoctor with inline plantUML diagrams using Hugo. The setup is in place for 1.5 years now. Recently I started seeing errors in my pipeline and the rendered HTML page in the form of:

ERROR 2020/07/19 10:55:15 code/2019-10-autoscaling-ci-agent-with-azure-kubernetes.adoc: asciidoctor: ERROR: <stdin>: line 160: Failed to generate image: 301 "Moved Permanently"

I tried looking at the current documentation of asciidoctor/-diagram but couldn't find anything that seemed to have changed. So I started debugging various versions that have changed since it last worked.

Long story short; this error occurs if I use asciidoctor-diagram -v 2.0.2 but does not occur if I use v2.0.1, 2.0.0, 1.5.19.

Would appreciate any hints as to what might cause this behavior with the latest version.

pepijnve commented 4 years ago

No idea right away what might be causing the issue. Based on your investigation I think this is probably due to the particular version of PlantUML that's included in 2.0.2. Why that would cause a 301 return code is a mystery to me too.

Could you provide a sample document that reliably triggers the error for you?

anoff commented 4 years ago

Trying to get a minimal example I found out a few other things:

So without 💯 % understanding what is going on here, it seems that the latest version minds that there is a redirect on the render server, whereas older ones do not.

I got my solution (setting the server URL differently) for now :)

Thanks Pepijn

pepijnve commented 4 years ago

Ah, the server-url bit explains it. The code that's handling the http request does not support redirects yet. That should be easy enough to add.

pepijnve commented 4 years ago

@anoff 7b12aab adds built-in support for HTTP redirects. With that change http://plantuml.com/plantuml will work as well.

anoff commented 4 years ago

Oh wow, awesome :) Thanks alot!