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

[kroki]: Cannot render large diagram with Error 400: Internal Server #1827

Open
al-cheb opened this issue Feb 13, 2025 · 6 comments
Open

[kroki]: Cannot render large diagram with Error 400: Internal Server #1827

al-cheb opened this issue Feb 13, 2025 · 6 comments

Comments

@al-cheb
Copy link

al-cheb commented Feb 13, 2025

Config docker-compose.yaml

services:
  core:
    image: yuzutech/kroki
    environment:
      - KROKI_DIAGRAMSNET_HOST=diagramsnet
      - KROKI_MAX_URI_LENGTH=8192
      - KROKI_CONVERT_TIMEOUT=45s
      - KROKI_COMMAND_TIMEOUT=5s
    ports:
      - "8000:8000"
    deploy:
      resources:
        limits:
          memory: 512M
        reservations:
          cpus: 50
          memory: 512M
  diagramsnet:
    image: yuzutech/kroki-diagramsnet
    environment:
      - KROKI_MAX_BODY_SIZE=5mb
    deploy:
      resources:
        limits:
          memory: 256M
        reservations:
          cpus: 50
          memory: 256M
    ports:
      - "8005:8005"
    expose:
      - "8005"

How to reproduce:

$ curl -v http://localhost:8000/diagramsnet/svg --data-binary '@spark.drawio.txt'

> POST /diagramsnet/svg HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/8.5.0
> Accept: */*
> Content-Length: 1672439
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 400 Internal Server Error
< content-type: text/plain
< content-length: 32
< 
* Connection #0 to host localhost left intact
Error 400: Internal Server

Logs:

$ docker logs a358ebe39b0f
{
  "timestamp": "1739433275254",
  "level": "WARN",
  "thread": "vert.x-eventloop-thread-1",
  "mdc": {
    "error_message": "Internal Server Error",
    "path": "/diagramsnet/svg",
    "method": "POST",
    "action": "warning",
    "error_code": "400",
    "failure_class_name": "io.netty.handler.codec.http.multipart.HttpPostRequestDecoder$TooLongFormFieldException",
    "user_agent": "curl/8.5.0"
  },
  "logger": "io.kroki.server.error.ErrorHandler",
  "message": "Bad request",
  "context": "default"
}

The direct request to diagramsnet service works without issue:

$ curl -v http://localhost:8005/svg --data-binary '@spark.drawio.txt'

What did you expect to see?
A diagram should be rendered without errors.

@al-cheb
Copy link
Author

al-cheb commented Feb 13, 2025

@ggrossetie, hey, any ideas?

@ggrossetie
Copy link
Member

Probably related to netty/netty#14125

@al-cheb
Copy link
Author

al-cheb commented Feb 20, 2025

Probably related to netty/netty#14125

@ggrossetie, any plans to bump up a lib version and publish new image?

@ggrossetie
Copy link
Member

Just released 0.27.0, could you give it a try?

@al-cheb
Copy link
Author

al-cheb commented Feb 21, 2025

@ggrossetie, unfortunately no luck.

$ docker ps
CONTAINER ID   IMAGE                               COMMAND                  CREATED          STATUS          PORTS                                         NAMES
c1a589a21fc4   yuzutech/kroki:0.27.0               "/bin/sh -c 'exec ja…"   43 seconds ago   Up 42 seconds   0.0.0.0:8000->8000/tcp, [::]:8000->8000/tcp   desktop-core-1
efb080eb29cb   yuzutech/kroki-diagramsnet:0.27.0   "node src/index.js"      43 seconds ago   Up 42 seconds   0.0.0.0:8005->8005/tcp, [::]:8005->8005/tcp   desktop-diagramsnet-1

$ docker logs c1a589a21fc4
{
  "timestamp": "1740130772870",
  "level": "INFO",
  "thread": "vert.x-eventloop-thread-0",
  "logger": "io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer",
  "message": "Succeeded in deploying verticle",
  "context": "default"
}
{
  "timestamp": "1740130788154",
  "level": "WARN",
  "thread": "vert.x-eventloop-thread-1",
  "mdc": {
    "error_message": "Internal Server Error",
    "path": "/diagramsnet/svg",
    "method": "POST",
    "action": "warning",
    "error_code": "400",
    "failure_class_name": "io.netty.handler.codec.http.multipart.HttpPostRequestDecoder$TooLongFormFieldException",
    "user_agent": "curl/8.5.0"
  },
  "logger": "io.kroki.server.error.ErrorHandler",
  "message": "Bad request",
  "context": "default"
}
{
  "timestamp": "1740130806705",
  "level": "WARN",
  "thread": "vert.x-eventloop-thread-1",
  "mdc": {
    "error_message": "Internal Server Error",
    "path": "/diagramsnet/svg",
    "method": "POST",
    "action": "warning",
    "error_code": "400",
    "failure_class_name": "io.netty.handler.codec.http.multipart.HttpPostRequestDecoder$TooLongFormFieldException",
    "user_agent": "curl/8.5.0"
  },
  "logger": "io.kroki.server.error.ErrorHandler",
  "message": "Bad request",
  "context": "default"
}


@al-cheb
Copy link
Author

al-cheb commented Feb 21, 2025

Example file - spark.drawio.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants