m2ci-msp / gradle-pandoc-reveal-plugin

Apply common build logic to a slideshow project using Pandoc and reveal.js
Apache License 2.0
2 stars 1 forks source link

Mermaid filter test is broken for macOS Sonoma, Ubuntu Noble in GitHub Actions #43

Open psibre opened 6 months ago

psibre commented 6 months ago

Although it did work in the past, it turns out that the Mermaid filter test no longer runs on macOS in GitHub Actions. The issue has to do with Puppeteer failing to launch Chrome correctly:

    node:child_process:965
        throw err;
        ^

    Error: Command failed: "/opt/homebrew/lib/node_modules/mermaid-filter/node_modules/.bin/mmdc"    -w 800 -s 1 -f -i "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T/tmp-5442k0Zm4Vj8JkSX.tmp" -t default -b white -o "/var/folders/lr/439_fwvd3m76p9vy50d57kcc0000gn/T/tmp-5442k0Zm4Vj8JkSX.tmp.svg"

    TimeoutError: Timed out after 30000 ms while waiting for the WS endpoint URL to appear in stdout!
        at ChromeLauncher.launch (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/puppeteer-core/lib/esm/puppeteer/node/ProductLauncher.js:119:23)
        at async run (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/@mermaid-js/mermaid-cli/src/index.js:416:19)
        at async cli (file:///opt/homebrew/lib/node_modules/mermaid-filter/node_modules/@mermaid-js/mermaid-cli/src/index.js:192:3)

        at genericNodeError (node:internal/errors:984:15)
        at wrappedFn (node:internal/errors:538:14)
        at checkExecSyncError (node:child_process:890:11)
        at execSync (node:child_process:962:15)
        at mermaid (/opt/homebrew/lib/node_modules/mermaid-filter/index.js:84:5)
        at /opt/homebrew/lib/node_modules/mermaid-filter/index.js:164:12
        at /opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:52:19
        at Array.forEach (<anonymous>)
        at walk (/opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:50:7)
        at /opt/homebrew/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:74:16 {
      status: 1,
      signal: null,
      output: [
        null,
        Buffer(0) [Uint8Array] [],
        Buffer(518) [Uint8Array] [
           10,  84, 105, 109, 101, 111, 117, 116,  69, 114, 114, 111,
          114,  58,  32,  84, 105, 109, 101, 100,  32, 111, 117, 116,
           32,  97, 102, 116, 101, 114,  32,  51,  48,  48,  48,  48,
           32, 109, 115,  32, 119, 104, 105, 108, 101,  32, 119,  97,
          105, 116, 105, 110, 103,  32, 102, 111, 114,  32, 116, 104,
          101,  32,  87,  83,  32, 101, 110, 100, 112, 111, 105, 110,
          116,  32,  85,  82,  76,  32, 116, 111,  32,  97, 112, 112,
          101,  97, 114,  32, 105, 110,  32, 115, 116, 100, 111, 117,
          116,  33,  10,  32,
          ... 418 more items
        ]
      ],
      pid: 5443,
      stdout: Buffer(0) [Uint8Array] [],
      stderr: Buffer(518) [Uint8Array] [
         10,  84, 105, 109, 101, 111, 117, 116,  69, 114, 114, 111,
        114,  58,  32,  84, 105, 109, 101, 100,  32, 111, 117, 116,
         32,  97, 102, 116, 101, 114,  32,  51,  48,  48,  48,  48,
         32, 109, 115,  32, 119, 104, 105, 108, 101,  32, 119,  97,
        105, 116, 105, 110, 103,  32, 102, 111, 114,  32, 116, 104,
        101,  32,  87,  83,  32, 101, 110, 100, 112, 111, 105, 110,
        116,  32,  85,  82,  76,  32, 116, 111,  32,  97, 112, 112,
        101,  97, 114,  32, 105, 110,  32, 115, 116, 100, 111, 117,
        116,  33,  10,  32,
        ... 418 more items
      ]
    }

    Node.js v20.13.1
    Error running filter mermaid-filter:
    Filter returned error status 1
psibre commented 6 months ago

The last successful run was actually 2 months ago, when macos-latest meant macOS 12.7.4...

psibre commented 6 months ago

Indeed, this seems to be a combination of incompatibility of mermaid-filter (or rather, its dependency on Puppeteer) with macOS 14 in GitHub Actions, and the recent upgrade of macos-latest to point to macOS 14 (Sonoma) (see https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/)

psibre commented 6 months ago

Workaround: Run the macOS test on Ventura. Done in 91c53db6cb07bc36a419c1b91e37dde7cd80878b.

psibre commented 3 months ago

A similar error occurs when running the test on Ubuntu Noble:

    node:child_process:965
        throw err;
        ^

    Error: Command failed: "/usr/local/lib/node_modules/mermaid-filter/node_modules/.bin/mmdc"    -w 800 -s 1 -f -i "/tmp/tmp-2880zb7ASCe8Tq0a.tmp" -t default -b white -o "/tmp/tmp-2880zb7ASCe8Tq0a.tmp.svg"

    Error: Failed to launch the browser process!
    [0815/113220.522631:FATAL:zygote_host_impl_linux.cc(127)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/main/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
    #0 0x556134484f72 base::debug::CollectStackTrace()
    #1 0x5561344714b3 base::debug::StackTrace::StackTrace()
    #2 0x5561343c3fbf logging::LogMessage::~LogMessage()
    #3 0x556132be0c16 content::ZygoteHostImpl::Init()
    #4 0x55613391ab23 content::ContentMainRunnerImpl::Initialize()
    #5 0x556133918427 content::RunContentProcess()
    #6 0x556133918606 content::ContentMain()
    #7 0x556133f021fa headless::HeadlessShellMain()
    #8 0x556130039255 ChromeMain
    #9 0x7f63a202a1ca (/usr/lib/x86_64-linux-gnu/libc.so.6+0x2a1c9)
    #10 0x7f63a202a28b __libc_start_main
    #11 0x55613003902a _start

    TROUBLESHOOTING: https://pptr.dev/troubleshooting

        at Interface.onClose (file:///usr/local/lib/node_modules/mermaid-filter/node_modules/@puppeteer/browsers/lib/esm/launch.js:253:24)
        at Interface.emit (node:events:531:35)
        at Interface.close (node:internal/readline/interface:528:10)
        at Socket.onend (node:internal/readline/interface:254:10)
        at Socket.emit (node:events:531:35)
        at endReadableNT (node:internal/streams/readable:1696:12)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

        at genericNodeError (node:internal/errors:984:15)
        at wrappedFn (node:internal/errors:538:14)
        at checkExecSyncError (node:child_process:890:11)
        at execSync (node:child_process:962:15)
        at mermaid (/usr/local/lib/node_modules/mermaid-filter/index.js:84:5)
        at /usr/local/lib/node_modules/mermaid-filter/index.js:164:12
        at /usr/local/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:52:19
        at Array.forEach (<anonymous>)
        at walk (/usr/local/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:50:7)
        at /usr/local/lib/node_modules/mermaid-filter/node_modules/pandoc-filter/index.js:74:16 {
      status: 1,
      signal: null,
      output: [
        null,
        Buffer(0) [Uint8Array] [],
        Buffer(1508) [Uint8Array] [
           10,  69, 114, 114, 111, 114,  58,  32,  70,  97, 105, 108,
          101, 100,  32, 116, 111,  32, 108,  97, 117, 110,  99, 104,
           32, 116, 104, 101,  32,  98, 114, 111, 119, 115, 101, 114,
           32, 112, 114, 111,  99, 101, 115, 115,  33,  10,  91,  48,
           56,  49,  53,  47,  49,  49,  51,  50,  50,  48,  46,  53,
           50,  50,  54,  51,  49,  58,  70,  65,  84,  65,  76,  58,
          122, 121, 103, 111, 116, 101,  95, 104, 111, 115, 116,  95,
          105, 109, 112, 108,  95, 108, 105, 110, 117, 120,  46,  99,
           99,  40,  49,  50,
          ... 1408 more items
        ]
      ],
      pid: 2891,
      stdout: Buffer(0) [Uint8Array] [],
      stderr: Buffer(1508) [Uint8Array] [
         10,  69, 114, 114, 111, 114,  58,  32,  70,  97, 105, 108,
        101, 100,  32, 116, 111,  32, 108,  97, 117, 110,  99, 104,
         32, 116, 104, 101,  32,  98, 114, 111, 119, 115, 101, 114,
         32, 112, 114, 111,  99, 101, 115, 115,  33,  10,  91,  48,
         56,  49,  53,  47,  49,  49,  51,  50,  50,  48,  46,  53,
         50,  50,  54,  51,  49,  58,  70,  65,  84,  65,  76,  58,
        122, 121, 103, 111, 116, 101,  95, 104, 111, 115, 116,  95,
        105, 109, 112, 108,  95, 108, 105, 110, 117, 120,  46,  99,
         99,  40,  49,  50,
        ... 1408 more items
      ]
    }

    Node.js v20.16.0
    Error running filter mermaid-filter:
    Filter returned error status 1