infiniband-radar / infiniband-radar-web

Monitoring and visualization of InfiniBand Fabrics
GNU General Public License v3.0
19 stars 6 forks source link

Node.js/npm error when building the client service #31

Open URZ-HD opened 2 years ago

URZ-HD commented 2 years ago

Hi, after a while i have to build a new container of the ibradar tools on our system. But this time the client service does not build successfully. It looks like an issue with a updated npm or ssl version ?

I'm building with docker-compose build --force-rm --no-cache to ignore local caches, etc

Building client
Step 1/16 : FROM node:alpine as builder
 ---> 9e17f47b0a78
Step 2/16 : RUN apk add --no-cache git
 ---> Running in 9d357018c19f
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/x86_64/APKINDEX.tar.gz
(1/7) Installing ca-certificates (20191127-r5)
(2/7) Installing brotli-libs (1.0.9-r5)
(3/7) Installing nghttp2-libs (1.43.0-r0)
(4/7) Installing libcurl (7.79.1-r0)
(5/7) Installing expat (2.4.1-r0)
(6/7) Installing pcre2 (10.36-r0)
(7/7) Installing git (2.32.0-r0)
Executing busybox-1.33.1-r6.trigger
Executing ca-certificates-20191127-r5.trigger
OK: 21 MiB in 23 packages
Removing intermediate container 9d357018c19f
 ---> 7ef4e6fc0e57
Step 3/16 : WORKDIR /app/client/
 ---> Running in 2612cd68ced4
Removing intermediate container 2612cd68ced4
 ---> 507658f8407e
Step 4/16 : COPY client/package.json client/package-lock.json /app/client/
 ---> 613feba56afb
Step 5/16 : COPY .git /app/
 ---> e227e42a6d19
Step 6/16 : RUN cd /app/client && npm set progress=false && npm install
 ---> Running in d64271bccc8f
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,                                                                                                     
npm WARN old lockfile so supplemental metadata must be fetched from the registry.                                                                                                            
npm WARN old lockfile                                                                                                                                                                        
npm WARN old lockfile This is a one-time fix-up, please be patient...                                                                                                                        
npm WARN old lockfile                                                                                                                                                                        
npm WARN old lockfile fork-ts-checker-webpack-plugin-v5: No matching version found for fork-ts-checker-webpack-plugin-v5@5.1.0.                                                              
npm WARN old lockfile     at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:209:23)                                                                 
npm WARN old lockfile     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26                                                                                      
npm WARN old lockfile     at async Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:741:9)                                  
npm WARN old lockfile  Could not fetch metadata for fork-ts-checker-webpack-plugin-v5@5.1.0 fork-ts-checker-webpack-plugin-v5: No matching version found for fork-ts-checker-webpack-plugin-v5@5.1.0.                                                                                                                                                                                     
npm WARN old lockfile     at module.exports (/usr/local/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:209:23)                                                                 
npm WARN old lockfile     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:26                                                                                      
npm WARN old lockfile     at async Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:741:9) {                                
npm WARN old lockfile   code: 'ETARGET',                                                                                                                                                     
npm WARN old lockfile   type: 'version',                                                                                                                                                     
npm WARN old lockfile   wanted: '5.1.0',                                                                                                                                                     
npm WARN old lockfile   versions: [ '0.0.1-security' ],                                                                                                                                      
npm WARN old lockfile   distTags: { latest: '0.0.1-security' },                                                                                                                              
npm WARN old lockfile   defaultTag: 'latest'                                                                                                                                                 
npm WARN old lockfile }                                                                                                                                                                      
npm WARN old lockfile Error: Integrity checksum failed when using sha512: wanted sha512-ciWfzNefqWlmzKznCWY9hl+fPP4KlQ0A9MtHbJ/8DpyY+dAM8gDrjufIdxwTgC4szE4EZC3A6ip/BbrqM84GqA== but got sha512-A7QfSdpJ5aSJeqrENJ8a6LtLqAmQMkj68rnB9npI3Mq7ZPLJTAa2lhj0qLEo7TUJsuiLJqWBWBjAff1MgS2wCQ==.                                                                                                 
npm WARN old lockfile     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:145:39                                                                                      
npm WARN old lockfile     at async Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:741:9)                                  
npm WARN old lockfile  Could not fetch metadata for vue-loader-v16@16.0.0-beta.5 Error: Integrity checksum failed when using sha512: wanted sha512-ciWfzNefqWlmzKznCWY9hl+fPP4KlQ0A9MtHbJ/8DpyY+dAM8gDrjufIdxwTgC4szE4EZC3A6ip/BbrqM84GqA== but got sha512-A7QfSdpJ5aSJeqrENJ8a6LtLqAmQMkj68rnB9npI3Mq7ZPLJTAa2lhj0qLEo7TUJsuiLJqWBWBjAff1MgS2wCQ==.                                      
npm WARN old lockfile     at /usr/local/lib/node_modules/npm/node_modules/pacote/lib/registry.js:145:39                                                                                      
npm WARN old lockfile     at async Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:741:9) {                                
npm WARN old lockfile   code: 'EINTEGRITY'                                                                                                                                                   
npm WARN old lockfile }                                                                                                                                                                      
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated                                                                                                         
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.                                                                                                                                                               
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated                                                                                                      
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.                                                        
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142                                                                          
npm WARN deprecated har-validator@5.1.5: this library is no longer supported                                                                                                                 
npm WARN deprecated html-webpack-plugin@3.2.0: 3.x is no longer supported                                                                                                                    
npm WARN deprecated circular-json@0.5.9: CircularJSON is in maintenance only, flatted is its successor.                                                                                      
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.                                                                                                 
npm WARN deprecated @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!                                                                                                                                                                             
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained                                                                              
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained                                                                            
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'                                                                                                             
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained                                                                              
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.                                                                    
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.                                                                    
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)                                                                                                                                  
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'                                                                                                                            
npm WARN deprecated highlight.js@9.18.3: Version no longer supported. Upgrade to @latest                                                                                                     

added 1161 packages, and audited 1162 packages in 37s

59 packages are looking for funding
  run `npm fund` for details

45 vulnerabilities (24 moderate, 21 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
npm notice 
npm notice New patch version of npm available! 8.1.2 -> 8.1.4                                                                                                                                
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v8.1.4>                                                                                                                       
npm notice Run `npm install -g npm@8.1.4` to update!                                                                                                                                         
npm notice                                                                                                                                                                                   
Removing intermediate container d64271bccc8f
 ---> d95b2f7e313a
Step 7/16 : COPY common/ /app/common
 ---> dd0f05613a4b
Step 8/16 : RUN cd /app/common/3dparty/vis && npm install
 ---> Running in 44b2ac339baa
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,                                                                                                     
npm WARN old lockfile so supplemental metadata must be fetched from the registry.                                                                                                            
npm WARN old lockfile                                                                                                                                                                        
npm WARN old lockfile This is a one-time fix-up, please be patient...                                                                                                                        
npm WARN old lockfile                                                                                                                                                                        
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated                                                                                                         
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated                                                                                                      
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.                                                        
npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.                                                                                     
npm WARN deprecated uuid@3.3.2: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.                                                                                                                                                               
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.                                     
npm WARN deprecated mixin-deep@1.3.1: Critical bug fixed in v2.0.1, please upgrade to the latest version.                                                                                    
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue                                                                                             
npm WARN deprecated har-validator@5.1.3: this library is no longer supported                                                                                                                 
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5                                      
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142                                                                          
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)            
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3                                                                                                         
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.                                                                                      
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!                           
npm WARN deprecated babel-eslint@7.2.3: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.                                                               
npm WARN deprecated chokidar@1.7.0: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.                                                                    
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.                                                                                     
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js                                                        
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue                                                                                 
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js                                                         
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue                                                                                 
npm WARN deprecated buffer@4.9.1: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer                                                                                
npm WARN deprecated core-js@2.6.5: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.                                         

added 704 packages, and audited 705 packages in 18s

49 vulnerabilities (4 low, 15 moderate, 17 high, 13 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
Removing intermediate container 44b2ac339baa
 ---> e0d0347e8e64
Step 9/16 : COPY client/ /app/client
 ---> 093cb46f47fa
Step 10/16 : RUN cd /app/client && npm run build
 ---> Running in ea4aa162dbd5

> infiniband-radar-client@2.4.6 build
> vue-cli-service build

-  Building for production...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/app/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/app/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/app/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /app/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /app/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /app/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /app/client/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at runSyncOrAsync (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:130:11)
    at iterateNormalLoaders (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:232:2)
    at Array.<anonymous> (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/app/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /app/client/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
/app/client/node_modules/loader-runner/lib/LoaderRunner.js:114
                        throw e;
                        ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at module.exports (/app/client/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/app/client/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/app/client/node_modules/webpack/lib/NormalModule.js:471:10)
    at /app/client/node_modules/webpack/lib/NormalModule.js:503:5
    at /app/client/node_modules/webpack/lib/NormalModule.js:358:12
    at /app/client/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at iterateNormalLoaders (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:221:10)
    at /app/client/node_modules/loader-runner/lib/LoaderRunner.js:236:3
    at context.callback (/app/client/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
    at /app/client/node_modules/cache-loader/dist/index.js:147:7
    at /app/client/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (node:fs:188:23) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.1.0
Removing intermediate container ea4aa162dbd5
ERROR: Service 'client' failed to build: The command '/bin/sh -c cd /app/client && npm run build' returned a non-zero code: 1

We have not changed anything in our config or environment. the used docker-compose.yml looks like:

version: "3.5"
services:
  gateway:
[...]
 client:
    image: 127.0.0.1:5000/ibradar_client
    build:
      context: .
      dockerfile: Dockerfile-client
    restart: unless-stopped
    expose:
      - "80"
    logging:
      driver: json-file
      options:
        max-size: "200k"
        max-file: "5"
    networks:
      - ibradar-net
  [...]

Is this a known problem ?

best, Sven

URZ-HD commented 2 years ago

Hm, it looks like an problem between updated node.js and webpack: https://stackoverflow.com/questions/69665222/node-17-0-1-causes-some-error-digital-envelope-routinesunsupported

Adding export NODE_OPTIONS=--openssl-legacy-provider in client/package.json solves the issue for me. But I think this might be not the best solution ?

carstenpatzke commented 2 years ago

I need to update all packages to solve this issue. The main problem is, that Node 17 is used as the new stable version and does not support OpenSSL legancy providers by default.

https://github.com/infiniband-radar/infiniband-radar-web/blob/3c9e64c92abc48b7bcc658f441cb19bc52044e1a/Dockerfile-client#L2 https://github.com/infiniband-radar/infiniband-radar-web/blob/3c9e64c92abc48b7bcc658f441cb19bc52044e1a/Dockerfile-client#L19

The server on the other hand uses a fixed node version https://github.com/infiniband-radar/infiniband-radar-web/blob/3c9e64c92abc48b7bcc658f441cb19bc52044e1a/Dockerfile-server#L1