kompot / nhl-tv-geeky-streams

Best way to download NHL games. NHL.TV, NHL LIVE, or WatchESPN account is required.
MIT License
35 stars 7 forks source link

docker build error after the upgrade to node v20 #72

Closed scuben closed 8 months ago

scuben commented 8 months ago

Hi,

after doing a docker-compose build nhltv --no-cache i get this error on the yarn install step:

 > [nhltv 8/8] RUN yarn install:
0.400 yarn install v1.22.19
0.453 [1/4] Resolving packages...
0.495 [2/4] Fetching packages...
3.601 [3/4] Linking dependencies...
4.296 [4/4] Building fresh packages...
4.443 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
4.443 error /app/node_modules/bufferutil: Command failed.
4.443 Exit code: 1
4.443 Command: node-gyp-build
4.443 Arguments:
4.443 Directory: /app/node_modules/bufferutil
4.443 Output:
4.443 node:events:492
4.443       throw er; // Unhandled 'error' event
4.443       ^
4.443
4.443 Error: spawn node-gyp ENOENT
4.443     at ChildProcess._handle.onexit (node:internal/child_process:286:19)
4.443     at onErrorNT (node:internal/child_process:484:16)
4.443     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
4.443 Emitted 'error' event on ChildProcess instance at:
4.443     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
4.443     at onErrorNT (node:internal/child_process:484:16)
4.443     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
4.443   errno: -2,
4.443   code: 'ENOENT',
4.443   syscall: 'spawn node-gyp',
4.443   path: 'node-gyp',
4.443   spawnargs: [ 'rebuild' ]
4.443 }
4.443
4.443 Node.js v20.5.1
rseanhall commented 8 months ago

Unfortunately, I couldn't reproduce this issue. My host machine is Windows x64.

I upgraded the node-gyp-build package in https://github.com/kompot/nhl-tv-geeky-streams/commit/2e94cc40adfd6ac478f563480cacd721c7894a2d, hopefully that fixes it. If not, then I'll need more information about how to reproduce this.

scuben commented 8 months ago

Very strange, still an error on the yarn install but another one. Might it be because I run macos on a M1? 94b1a702d5e351935e02be15012c57c1a804ee0f still works fine for me.

$ docker-compose build nhltv --no-cache                                                                                                                                                                                                                                                                                                                               

