Closed thetric closed 1 month ago
Sorry this is not working for you. I tried to reproduce it locally, still this is what I see, using the official
Can you please provide a larger example where this is failing for you? Do you have an example in a public Git repository? Maybe an AsciiDoc attribute setting is conflicting?
Hm, I guess it is more an issue with our server configuration, Kroki itself or asciidoctor-kroki
. When forcing the value of kroki-http-method
I observed two different behaviors:
get
: the SVG is invalid and contains the Kroki index.html
. I guess that is the same behavior I see in IntelliJ.post
: HTTP 500:io.vertx.core.json.DecodeException: Failed to decode:Unrecognized token 'object': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 7]
at io.vertx.core.json.jackson.DatabindCodec.fromParser(DatabindCodec.java:128)
at io.vertx.core.json.jackson.DatabindCodec.fromString(DatabindCodec.java:89)
at io.vertx.core.json.JsonObject.fromJson(JsonObject.java:1250)
at io.vertx.core.json.JsonObject.<init>(JsonObject.java:51)
at io.kroki.server.service.DiagramRest.lambda$create$0(DiagramRest.java:28)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1285)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:140)
...
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'object': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 7]
at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2481)
...
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2879)
at io.vertx.core.json.jackson.DatabindCodec.fromParser(DatabindCodec.java:125)
... 56 common frames omitted
This issue can be reproduced using this example: antora-repo.zip
POST is broken in asciidoctor-kroki: https://github.com/asciidoctor/asciidoctor-kroki/issues/448
Insofar not an issue with this plugin but with asciidoctor-kroki? I am not sure how these two relate, so feel free to close this issue
Thank you for providing the example. I extracted it and tested it locally. For me it works as expected:
I left it with the defaults which were set to "GET" in your config.
Log shown by Kroki:
{"timestamp":"1725106755239","level":"INFO","thread":"vert.x-eventloop-thread-1","mdc":{"path":"/plantuml/svg/eNrLT8pKTS5RULJJSSxJTMtMzUkptlNSSCxWKFao5qrlyseQhsimpHFxFSto6eoqKBno6RkqAQUAiXgWIQ==","referrer":"asciidoctor/kroki.rb/0.10.0-intellij","method":"GET","service_name":"plantuml","action":"request_received","bytes_read":"0","user_agent":"Ruby"},"logger":"io.kroki.server.service.DiagramHandler","message":"Request received GET /plantuml/svg/eNrLT8pKTS5RULJJSSxJTMtMzUkptlNSSCxWKFao5qrlyseQhsimpHFxFSto6eoqKBno6RkqAQUAiXgWIQ==","context":"default"}
{"timestamp":"1725106755395","level":"INFO","thread":"vert.x-eventloop-thread-1","mdc":{"path":"/plantuml/svg/eNrLT8pKTS5RULJJSSxJTMtMzUkptlNSSCxWKFao5qrlyseQhsimpHFxFSto6eoqKBno6RkqAQUAiXgWIQ==","took":"155","referrer":"asciidoctor/kroki.rb/0.10.0-intellij","method":"GET","service_name":"plantuml","action":"convert","file_format":"svg","user_agent":"Ruby"},"logger":"io.kroki.server.service.DiagramHandler","message":"Convert took 155ms","context":"default"}
Kroki image used
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/yuzutech/kroki latest 02f27593cc52 5 months ago 1.95 GB
I'm using plugin 0.43.1 on IntelliJ 2024.2.1 RC.
Also tested plugin 0.41.6 and 0.42.2 on IntelliJ 2024.1.6
I received the same issue where diagrams would not generate . Deleting the /.idea
folder in my project and re-loading the folder as a new project solved it. After the .idea folder was regenerated it was sorted. What in the folder was bad, I'm not sure.
Since you're able to create a new example project this might not be your issue, but starting from a fresh project might help although you'll be stuck setting it back up again. Clearly back up your current folder.
System - Win11, WSL docker compose of Kroki 0.25.0 PyCharm 2024.2.1 Plugin version 0.43.1
Aha! My issue came from a misconfigured proxy before Kroki
Observed vs. expected behavior
The preview does not render the diagram:
Neither the public Kroki server nor our selfhosted one does work. The IntelliJ logs do not include any errors regarding the generation
Steps to reproduce
Enable Kroki and create the following file:
Environment
Plugin Version: 0.42.2 (0.42.0 too) IntelliJ: 2024.1.4