codeoverflow-org / nodecg-io

A NodeCG-bundle which implements Social Media API's in the NodeCG framework
https://nodecg.io
MIT License
108 stars 26 forks source link

Fix MIDI services not working in GitHub Actions CI #1030

Closed hlxid closed 10 months ago

hlxid commented 11 months ago

Description

Currently, the CI of nodecg-io is broken because of the MIDI services which cannot start and break the NodeCG integration test as they cannot be loaded successfully. This might be a permission problem in the CI VM or some missing package. Sadly it is not known what GitHub changed since the tests previously run on GitHub Actions, run locally, and only have started failing at some time point.

How to reproduce

Let CI run and view the NodeCG integration test results.

Error Log

``` 2023-10-28 21:12:56 - info: [nodecg-io-midi-input] midi-input bundle started. ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory MidiInAlsa::initialize: error creating ALSA sequencer client object. ```
TimTechDev commented 11 months ago

I would say that the issue is probably caused by the switch by GitHub to the action runner v4. Additionally, there seems to be a new Ubuntu base image.

Here is a diff (with cleanup) over the logs between the change:

run-6133176760 run-6209625847 
1c1
< # Start time 2023-09-09T21:09:49.8807687Z
---
> # Start time 2023-09-22T20:51:55.7951375Z
6,7c6,7
< Job is about to start running on the hosted runner: GitHub Actions 4 (hosted)
< Current runner version: '2.308.0'
---
> Job is about to start running on the hosted runner: GitHub Actions 3 (hosted)
> Current runner version: '2.309.0'
15,17c15,17
< Version: 20230903.1.0
< Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230903.1/images/linux/Ubuntu2204-Readme.md
< Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230903.1
---
> Version: 20230917.1.0
> Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230917.1/images/linux/Ubuntu2204-Readme.md
> Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230917.1
1041d1040
< Get:6 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3611 B]
1044,1057c1043,1057
< Hit:7 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
< Get:8 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [90.4 kB]
< Get:9 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [9243 B]
< Get:10 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [18.9 kB]
< Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [970 kB]
< Get:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [222 kB]
< Get:13 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [15.6 kB]
< Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [838 kB]
< Get:15 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [135 kB]
< Get:16 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [979 kB]
< Get:17 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [213 kB]
< Get:18 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [21.8 kB]
< Get:19 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [761 kB]
< Get:20 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [164 kB]
---
> Get:6 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease [3611 B]
> Get:7 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1012 kB]
> Get:8 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main Translation-en [227 kB]
> Get:9 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 c-n-f Metadata [15.6 kB]
> Get:10 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [898 kB]
> Get:11 http://azure.archive.ubuntu.com/ubuntu jammy-updates/restricted Translation-en [145 kB]
> Get:12 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [984 kB]
> Get:13 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe Translation-en [215 kB]
> Get:14 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 c-n-f Metadata [21.8 kB]
> Get:15 http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [64.3 kB]
> Get:16 http://azure.archive.ubuntu.com/ubuntu jammy-backports/main amd64 c-n-f Metadata [388 B]
> Get:17 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [27.8 kB]
> Get:18 http://azure.archive.ubuntu.com/ubuntu jammy-backports/universe amd64 c-n-f Metadata [640 B]
> Get:19 http://azure.archive.ubuntu.com/ubuntu jammy-security/main amd64 Packages [802 kB]
> Get:20 http://azure.archive.ubuntu.com/ubuntu jammy-security/main Translation-en [169 kB]
1059,1061c1059,1061
< Get:22 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [822 kB]
< Get:23 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [132 kB]
< Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [781 kB]
---
> Get:22 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [882 kB]
> Get:23 http://azure.archive.ubuntu.com/ubuntu jammy-security/restricted Translation-en [142 kB]
> Get:24 http://azure.archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [785 kB]
1064c1064,1068
< Fetched 6686 kB in 2s (4237 kB/s)
---
> Hit:27 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
> Get:28 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main armhf Packages [9463 B]
> Get:29 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main amd64 Packages [102 kB]
> Get:30 https://packages.microsoft.com/ubuntu/22.04/prod jammy/main arm64 Packages [26.5 kB]
> Fetched 7040 kB in 2s (4410 kB/s)
1068c1072
< 40 packages can be upgraded. Run 'apt list --upgradable' to see them.
---
> 42 packages can be upgraded. Run 'apt list --upgradable' to see them.
1078c1082
< 0 upgraded, 4 newly installed, 0 to remove and 40 not upgraded.
---
> 0 upgraded, 4 newly installed, 0 to remove and 42 not upgraded.
1083c1087
< Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libudev-dev amd64 249.11-0ubuntu3.9 [20.7 kB]
---
> Get:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates/main amd64 libudev-dev amd64 249.11-0ubuntu3.10 [20.7 kB]
1086c1090
< Fetched 390 kB in 0s (2351 kB/s)
---
> Fetched 390 kB in 0s (1185 kB/s)
1109c1113
< (Reading database ... 223452 files and directories currently installed.)
---
> (Reading database ... 228578 files and directories currently installed.)
1113,1114c1117,1118
< Preparing to unpack .../libudev-dev_249.11-0ubuntu3.9_amd64.deb ...
< Unpacking libudev-dev:amd64 (249.11-0ubuntu3.9) ...
---
> Preparing to unpack .../libudev-dev_249.11-0ubuntu3.10_amd64.deb ...
> Unpacking libudev-dev:amd64 (249.11-0ubuntu3.10) ...
1123c1127
< Setting up libudev-dev:amd64 (249.11-0ubuntu3.9) ...
---
> Setting up libudev-dev:amd64 (249.11-0ubuntu3.10) ...
1127,1128c1131,1132
< NEEDRESTART-KCUR: 5.15.0-1041-azure
< NEEDRESTART-KEXP: 5.15.0-1041-azure
---
> NEEDRESTART-KCUR: 6.2.0-1011-azure
> NEEDRESTART-KEXP: 6.2.0-1011-azure
1164c1168
< added 1255 packages, and audited 1351 packages in 39s
---
> added 1255 packages, and audited 1351 packages in 34s
1271,1272c1275,1289
< info: [nodecg-io-core] Service midi-input has been registered.
< info: [extensions] Mounted nodecg-io-midi-input extension
---
> ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
> 
> MidiInAlsa::initialize: error creating ALSA sequencer client object.
> 
> warn: [extensions] Failed to mount nodecg-io-midi-input extension:
>  Failed to initialise RtMidi, Error: Failed to initialise RtMidi
>     at new Input (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/node_modules/@julusian/midi/midi.js:14:18)
>     at Object.getInputs (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/node_modules/easymidi/index.js:284:17)
>     at new MidiService (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/services/nodecg-io-midi-input/extension/index.js:12:52)
>     at module.exports (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/services/nodecg-io-midi-input/extension/index.js:7:5)
>     at ExtensionManager._loadExtension (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:4968:31)
>     at new ExtensionManager (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:4915:30)
>     at NodeCGServer.<anonymous> (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:5324:38)
>     at Generator.next (<anonymous>)
>     at fulfilled (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:5045:58)
1274,1275c1291,1305
< info: [nodecg-io-core] Service midi-output has been registered.
< info: [extensions] Mounted nodecg-io-midi-output extension
---
> ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory
> 
> MidiOutAlsa::initialize: error creating ALSA sequencer client object.
> 
> warn: [extensions] Failed to mount nodecg-io-midi-output extension:
>  Failed to initialise RtMidi, Error: Failed to initialise RtMidi
>     at new Output (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/node_modules/@julusian/midi/midi.js:44:19)
>     at Object.getOutputs (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/node_modules/easymidi/index.js:301:18)
>     at new MidiService (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/services/nodecg-io-midi-output/extension/index.js:12:52)
>     at module.exports (/home/runner/work/nodecg-io/nodecg-io/nodecg-io/services/nodecg-io-midi-output/extension/index.js:7:5)
>     at ExtensionManager._loadExtension (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:4968:31)
>     at new ExtensionManager (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:4915:30)
>     at NodeCGServer.<anonymous> (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:5324:38)
>     at Generator.next (<anonymous>)
>     at fulfilled (/home/runner/work/nodecg-io/nodecg-io/build/server/server.js:5045:58)
1403c1433
< info: [nodecg-io-core] Bundle "midi-input" has registered a dependency on the service "midi-input"
---
> warn: [midi-input] The bundle "midi-input" can't require the "midi-input" service: no service with such name.
1406,1407c1436,1437
< info: [nodecg-io-core] Bundle "midi-io" has registered a dependency on the service "midi-input"
< info: [nodecg-io-core] Bundle "midi-io" has registered a dependency on the service "midi-output"
---
> warn: [midi-io] The bundle "midi-io" can't require the "midi-input" service: no service with such name.
> warn: [midi-io] The bundle "midi-io" can't require the "midi-output" service: no service with such name.
1410c1440
< info: [nodecg-io-core] Bundle "midi-output" has registered a dependency on the service "midi-output"
---
> warn: [midi-output] The bundle "midi-output" can't require the "midi-output" service: no service with such name.
1497c1527
< (node:3522) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 76 connection listeners added to [Namespace]. Use emitter.setMaxListeners() to increase limit
---
> (node:3559) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 76 connection listeners added to [Namespace]. Use emitter.setMaxListeners() to increase limit
1503c1533,1546
< No Errors!
---
> Missing Bundles:
> [ 'nodecg-io-midi-input', 'nodecg-io-midi-output' ]
> file:///home/runner/work/nodecg-io/nodecg-io/nodecg-io/.scripts/ci-nodecg-integration.mjs:59
>         throw new Error(`NodeCG did not mount ${missing.length} bundle(s).`);
>         ^
> 
> Error: NodeCG did not mount 2 bundle(s).
>     at ChildProcess.<anonymous> (file:///home/runner/work/nodecg-io/nodecg-io/nodecg-io/.scripts/ci-nodecg-integration.mjs:59:15)
>     at Object.onceWrapper (node:events:629:26)
>     at ChildProcess.emit (node:events:526:35)
>     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
> 
> Node.js v18.17.1
> ##[error]Process completed with exit code 1.
TimTechDev commented 11 months ago

Last successful CI run: https://github.com/codeoverflow-org/nodecg-io/actions/runs/6133176760 First failing run: https://github.com/codeoverflow-org/nodecg-io/actions/runs/6209625847

Also, according to the documentation, the Ubuntu image went from kernel version 5.15.0-1041-azure to 6.2.0-1011-azure

TimTechDev commented 10 months ago

We are missing some Linux kernel modules for audio.

Upstream issue (https://github.com/actions/runner-images/issues/8295)

Possible temporary fixes include:

  1. move to ubuntu-20.04 (#1046)
  2. stay on ubuntu-22.04 & remove midi services & samples in CI (#1047 )
  3. combine both (#1049)
hlxid commented 10 months ago

Thank you very much for your work fixing this. I've tried multiple times but always failed and lost motivation after annoyances and weird behavior.

I'm choosing your solution 3 because having the other bundles/services tested on ubuntu 20.04 doesn't hurt and the increase in CI execution time is not too big because the windows jobs take way longer anyway.