[+] Building 28.7s (12/12) FINISHED                                                                                                                                                                                                                                                                                                                  docker:desktop-linux
 => [nhltv internal] load .dockerignore                                                                                                                                                                                                                                                                                                                              0.0s
 => => transferring context: 47B                                                                                                                                                                                                                                                                                                                                     0.0s
 => [nhltv internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                           0.0s
 => => transferring dockerfile: 387B                                                                                                                                                                                                                                                                                                                                 0.0s
 => [nhltv internal] load metadata for docker.io/library/node:20.8.1-alpine3.18                                                                                                                                                                                                                                                                                      2.3s
 => [nhltv 1/8] FROM docker.io/library/node:20.8.1-alpine3.18@sha256:a369136b6f7640f85acf300ce9d6498d8161972b855a72bbc79273150d4dd0c7                                                                                                                                                                                                                                3.5s
 => => resolve docker.io/library/node:20.8.1-alpine3.18@sha256:a369136b6f7640f85acf300ce9d6498d8161972b855a72bbc79273150d4dd0c7                                                                                                                                                                                                                                      0.0s
 => => sha256:e0480e91326c84bf6e9255abe97e1c40cd8f297cbfd566512dac66667348e23e 1.16kB / 1.16kB                                                                                                                                                                                                                                                                       0.0s
 => => sha256:873e311f040d34a224fbabd5c0e9d63acc4cdc6b2f23422420dcbb4934eb4ea1 6.79kB / 6.79kB                                                                                                                                                                                                                                                                       0.0s
 => => sha256:579b34f0a95bb83b3acd6b3249ddc52c3d80f5c84b13c944e9e324feb86dd329 3.33MB / 3.33MB                                                                                                                                                                                                                                                                       0.3s
 => => sha256:bf57f05130fb68d783ab610966bacf86f3d2559e91a8c27caf3706a2b0661b75 50.03MB / 50.03MB                                                                                                                                                                                                                                                                     1.3s
 => => sha256:021ef6ca3cb96442665d47ccda8c001043789c25b21e66647254002ba1a47d09 2.34MB / 2.34MB                                                                                                                                                                                                                                                                       0.4s
 => => sha256:a369136b6f7640f85acf300ce9d6498d8161972b855a72bbc79273150d4dd0c7 1.43kB / 1.43kB                                                                                                                                                                                                                                                                       0.0s
 => => extracting sha256:579b34f0a95bb83b3acd6b3249ddc52c3d80f5c84b13c944e9e324feb86dd329                                                                                                                                                                                                                                                                            0.1s
 => => sha256:9d2aa4c490e8cda849224915c6b3821b7cf2b3e122bc0de9dbded52ed468792a 451B / 451B                                                                                                                                                                                                                                                                           0.5s
 => => extracting sha256:bf57f05130fb68d783ab610966bacf86f3d2559e91a8c27caf3706a2b0661b75                                                                                                                                                                                                                                                                            1.9s
 => => extracting sha256:021ef6ca3cb96442665d47ccda8c001043789c25b21e66647254002ba1a47d09                                                                                                                                                                                                                                                                            0.0s
 => => extracting sha256:9d2aa4c490e8cda849224915c6b3821b7cf2b3e122bc0de9dbded52ed468792a                                                                                                                                                                                                                                                                            0.0s
 => [nhltv internal] load build context                                                                                                                                                                                                                                                                                                                              0.0s
 => => transferring context: 40.20kB                                                                                                                                                                                                                                                                                                                                 0.0s
 => [nhltv 2/8] RUN apk --no-cache add     build-base     python3     python3-dev     libxml2-dev     libxslt-dev     cmd:pip3     ffmpeg                                                                                                                                                                                                                            7.9s
 => [nhltv 3/8] RUN pip3 install wheel streamlink==6.0.*                                                                                                                                                                                                                                                                                                             9.2s
 => [nhltv 4/8] WORKDIR /app/                                                                                                                                                                                                                                                                                                                                        0.0s
 => [nhltv 5/8] COPY package.json /app/                                                                                                                                                                                                                                                                                                                              0.0s
 => [nhltv 6/8] COPY yarn.lock /app/                                                                                                                                                                                                                                                                                                                                 0.0s
 => [nhltv 7/8] RUN chown -R node:node /app                                                                                                                                                                                                                                                                                                                          0.2s
 => ERROR [nhltv 8/8] RUN yarn install                                                                                                                                                                                                                                                                                                                               5.4s
------
 > [nhltv 8/8] RUN yarn install:
0.486 yarn install v1.22.19
0.537 [1/4] Resolving packages...
0.579 [2/4] Fetching packages...
3.953 [3/4] Linking dependencies...
4.866 [4/4] Building fresh packages...
5.039 error /app/node_modules/utf-8-validate: Command failed.
5.039 Exit code: 1
5.039 Command: node-gyp-build
5.039 Arguments:
5.039 Directory: /app/node_modules/utf-8-validate
5.039 Output:
5.039 node:events:492
5.039       throw er; // Unhandled 'error' event
5.039       ^
5.039
5.039 Error: spawn node-gyp ENOENT
5.039     at ChildProcess._handle.onexit (node:internal/child_process:286:19)
5.039     at onErrorNT (node:internal/child_process:484:16)
5.039     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
5.039 Emitted 'error' event on ChildProcess instance at:
5.039     at ChildProcess._handle.onexit (node:internal/child_process:292:12)
5.039     at onErrorNT (node:internal/child_process:484:16)
5.039     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
5.039   errno: -2,
5.039   code: 'ENOENT',
5.039   syscall: 'spawn node-gyp',
5.039   path: 'node-gyp',
5.039   spawnargs: [ 'rebuild' ]
5.039 }
5.039
5.039 Node.js v20.8.1
5.040 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn install" did not complete successfully: exit code: 1
rseanhall commented 8 months ago

The bufferutil and utf-8-validate appear to be run by the same people because they both have two very similar commits from the same person with the message "Fix build on macOS 10.15 or earlier" that were committed a few days ago (https://github.com/websockets/bufferutil/commit/3af337566915e9b306c671671939c88fb5ee0ee7 and https://github.com/websockets/utf-8-validate/commit/dc7d1ddd79c35d543be4f5f21d94f6928f9f0954). I don't see a new version of the utf-8-validate package, though. I don't know if there's a way to request them to publish a new version. Otherwise, it might be possible to point directly to the github repository and always build from source but I'll need time to look into that.

rseanhall commented 8 months ago

This was fixed in https://github.com/kompot/nhl-tv-geeky-streams/commit/8bc4e4eb0a04beee0e08f1c0f69d1e0e7dd28b01 by switching to a different websocket library.

If you don't mind, I'd like you to try to see if this allows us to revert https://github.com/kompot/nhl-tv-geeky-streams/pull/57.

scuben commented 8 months ago

Hi @rseanhall

Great news! And I could build the image flawlessly with 8bc4e4eb0a04beee0e08f1c0f69d1e0e7dd28b01 and with added RUN apk --no-cache del build-base (reverting #57).