OpenWIS / openwis

http://openwis.github.io/openwis
GNU General Public License v3.0
11 stars 15 forks source link

Travis "deployment issue" #418

Closed abrmh closed 1 year ago

abrmh commented 1 year ago

When trying to deploy Openwis , an issue appears at beginning of deployment

install_jdk Installing openjdk8 0.00s git.checkout 6.64s$ git clone --branch=openwis-3.15.1 https://github.com/OpenWIS/openwis.git OpenWIS/openwis

Setting environment variables from repository settings $ export encrypted_62b1a583e357_key=[secure] $ export encrypted_62b1a583e357_iv=[secure] $ export encrypted_20c662c74536_key=[secure] $ export encrypted_20c662c74536_iv=[secure] Setting environment variables from .travis.yml $ export DEPLOY_HOST=[secure] $ export DEPLOY_USER=[secure] $ export DEPLOY_DIRECTORY=[secure] $ java -Xmx32m -version openjdk version "1.8.0_352" OpenJDK Runtime Environment (build 1.8.0_352-b08) OpenJDK 64-Bit Server VM (build 25.352-b08, mixed mode) $ javac -J-Xmx32m -version javac 1.8.0_352 before_install.1 0.87s$ npm --version before_install.2 0.01s$ node --version before_install.3 0.01s$ nvm --version before_install.4 0.02s$ openssl aes-256-cbc -K $encrypted_62b1a583e357_key -iv $encrypted_62b1a583e357_iv -in resources/travis_copy_artifacts_rsa.enc -out /tmp/travis_copy_artifacts_rsa -d before_install.5 0.01s$ openssl aes-256-cbc -K $encrypted_20c662c74536_key -iv $encrypted_20c662c74536_iv -in resources/github_deploy_key.enc -out /tmp/github_deploy_key -d before_install.6 0.02s$ eval "$(ssh-agent -s)" before_install.7 0.01s$ chmod 600 /tmp/travis_copy_artifacts_rsa /tmp/github_deploy_key before_install.8 0.02s$ ssh-add /tmp/travis_copy_artifacts_rsa before_install.9 0.01s$ ssh-add /tmp/github_deploy_key before_install.10 0.00s$ echo -e "Host ${DEPLOY_HOST}\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config before_install.11 0.00s$ echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config before_install.12 3.59s$ sudo apt-get update before_install.13 4.90s$ sudo apt-get -y install nodejs before_install.14 7.35s$ sudo apt-get -y install npm 0.86s$ npm install -g node@14.20.0 npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! code EEXIST npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/bin/node npm ERR! EEXIST: file already exists npm ERR! File exists: /home/travis/.nvm/versions/node/v16.16.0/bin/node npm ERR! Remove the existing file and try again, or run npm npm ERR! with --force to overwrite files recklessly. npm ERR! A complete log of this run can be found in: npm ERR! /home/travis/.npm/_logs/2023-02-15T18_48_25_600Z-debug-0.log The command "npm install -g node@14.20.0" failed and exited with 1 during . Your build has been stopped.

zhangz555 commented 1 year ago

I will take a look at this and see whether it can be fixed.

zhangz555 commented 1 year ago

After studied the error logs of several builds, I try using --location and --force in the installation. However, after several trials, the platform still sends out error messages, although they are different from the original ones, which are recorded at the beginning of this github issue. Further investigations are needed.

$ npm install --location=global --force node@14.20.0 npm WARN using --force Recommended protections disabled. npm ERR! code 1 npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! added 1 package, removed 263 packages, and audited 2 packages in 3s npm ERR! npm ERR! found 0 vulnerabilities npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:28 npm ERR! throw e; npm ERR! ^ npm ERR! npm ERR! Error: ENOENT: no such file or directory, mkdir '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! at Object.mkdirSync (node:fs:1349:3) npm ERR! at ChildProcess. (/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:25:10) npm ERR! at ChildProcess.emit (node:events:527:28) npm ERR! at maybeClose (node:internal/child_process:1092:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm ERR! errno: -2, npm ERR! syscall: 'mkdir', npm ERR! code: 'ENOENT', npm ERR! path: '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! }

