MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

mermaid: Generating ..seq_flow/20240402032019.svg.. Error: Failed to launch the browser process!

Open 45592858 opened this issue 1 year ago • 1 comments

Bug description Generating /app/metagpt/workspace/jqdlhwap/resources/seq_flow/20240402032019.svg.. Error: Failed to launch the browser process!

Bug solved method

Environment information "docker compose up -d" after clone already run "npm install -g @mermaid-js/mermaid-cli":

root@84a2e77496b0:/app/metagpt# mmdc -h Usage: mmdc [options]

Options: -V, --version output the version number -t, --theme [theme] Theme of the chart (choices: "default", "forest", "dark", "neutral", default: "default") -w, --width [width] Width of the page (default: 800) -H, --height [height] Height of the page (default: 600) -i, --input Input mermaid file. Files ending in .md will be treated as Markdown and all charts (e.g. mermaid (...)) will be extracted and generated. Use - to read from stdin. -o, --output [output] Output file. It should be either md, svg, png or pdf. Optional. Default: input + ".svg" -e, --outputFormat [format] Output format for the generated image. (choices: "svg", "png", "pdf", default: Loaded from the output file extension) -b, --backgroundColor [backgroundColor] Background color for pngs/svgs (not pdfs). Example: transparent, red, '#F0F0F0'. (default: "white") -c, --configFile [configFile] JSON configuration file for mermaid. -C, --cssFile [cssFile] CSS file for the page. -s, --scale [scale] Puppeteer scale factor (default: 1) -f, --pdfFit Scale PDF to fit chart -q, --quiet Suppress log output -p --puppeteerConfigFile [puppeteerConfigFile] JSON configuration file for puppeteer. -h, --help display help for command

  • LLM type and model name: zhipu-api / GLM-4
  • System version:
  • Python version:
  • MetaGPT version or branch: main

run in docker

  • packages version:
  • installation method:

Screenshots or logs 2024-04-02 03:20:46.126 | INFO | metagpt.utils.mermaid:mermaid_to_file:48 - Generating /app/metagpt/workspace/jqdlhwap/resources/seq_flow/20240402032019.svg.. 2024-04-02 03:20:46.460 | WARNING | metagpt.utils.mermaid:mermaid_to_file:74 - Error: Failed to launch the browser process! [0402/032046.449080:ERROR:zygote_host_impl_linux.cc(100)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

at Interface.onClose (file:///usr/lib/node_modules/@mermaid-js/mermaid-cli/node_modules/@puppeteer/browsers/lib/esm/launch.js:253:24)
at Interface.emit (node:events:524:35)
at Interface.close (node:internal/readline/interface:526:10)
at Socket.onend (node:internal/readline/interface:252:10)
at Socket.emit (node:events:524:35)
at endReadableNT (node:internal/streams/readable:1378:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

45592858 avatar Apr 02 '24 03:04 45592858

After this pr merging, modify config2.yaml with the following configuration to disable the mermaid tool:

mermaid:
  engine: "none"

iorisa avatar Apr 02 '24 08:04 iorisa