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

Weird error when URI is too long #375

Open
OlivierJourdan opened this issue Jun 22, 2022 · 15 comments
Open

Weird error when URI is too long #375

OlivierJourdan opened this issue Jun 22, 2022 · 15 comments
Labels
📖 documentation duplicate This issue or pull request already exists

Comments

@OlivierJourdan
Copy link

I'm using this command on a file that contains a very large PlantUML diagram (File --> 062.adoc.txt)

.\asciidoctor -a diagram-server-url=https://kroki.io/ -a diagram-server-type=kroki_io -a kroki-fetch-diagram -r asciidoctor-kroki "C:\Users\team\Desktop\Large output\Includes\062.adoc"

I'm suspecting that the URI is too large but I get the following error:

asciidoctor: FAILED: C:/Users/team/Desktop/Large output/Includes/062.adoc: Failed to load AsciiDoc document - undefined method `request_post' for Net::HTTP:Class

    res = ::Net::HTTP.request_post(uri, data)
                     ^^^^^^^^^^^^^

Use --trace to show backtrace

The thing is that I was thinking that using the kroki-fetch-diagram attribute should have prevented this kind of error. What am I doing wrong or what I don't understand?

@ggrossetie
Copy link
Member

@OlivierJourdan Are you using Ruby > 2.4 ?

@OlivierJourdan
Copy link
Author

Yes, Ruby 3.1.2.

@ggrossetie
Copy link
Member

Oh I remember now, it was fixed in 242ca5d but I need to release a new version.

@ggrossetie ggrossetie added 🐞 bug Something isn't working duplicate This issue or pull request already exists labels Jun 22, 2022
@OlivierJourdan
Copy link
Author

Good to know there is already a fix 👍

Question: Why does the error only appears on a large diagram? (I don't understand the fix 😅).

@ggrossetie
Copy link
Member

Question: Why does the error only appears on a large diagram? (I don't understand the fix sweat_smile).

You can take a look at: https://docs.kroki.io/kroki/setup/configuration/#_max_uri_length and https://github.com/Mogztter/asciidoctor-kroki/tree/ruby-v0.5.0#configuration

Basically, there's a URI limit so when the size exceed 4000 characters we switch to POST (instead of GET)

@OlivierJourdan
Copy link
Author

Thanks for the hint.

@ggrossetie
Copy link
Member

@OlivierJourdan Just released version 0.6.0, could you please give it a try and report back if you have any issue?

@OlivierJourdan
Copy link
Author

It's working like a charm 😄
Thanks for the really quick support 👍

A subsidiary question, for PDF generation I'm using the following command asciidoctor-pdf -a diagram-server-url=https://kroki.io/ -a diagram-server-type=kroki_io -a allow-uri-read=true -r asciidoctor-kroki "C:\Users\team\Desktop\Large output\Includes\062.adoc" the generation is not failing but I don't get the image.

The output says:
asciidoctor: WARNING: could not retrieve remote image: https://kroki.io/plantuml/svg/eNrtHGtz3Lbxu34Fxvpi1XNt2qaejqYfcrqTrLP1ik5SOvnSgUjoxIhHXEBS1tXNfy8WDxIg8eBZkuW4dSYzkrBcLPaF3cUCP5QVZlW9zLdKUqECL0m5wgmZkxVmuKIM7W6Vd1kBvy3RJMdluYeTuwWjdZFOaM4Btg_Evx4YZSlhCuRv4l8X5IAWlQL4TvzrAhwSzHH0Jvz7d_DflgFd0RX_H13TqqJLlGaMJFVGi60EsKBXE3SIizQn7I_5fZ5d745foU9bW79t9QYmr9A__jMaub7Y2vJh29sY214A2wSwfbrJSJ7-ht4c07TOCZqlaBfN_vqXZmD7Cuc1Kflfj_EKcb7kcsXo9R1Z76J5xbJigUZIgO2iKa2vOZqDnOJqZ-sTl3mVJb-hT0tS3VJAd06W9J4ghfWCop9YVpHXLtg34zSVgBG4CSPYNzYlZcXo2j2ocXKeetk03Zjp0wDT9zfGth_AdrAxtgMD2zuhAA0zDhjX6DlhGc7RAWVLYFkzyAVgD5ksO7Q06YSbNtKa0f55zNXmHgb2KM0JLowP6uU1Yej0Bk1InpdaAX1yRifkIzq0qNuYdFi7ZNChwZDZ560jSOgF1z-0R4rk9qkonhkUv7co9rJ49B5d3DJS3tIc7Ns0UhNmfE8YXpAehHeBk5oxUlTofcguBRveP9Xq3xur__AM8vrwVIR-MAgdr1Z5lmDhNy_wolTGeCTo75Nzel3hrODiwFmOQQ4TnCd1DrtkaVEwThLC8XPfTeyB9gMEbLHH6HJVV_bf3vE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rFht9otvb4Xm4UOxiLREdU3iC7vSesBh-87MYrCgsDQUWzSRLuMSte6H6MLNiM2aItACe0o8BqmhlYNy3PVeXIg9o4umN2VYYRXKVJYHERwksEkMKtk8znNPFxhEtrovkFkUxHPMgNZjgAQZ9ARp9QPv3xLevqMVHbyh0bxQ4IkMxWV-Ev4fdKR56uV33hgFZ3OeHIzQzgPa5-SFxmh62utW9Tp1HxEtSlKpxJ9BSol4FCqVhyoSCMMf03oQwKww-XpnrULmOq1mnU3t4vsjbXRbc-oEUab3M_wu9MIwn
Does the kroki-http-method attribute can solve this? (I'm going to test).

@OlivierJourdan
Copy link
Author

Does the kroki-http-method attribute can solve this? (I'm going to test).

No, it's not working. As far as I understand, ascidoctor-pdf is reading the URI and getting the error. I should look at asciidoctor-pdf documentation.

@ggrossetie
Copy link
Member

I see two issues:

  • 414 URI Too Long -> kroki-http-method should be adaptive (default value) and you can play with kroki-max-uri-length to switch to POST
  • asciidoctor: ERROR: cannot fit formatted text on page -> not sure why...

@ggrossetie
Copy link
Member

ggrossetie commented Jun 22, 2022

That's strange because Kroki server says that the request URI's length exceeds 4096. If URI length exceeds 4000 we should be using a POST request:

https://github.com/Mogztter/asciidoctor-kroki/blob/0667f6313ea97871292d6ab1f25b30b43eea03e5/ruby/lib/asciidoctor/extensions/asciidoctor_kroki/extension.rb#L359-L367

I don't get why we are using a GET request...
Does it work if you configure kroki-http-method: post ?

@ggrossetie
Copy link
Member

OH I see, you need to add kroki-fetch-diagram=true otherwise it will use a GET request (since we don't download/fetch the diagram from Kroki).

The following command should be enough:

$ asciidoctor-pdf -a kroki-fetch-diagram -r asciidoctor-kroki doc.adoc

@OlivierJourdan
Copy link
Author

OlivierJourdan commented Jun 23, 2022

Sorry for the delayed reply, I was not able to test anything until now.

You're right $ asciidoctor-pdf -a kroki-fetch-diagram -r asciidoctor-kroki doc.adoc is working fine. I came to use a different command due to the issue with png file generation on windows (#369). Note that I'm not sure it was related, but this is where I ended up.

So,

  1. I can confirm that I can generate a large document (17+ Mb for the PDF) in PDF or HTML format with the same attributes in the command
  2. I guess that the v0.6.0 also fixed Png file generation issue #369. In any case, I could have generated each format (with png and SVG files) twice w/o issues with the images generated. Note that the second generation is much faster as far as the existing images are not fetched if I correctly understood the fix.

Long story short: everything is working! Thanks for your quick and efficient help 🙇‍♂️ 👍

I think the issue can be closed.

@ggrossetie
Copy link
Member

Thanks for your input!

Note that the second generation is much faster as far as the existing images are not fetched if I correctly understood the fix.

If the file already exists on disk it should not fetch again from Kroki. I believe that's why it's faster.

I think the issue can be closed.

I will keep it open since I think we should add a note in the documentation on how to resolve/workaround the error "414 Uri Too Long".

@ggrossetie ggrossetie added 📖 documentation and removed 🐞 bug Something isn't working labels Aug 31, 2022
@enrikb
Copy link

enrikb commented Jan 2, 2023

Please also document explicitly that GET will always be used as long as kroki-fetch-diagram is not set, even though kroki-http-method is set to post or adaptive (with very long URL).
Took me quite a bit to find out ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📖 documentation duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants