apigee / devrel

Common solutions and tools developed for Apigee
Apache License 2.0
187 stars 160 forks source link

./build.sh -t apigee-sackmesser failing #632

Closed AL1041713 closed 1 year ago

AL1041713 commented 1 year ago

Locally and also through github action I try to run the command Run ./tools/apigee-sackmesser/build.sh -t apigee-sackmesser but I get a failure at the time of running this line from dockerfile Step 3/13 : RUN npm install --global apigeelint@2.10.0 I get this issue "npm ERR! Maximum call stack size exceeded"

Below you can find all the logs i have :

2022-12-15T10:57:29.1976081Z ##[group]Run ./tools/apigee-sackmesser/build.sh -t apigee-sackmesser
2022-12-15T10:57:29.1976732Z ./tools/apigee-sackmesser/build.sh -t apigee-sackmesser
2022-12-15T10:57:29.2033382Z shell: /usr/bin/bash -e {0}
2022-12-15T10:57:29.2033641Z ##[endgroup]
2022-12-15T10:57:29.3596757Z Sending build context to Docker daemon  902.1kB
2022-12-15T10:57:29.3597308Z 
2022-12-15T10:57:29.3641443Z Step 1/13 : FROM maven:3.6-alpine
2022-12-15T10:57:29.9763771Z 3.6-alpine: Pulling from library/maven
2022-12-15T10:57:30.1308069Z e7c96db7181b: Pulling fs layer
2022-12-15T10:57:30.1308467Z f910a506b6cb: Pulling fs layer
2022-12-15T10:57:30.1308776Z c2274a1a0e27: Pulling fs layer
2022-12-15T10:57:30.1309018Z e4ef40f76983: Pulling fs layer
2022-12-15T10:57:30.1309320Z 9d14ff8d6dec: Pulling fs layer
2022-12-15T10:57:30.1309624Z 35df3984e884: Pulling fs layer
2022-12-15T10:57:30.1309913Z b3fdc3f660bf: Pulling fs layer
2022-12-15T10:57:30.1310196Z 9d14ff8d6dec: Waiting
2022-12-15T10:57:30.1310483Z 35df3984e884: Waiting
2022-12-15T10:57:30.1310684Z b3fdc3f660bf: Waiting
2022-12-15T10:57:30.1310886Z e4ef40f76983: Waiting
2022-12-15T10:57:30.3268855Z f910a506b6cb: Download complete
2022-12-15T10:57:30.3711573Z e7c96db7181b: Verifying Checksum
2022-12-15T10:57:30.3716883Z e7c96db7181b: Download complete
2022-12-15T10:57:30.5739842Z e4ef40f76983: Verifying Checksum
2022-12-15T10:57:30.5740150Z e4ef40f76983: Download complete
2022-12-15T10:57:30.5797327Z e7c96db7181b: Pull complete
2022-12-15T10:57:30.7504317Z 9d14ff8d6dec: Verifying Checksum
2022-12-15T10:57:30.7504642Z 9d14ff8d6dec: Download complete
2022-12-15T10:57:30.7554333Z f910a506b6cb: Pull complete
2022-12-15T10:57:30.7718046Z 35df3984e884: Verifying Checksum
2022-12-15T10:57:30.7718326Z 35df3984e884: Download complete
2022-12-15T10:57:30.8922339Z c2274a1a0e27: Verifying Checksum
2022-12-15T10:57:30.8922628Z c2274a1a0e27: Download complete
2022-12-15T10:57:30.9485609Z b3fdc3f660bf: Verifying Checksum
2022-12-15T10:57:30.9485926Z b3fdc3f660bf: Download complete
2022-12-15T10:57:32.1583505Z c2274a1a0e27: Pull complete
2022-12-15T10:57:32.5468634Z e4ef40f76983: Pull complete
2022-12-15T10:57:32.7257055Z 9d14ff8d6dec: Pull complete
2022-12-15T10:57:32.7748717Z 35df3984e884: Pull complete
2022-12-15T10:57:32.8352353Z b3fdc3f660bf: Pull complete
2022-12-15T10:57:32.8388551Z Digest: sha256:16691dc7e18e5311ee7ae38b40dcf98ee1cfe4a487fdd0e57bfef76a0415034a
2022-12-15T10:57:32.8398021Z Status: Downloaded newer image for maven:3.6-alpine
2022-12-15T10:57:32.8409605Z  ---> 7445f83cd169
2022-12-15T10:57:32.8410049Z Step 2/13 : RUN apk add --no-cache   git   jq   libxml2-utils   nodejs   npm   unzip
2022-12-15T10:57:32.8522650Z  ---> Running in 0ab1c2643663
2022-12-15T10:57:33.1010956Z fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
2022-12-15T10:57:33.1917504Z fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
2022-12-15T10:57:33.2589218Z (1/12) Installing expat (2.2.8-r0)
2022-12-15T10:57:33.2713006Z (2/12) Installing pcre2 (10.32-r1)
2022-12-15T10:57:33.2877794Z (3/12) Installing git (2.20.4-r0)
2022-12-15T10:57:33.4521815Z (4/12) Installing oniguruma (6.9.4-r1)
2022-12-15T10:57:33.4674797Z (5/12) Installing jq (1.6-r0)
2022-12-15T10:57:33.4836830Z (6/12) Installing libxml2 (2.9.9-r3)
2022-12-15T10:57:33.5072795Z (7/12) Installing libxml2-utils (2.9.9-r3)
2022-12-15T10:57:33.5190666Z (8/12) Installing c-ares (1.15.0-r0)
2022-12-15T10:57:33.5311696Z (9/12) Installing libuv (1.25.0-r0)
2022-12-15T10:57:33.5449609Z (10/12) Installing nodejs (10.19.0-r0)
2022-12-15T10:57:33.7720067Z (11/12) Installing npm (10.19.0-r0)
2022-12-15T10:57:34.1376147Z (12/12) Installing unzip (6.0-r6)
2022-12-15T10:57:34.1553037Z Executing busybox-1.29.3-r10.trigger
2022-12-15T10:57:34.1653593Z OK: 182 MiB in 79 packages
2022-12-15T10:57:35.6208513Z Removing intermediate container 0ab1c2643663
2022-12-15T10:57:35.6284031Z  ---> c5faf4ff678c
2022-12-15T10:57:35.6292435Z Step 3/13 : RUN npm install --global apigeelint@2.10.0
2022-12-15T10:57:35.6412783Z  ---> Running in cfc7388a6f44
2022-12-15T10:57:38.3649141Z npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
2022-12-15T10:57:44.9753443Z npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
2022-12-15T10:57:47.5531140Z npm WARN deprecated har-validator@5.1.5: this library is no longer supported
2022-12-15T10:57:47.6376220Z 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.
2022-12-15T10:57:51.5267700Z /usr/bin/apigeelint -> /usr/lib/node_modules/apigeelint/cli.js
2022-12-15T10:57:51.6529523Z 
2022-12-15T10:57:51.6530128Z > es5-ext@0.10.62 postinstall /usr/lib/node_modules/apigeelint/node_modules/es5-ext
2022-12-15T10:57:51.6530606Z >  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
2022-12-15T10:57:51.6530798Z 
2022-12-15T10:57:52.3140870Z npm WARN notsup Unsupported engine for chalk@5.2.0: wanted: {"node":"^12.17.0 || ^14.13 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3141462Z npm WARN notsup Not compatible with your version of node/npm: chalk@5.2.0
2022-12-15T10:57:52.3142048Z npm WARN notsup Unsupported engine for eslint@8.29.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3142545Z npm WARN notsup Not compatible with your version of node/npm: eslint@8.29.0
2022-12-15T10:57:52.3143105Z npm WARN notsup Unsupported engine for pdfmake@0.2.6: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3143599Z npm WARN notsup Not compatible with your version of node/npm: pdfmake@0.2.6
2022-12-15T10:57:52.3144195Z npm WARN notsup Unsupported engine for eslint-scope@7.1.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3144714Z npm WARN notsup Not compatible with your version of node/npm: eslint-scope@7.1.1
2022-12-15T10:57:52.3145307Z npm WARN notsup Unsupported engine for @eslint/eslintrc@1.3.3: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3145814Z npm WARN notsup Not compatible with your version of node/npm: @eslint/eslintrc@1.3.3
2022-12-15T10:57:52.3146413Z npm WARN notsup Unsupported engine for eslint-visitor-keys@3.3.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3146968Z npm WARN notsup Not compatible with your version of node/npm: eslint-visitor-keys@3.3.0
2022-12-15T10:57:52.3147642Z npm WARN notsup Unsupported engine for @humanwhocodes/module-importer@1.0.1: wanted: {"node":">=12.22"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3148230Z npm WARN notsup Not compatible with your version of node/npm: @humanwhocodes/module-importer@1.0.1
2022-12-15T10:57:52.3148814Z npm WARN notsup Unsupported engine for espree@9.4.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
2022-12-15T10:57:52.3149229Z npm WARN notsup Not compatible with your version of node/npm: espree@9.4.1
2022-12-15T10:57:52.3149526Z 
2022-12-15T10:57:52.3272594Z npm ERR! Maximum call stack size exceeded
2022-12-15T10:57:52.3534740Z 
2022-12-15T10:57:52.3537080Z npm ERR! A complete log of this run can be found in:
2022-12-15T10:57:52.3537494Z npm ERR!     /root/.npm/_logs/2022-12-15T10_57_52_345Z-debug.log
2022-12-15T10:57:52.5105713Z The command '/bin/sh -c npm install --global apigeelint@2.10.0' returned a non-zero code: 1
2022-12-15T10:57:52.5118665Z 
2022-12-15T10:57:52.5136227Z ##[error]Process completed with exit code 1.
2022-12-15T10:57:52.5199163Z Post job cleanup.
2022-12-15T10:57:52.6479064Z [command]/usr/bin/git version
2022-12-15T10:57:52.6527626Z git version 2.38.2
2022-12-15T10:57:52.6579485Z Temporarily overriding HOME='/home/runner/work/_temp/5af91f4a-81ea-4ec2-94eb-f36559149337' before making global git config changes
2022-12-15T10:57:52.6583079Z Adding repository directory to the temporary git global config as a safe directory
2022-12-15T10:57:52.6589547Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/apif-apigee-apitemplate/apif-apigee-apitemplate
2022-12-15T10:57:52.6629289Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2022-12-15T10:57:52.6666175Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2022-12-15T10:57:52.6884822Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2022-12-15T10:57:52.6908730Z http.https://github.com/.extraheader
2022-12-15T10:57:52.6919879Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2022-12-15T10:57:52.6952564Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2022-12-15T10:57:52.7391180Z Cleaning up orphan processes

Thanks in advance for your help on this.

OmidTahouri commented 1 year ago

I just ran the same command in Cloud Shell and successfully built a new image (Docker version 20.10.21). Is this a reproducable issue or did you only attempt it once?

Please could you also check your Docker version.

AL1041713 commented 1 year ago

I got the same as you do, from Cloud Shell it is working fine, I don't understand what is the difference.

It's totally reproducable, Locally I tried to start from zero, cloning a fresh devrel repo and tried directly to run the cmd ./build.sh -t apigee-sackmesser Running on Mac computer with M1 Pro - Docker version 20.10.20, build 9fdeb9c

I got this

valentinmalard@HEL-DF-JW2X7KVWNM apigee-sackmesser % ./build.sh -t apigee-sackmesser
[+] Building 23.2s (7/14)                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                              0.0s
 => => transferring dockerfile: 37B                                                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                                                 0.0s
 => => transferring context: 34B                                                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/library/maven:3.6-alpine                                                                                                                               0.4s
 => [ 1/10] FROM docker.io/library/maven:3.6-alpine@sha256:16691dc7e18e5311ee7ae38b40dcf98ee1cfe4a487fdd0e57bfef76a0415034a                                                                       0.0s
 => [internal] load build context                                                                                                                                                                 0.0s
 => => transferring context: 8.49kB                                                                                                                                                               0.0s
 => CACHED [ 2/10] RUN apk add --no-cache   git   jq   libxml2-utils   nodejs   npm   unzip                                                                                                       0.0s
 => ERROR [ 3/10] RUN npm install --global apigeelint@2.10.0                                                                                                                                     22.7s
------                                                                                                                                                                                                 
 > [ 3/10] RUN npm install --global apigeelint@2.10.0:                                                                                                                                                 
#6 2.937 npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142                                                                           
#6 14.33 npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead                                                                                                     
#6 17.36 npm WARN deprecated har-validator@5.1.5: this library is no longer supported                                                                                                                  
#6 17.51 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.
#6 22.12 /usr/bin/apigeelint -> /usr/lib/node_modules/apigeelint/cli.js
#6 22.16 
#6 22.16 > es5-ext@0.10.62 postinstall /usr/lib/node_modules/apigeelint/node_modules/es5-ext
#6 22.16 >  node -e "try{require('./_postinstall')}catch(e){}" || exit 0
#6 22.16 
#6 22.56 npm WARN notsup Unsupported engine for chalk@5.2.0: wanted: {"node":"^12.17.0 || ^14.13 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: chalk@5.2.0
#6 22.56 npm WARN notsup Unsupported engine for eslint@8.30.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: eslint@8.30.0
#6 22.56 npm WARN notsup Unsupported engine for pdfmake@0.2.7: wanted: {"node":">=12"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: pdfmake@0.2.7
#6 22.56 npm WARN notsup Unsupported engine for eslint-scope@7.1.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: eslint-scope@7.1.1
#6 22.56 npm WARN notsup Unsupported engine for @humanwhocodes/module-importer@1.0.1: wanted: {"node":">=12.22"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: @humanwhocodes/module-importer@1.0.1
#6 22.56 npm WARN notsup Unsupported engine for eslint-visitor-keys@3.3.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: eslint-visitor-keys@3.3.0
#6 22.56 npm WARN notsup Unsupported engine for @eslint/eslintrc@1.4.0: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: @eslint/eslintrc@1.4.0
#6 22.56 npm WARN notsup Unsupported engine for espree@9.4.1: wanted: {"node":"^12.22.0 || ^14.17.0 || >=16.0.0"} (current: {"node":"10.19.0","npm":"6.13.4"})
#6 22.56 npm WARN notsup Not compatible with your version of node/npm: espree@9.4.1
#6 22.56 
#6 22.57 npm ERR! Maximum call stack size exceeded
#6 22.58 
#6 22.58 npm ERR! A complete log of this run can be found in:
#6 22.58 npm ERR!     /root/.npm/_logs/2022-12-20T10_03_29_598Z-debug.log

And it's also reproducable on Github Workflow running on : Docker version 20.10.21+azure-2, build baeda1f82a10204ec5708d5fbba130ad76cfee49

danistrebel commented 1 year ago

Hi @AL1041713, I thanks for the report. I am not able to reporduce it on my end but I bumped the Dockerfile with the latest versions to get rid of the npm issues.

I'd be curious if the Dockerfile in here https://github.com/apigee/devrel/pull/633/files would solve your issue that you see. If you're willing to try this locally with the updated Dockerfile, please let us know if it changes anything.

AL1041713 commented 1 year ago

Yes it is 🥇 once pulled the new repo version it worked locally valentinmalard@HEL-DF-JW2X7KVWNM apigee-sackmesser % ./build.sh -t apigee-sackmesser

[+] Building 28.5s (14/14) FINISHED                                                                                                                                                                    
 => [internal] load build definition from Dockerfile                                                                                                                                              0.0s
 => => transferring dockerfile: 1.31kB                                                                                                                                                            0.0s
 => [internal] load .dockerignore                                                                                                                                                                 0.0s
 => => transferring context: 34B                                                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/library/alpine:3.17                                                                                                                                    2.2s
 => [1/9] FROM docker.io/library/alpine:3.17@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                                                                              0.4s
 => => resolve docker.io/library/alpine:3.17@sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4                                                                              0.0s
 => => sha256:8914eb54f968791faf6a8638949e480fef81e697984fba772b3976835194c6d4 1.64kB / 1.64kB                                                                                                    0.0s
 => => sha256:af06af3514c44a964d3b905b498cf6493db8f1cde7c10e078213a89c87308ba0 528B / 528B                                                                                                        0.0s
 => => sha256:d3156fec8bcbc7b491a4edc271a7734dcfa186fc73282d4e120eeaaf2ce95c43 1.49kB / 1.49kB                                                                                                    0.0s
 => => sha256:261da4162673b93e5c0e7700a3718d40bcc086dbf24b1ec9b54bca0b82300626 3.26MB / 3.26MB                                                                                                    0.3s
 => => extracting sha256:261da4162673b93e5c0e7700a3718d40bcc086dbf24b1ec9b54bca0b82300626                                                                                                         0.1s
 => [internal] load build context                                                                                                                                                                 0.0s
 => => transferring context: 6.37kB                                                                                                                                                               0.0s
 => [2/9] RUN apk add --no-cache   bash   curl   maven   openjdk17   git   jq   libxml2-utils   nodejs   npm   unzip                                                                              7.7s
 => [3/9] RUN npm install --global apigeelint@2.10.0                                                                                                                                             14.2s 
 => [4/9] COPY tools/apigee-sackmesser /opt/devrel/tools/apigee-sackmesser                                                                                                                        0.0s 
 => [5/9] RUN mkdir /opt/apigee                                                                                                                                                                   0.2s 
 => [6/9] RUN addgroup -S apigee && adduser -S apigee -G apigee &&   chown -R apigee /opt/devrel && chown -R apigee /opt/apigee                                                                   0.2s 
 => [7/9] WORKDIR /opt/devrel/tools/apigee-sackmesser                                                                                                                                             0.0s 
 => [8/9] RUN mvn clean -f ./cmd/deploy/pom-hybrid.xml &&   mvn clean -f ./cmd/deploy/pom-edge.xml                                                                                                2.7s 
 => [9/9] WORKDIR /opt/apigee                                                                                                                                                                     0.0s
 => exporting to image                                                                                                                                                                            0.8s
 => => exporting layers                                                                                                                                                                           0.8s
 => => writing image sha256:9c497b9155b7061c509d39014f30c6ad80776740aa9424b4d8ad39dac2e97d40                                                                                                      0.0s 
 => => naming to docker.io/library/apigee-sackmesser                                                                                                                                              0.0s 

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
valentinmalard@HEL-DF-JW2X7KVWNM apigee-sackmesser % 

And also on the github runner 💯 (Not copying the full logs, too much ^^)

---> 675b719bd1ca
Successfully built 675b719bd1ca
Successfully tagged apigee-sackmesser:latest

You good guys thanks a lot 👍

danistrebel commented 1 year ago

Thanks a lot for checking. We'll merge the PR soon.

danistrebel commented 1 year ago

never mind.. already merged 😄