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

Docker image failure #762

Closed
AlexisBRENON opened this issue Oct 10, 2024 · 1 comment · Fixed by #765
Closed

Docker image failure #762

AlexisBRENON opened this issue Oct 10, 2024 · 1 comment · Fixed by #765

Comments

@AlexisBRENON
Copy link

Describe the bug
With the newest versions of the docker image, I'm not able to render my chart anymore.
The process hangs for a while and finally crash with the following error:

ProtocolError: Network.enable timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
    at <instance_members_initializer> (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:89:14)
    at new Callback (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:93:16)
    at CallbackRegistry.create (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/common/CallbackRegistry.js:19:26)
    at Connection._rawSend (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Connection.js:86:26)
    at CdpCDPSession.send (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/CDPSession.js:63:33)
    at NetworkManager.addClient (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/NetworkManager.js:59:20)
    at FrameManager.initialize (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/FrameManager.js:1[67](https://github.com/greenbids/greenbids-tailor-external/actions/runs/11270373229/job/31340948174#step:4:68):38)
    at #initialize (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Page.js:280:36)
    at CdpPage._create (file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Page.js:93:31)
    at file:///home/mermaidcli/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Target.js:202:32

To Reproduce

  1. Create a file test.mmd:
sequenceDiagram
    A ->>+ B: hello
    B -->>- A: ""
  1. Render the chart with old docker image:
docker run --rm -u $(id -u) -v $PWD:/data ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:11.2.1-beta.3 -i /data/test.mmd
  1. Render the chart with new docker image:
docker run --rm -u $(id -u) -v $PWD:/data ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:11.2.1 -i /data/test.mmd

Expected behavior
I expected the rendering to succeed as previously.

Additional context
You may see more examples in my repository which uses the image as part of the CI.

@aloisklink
Copy link
Member

aloisklink commented Oct 11, 2024

I can't replicate this issue on my local machine using:

cat test-positive/flowchart1.mmd | docker run --rm -i ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:11.2.1 --input - --output - --outputFormat svg

However, I have replicated this using GitHub Codespaces (which I believe uses similar machines to the default GitHub Actions runners), and I'm having the same issue. ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:11.2.1 doesn't work, but ghcr.io/mermaid-js/mermaid-cli/mermaid-cli:11.2.1-beta.5 works.

image

Edit: Ah, I think I might know the issue. The -beta.x Docker images are built using DockerfileBuild, which uses Apline Linux 3.19:

FROM node:18.20-alpine3.19 AS mermaid-cli-current

However, the production Docker images are built using the Dockerfile, which uses the latest version of Alpine Linux (currently 3.20):

FROM node:alpine

However, it looks like version of Chromium in Apline Linux 3.20 doesn't play nicely with Puppeteer: puppeteer/puppeteer#12637

I'm not 100% sure why we have both a Dockerfile and a DockerfileBuild, but I suspect just using the same one for everything should fix this issue.

aloisklink added a commit to aloisklink/mermaid-cli that referenced this issue Oct 12, 2024
Chromium 128.0.6613.84-r0 (used in Alpine 3.20) seems to be having
issues with puppeteer/mermaid-cli, so we can't use it yet.

See: 294af9f
Fixes: mermaid-js#762
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

Successfully merging a pull request may close this issue.

2 participants