zhangz555 commented 1 year ago

Please note that all these works are performed on branch 3.16, not on master.

zhangz555 commented 1 year ago

Based on the error messages, I made the following changes, but get errors. $ npm install --location=global --force node@16.16.0 npm WARN using --force Recommended protections disabled. npm ERR! code 1 npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! added 1 package, removed 263 packages, and audited 2 packages in 3s npm ERR! npm ERR! found 0 vulnerabilities npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:28 npm ERR! throw e; npm ERR! ^ npm ERR! npm ERR! Error: ENOENT: no such file or directory, mkdir '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! at Object.mkdirSync (node:fs:1349:3) npm ERR! at ChildProcess. (/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:25:10) npm ERR! at ChildProcess.emit (node:events:527:28) npm ERR! at maybeClose (node:internal/child_process:1092:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm ERR! errno: -2, npm ERR! syscall: 'mkdir', npm ERR! code: 'ENOENT', npm ERR! path: '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! }

zhangz555 commented 1 year ago

Based on the errors, further changes are made as follows.

$ sudo mkdir -p /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin $ npm install --location=global --force node@16.16.0 npm WARN using --force Recommended protections disabled. npm ERR! code 1 npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm ERR! code ENOTEMPTY npm ERR! npm ERR! syscall rename npm ERR! npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node npm ERR! npm ERR! dest /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/.node-7iFw1Y3D npm ERR! npm ERR! errno -39 npm ERR! npm ERR! ENOTEMPTY: directory not empty, rename '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node' -> '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/.node-7iFw1Y3D' npm ERR! npm ERR! npm ERR! A complete log of this run can be found in: npm ERR! npm ERR! /home/travis/.npm/_logs/2023-02-21T15_42_23_774Z-debug-0.log npm ERR! node:internal/modules/cjs/loader:936 npm ERR! throw err; npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module 'node-linux-x64/package.json' npm ERR! Require stack: npm ERR! - /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/installArchSpecificPackage.js npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:108:19) npm ERR! at ChildProcess. (/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:19:27) npm ERR! at ChildProcess.emit (node:events:527:28) npm ERR! at maybeClose (node:internal/child_process:1092:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm ERR! code: 'MODULE_NOT_FOUND', npm ERR! requireStack: [ npm ERR! '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/installArchSpecificPackage.js' npm ERR! ] npm ERR! }

zhangz555 commented 1 year ago

After doing investigations online, I changed added more commands as follows, and the results are also listed.

$ sudo rm -rf node_modules $ sudo rm -f package-lock.json $ npm cache clean --force npm WARN using --force Recommended protections disabled. $ npm update $ npm install node-linux-x64 $ sudo mkdir -p /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node $ npm install --location=global --force node@14.20.0 npm WARN using --force Recommended protections disabled. npm ERR! code 1 npm ERR! path /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node npm ERR! command failed npm ERR! command sh -c node installArchSpecificPackage npm ERR! added 1 package, removed 263 packages, and audited 2 packages in 3s npm ERR! npm ERR! found 0 vulnerabilities npm ERR! npm WARN config global --global, --local are deprecated. Use --location=global instead. npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! /home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:28 npm ERR! throw e; npm ERR! ^ npm ERR! npm ERR! Error: ENOENT: no such file or directory, mkdir '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! at Object.mkdirSync (node:fs:1349:3) npm ERR! at ChildProcess. (/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/node_modules/node-bin-setup/index.js:25:10) npm ERR! at ChildProcess.emit (node:events:527:28) npm ERR! at maybeClose (node:internal/child_process:1092:16) npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) { npm ERR! errno: -2, npm ERR! syscall: 'mkdir', npm ERR! code: 'ENOENT', npm ERR! path: '/home/travis/.nvm/versions/node/v16.16.0/lib/node_modules/node/bin' npm ERR! }

zhangz555 commented 1 year ago

It appears that node-linux-x64 related errors and some path related errors have been solved, but new types of errors emerge.

zhangz555 commented 1 year ago

The issue is now fixed. The commands added/changed in the yml are as following. The travis build history from 437 to 451 are records of the entire investigation process.