Our Azure build pipeline started failing today. This was working fine with the same code a few days back. I'm struggling to find a reason. The build works fine in my local machine but doesn’t work on DevOps.
Below are some lines from the error log. Can anyone guide me to find the issue please?
Start of the error in the logs:
2021-12-04T09:08:08.1234486Z 6728 timing metavuln:packument:sass-loader Completed in 28ms
2021-12-04T09:08:08.1234976Z 6729 timing metavuln:load:security-advisory:sass-loader:sKa4m2v9CoUt2NE/HFdn2iHPGTVRUKpbo4oLNnOVBTLyHGQ/KmGqhFuwUlvkR/owQNQEXwZFOGQt5TNCCkoHWw== Completed in 5ms
2021-12-04T09:08:08.1235699Z 6730 timing metavuln:cache:put:security-advisory:sass-loader:0+Q0+uaac9NG7L1nbkGVbvFbaBvbLzENFqRpXWUE7U0t2jjSSjVZ79o6UtQRkcjQ/gcgS0kd8p2vAnNjva/3Eg== Completed in 15ms
2021-12-04T09:08:08.1236341Z 6731 timing metavuln:calculate:security-advisory:sass-loader:sKa4m2v9CoUt2NE/HFdn2iHPGTVRUKpbo4oLNnOVBTLyHGQ/KmGqhFuwUlvkR/owQNQEXwZFOGQt5TNCCkoHWw== Completed in 48ms
2021-12-04T09:08:08.1237034Z 6732 timing metavuln:cache:get:security-advisory:imagemin-jpegtran:s0MaKyyWWIoVMQAlu89TduB0lW+w9ANmAjDodgTT4fcy4ki3FsHrWalCv/COtdz4o3adGXtGYSamW2jub7ta+Q== Completed in 1ms
2021-12-04T09:08:08.1237558Z 6733 info run node-sass#4.14.1 postinstall { code: 1, signal: null }
2021-12-04T09:08:08.1238006Z 6734 http fetch GET 200 https://registry.npmjs.org/imagemin-jpegtran 5491ms (cache miss)
2021-12-04T09:08:08.1238399Z 6735 timing metavuln:packument:imagemin-jpegtran Completed in 5491ms
2021-12-04T09:08:08.1238952Z 6736 timing metavuln:load:security-advisory:imagemin-jpegtran:u6oOqPrIyXrFjQnhqewixjKDTSD2uoKmmWFnU4zRuXrk8rdHkm8zODnNe7xy3697n8Yy/cBLgdQBE6mFa/kxsg== Completed in 1ms
2021-12-04T09:08:08.1239443Z 6737 timing reify:rollback:createSparse Completed in 5296ms
2021-12-04T09:08:08.1239823Z 6738 timing reify:rollback:retireShallow Completed in 0ms
2021-12-04T09:08:08.1240144Z 6739 timing command:install Completed in 77131ms
2021-12-04T09:08:08.1240444Z 6740 verbose stack Error: command failed
2021-12-04T09:08:08.1240974Z 6740 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\#npmcli\promise-spawn\index.js:64:27)
2021-12-04T09:08:08.1241517Z 6740 verbose stack at ChildProcess.emit (node:events:390:28)
2021-12-04T09:08:08.1241956Z 6740 verbose stack at maybeClose (node:internal/child_process:1064:16)
2021-12-04T09:08:08.1242405Z 6740 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
2021-12-04T09:08:08.1242817Z 6741 verbose pkgid node-sass#4.14.1
2021-12-04T09:08:08.1243073Z 6742 verbose cwd D:\a\1\s
2021-12-04T09:08:08.1243323Z 6743 verbose Windows_NT 10.0.17763
2021-12-04T09:08:08.1243767Z 6744 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2021-12-04T09:08:08.1244152Z 6745 verbose node v16.13.0
2021-12-04T09:08:08.1244424Z 6746 verbose npm v8.1.0
2021-12-04T09:08:08.1244643Z 6747 error code 1
2021-12-04T09:08:08.1244930Z 6748 error path D:\a\1\s\node_modules\gulp-sass\node_modules\node-sass
2021-12-04T09:08:08.1245270Z 6749 error command failed
2021-12-04T09:08:08.1245577Z 6750 error command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
2021-12-04T09:08:08.1246161Z 6751 error Building: C:\Program Files\nodejs\node.exe D:\a\1\s\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
2021-12-04T09:08:08.1246648Z 6752 error gyp info it worked if it ends with ok
Last few lines of the log:
2021-12-04T09:08:08.1681219Z 6752 error gyp verb node dev dir C:\Users\VssAdministrator\.node-gyp\16.13.0
2021-12-04T09:08:08.1681621Z 6752 error gyp verb found first Solution file build/binding.sln
2021-12-04T09:08:08.1682050Z 6752 error gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
2021-12-04T09:08:08.1682559Z 6752 error gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
2021-12-04T09:08:08.1682993Z 6752 error gyp info spawn args [
2021-12-04T09:08:08.1683269Z 6752 error gyp info spawn args 'build/binding.sln',
2021-12-04T09:08:08.1683573Z 6752 error gyp info spawn args '/nologo',
2021-12-04T09:08:08.1683893Z 6752 error gyp info spawn args '/p:Configuration=Release;Platform=x64'
2021-12-04T09:08:08.1684205Z 6752 error gyp info spawn args ]
2021-12-04T09:08:08.1684463Z 6752 error gyp ERR! UNCAUGHT EXCEPTION
2021-12-04T09:08:08.1684876Z 6752 error gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\MSBuild.exe ENOENT
2021-12-04T09:08:08.1685424Z 6752 error gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
2021-12-04T09:08:08.1685894Z 6752 error gyp ERR! stack at onErrorNT (node:internal/child_process:477:16)
2021-12-04T09:08:08.1686366Z 6752 error gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
2021-12-04T09:08:08.1686766Z 6752 error gyp ERR! System Windows_NT 10.0.17763
2021-12-04T09:08:08.1687321Z 6752 error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\a\\1\\s\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
2021-12-04T09:08:08.1687915Z 6752 error gyp ERR! cwd D:\a\1\s\node_modules\gulp-sass\node_modules\node-sass
2021-12-04T09:08:08.1688248Z 6752 error gyp ERR! node -v v16.13.0
2021-12-04T09:08:08.1688513Z 6752 error gyp ERR! node-gyp -v v3.8.0
2021-12-04T09:08:08.1688788Z 6752 error gyp ERR! This is a bug in `node-gyp`.
2021-12-04T09:08:08.1689164Z 6752 error gyp ERR! Try to update node-gyp and file an Issue if it does not help:
2021-12-04T09:08:08.1689568Z 6752 error gyp ERR! <https://github.com/nodejs/node-gyp/issues>
2021-12-04T09:08:08.1689916Z 6752 error Build failed with error code: 7
2021-12-04T09:08:08.1690179Z 6753 verbose exit 1
2021-12-04T09:08:08.1690283Z
2021-12-04T09:08:08.1720104Z ##[error]Error: Npm failed with return code: 1
2021-12-04T09:08:08.1747833Z ##[section]Finishing: Npm
Below is the yaml file
name: 1.0.$(BuildID)-$(SourceBranchName)
trigger:
- release
variables:
versionNumber: '1.0.$(BuildID)'
mvcSolution: 'SVHA.MVC.Web.sln'
jobs:
- job: "BuildStaging"
variables:
buildConfiguration: 'Staging'
buildPlatform: 'Any CPU'
pool:
vmImage: 'windows-latest'
steps:
- task: Npm#1
inputs:
command: 'install'
workingDir: './'
- task: CmdLine#2
inputs:
script: 'npm run apps-build'
workingDirectory: './'
- task: Gulp#1
inputs:
gulpFile: 'gulpfile.js'
targets: 'build'
arguments: '--production'
enableCodeCoverage: false
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(mvcSolution)'
- task: VSBuild#1
inputs:
solution: '$(mvcSolution)'
msbuildArgs: '/t:Rebuild /p:Configuration=Staging;DeployOnBuild=true;DeployTarget=Package;AutoParameterizationWebConfigConnectionStrings=False;_PackageTempDir="$(Build.BinariesDirectory)\mvc"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: CopyFiles#2
inputs:
SourceFolder: 'src\SVHA.Web\Config\staging'
Contents: 'connectionStrings.config'
TargetFolder: '$(Build.BinariesDirectory)\mvc\Config'
OverWrite: true
- task: ArchiveFiles#2
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)\mvc'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)\mvc.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts#1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'staging'
publishLocation: 'Container'
Remove node-sass and install sass instead.
Long story short, I am deploying a django app to app engine. The build process appears to install many packages and then errors out, like so.
Edit. This is the (redacted) build log. The command line output of gcloud app deploy is located below.
(((redacted, everything up to this point builds successfully)))
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmp1IKuwt/env /tmp/tmpDGYffm/wheel/aldryn_apphooks_config-0.5.3-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/aldryn_apphooks_config-0.5.3-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: aldryn-apphooks-config
Step #1 - "builder": Successfully installed aldryn-apphooks-config-0.5.3
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmpwuKmD2/env /tmp/tmpDGYffm/wheel/cryptography-2.8-cp34-abi3-manylinux2010_x86_64.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/cryptography-2.8-cp34-abi3-manylinux2010_x86_64.whl
Step #1 - "builder": Installing collected packages: cryptography
Step #1 - "builder": Successfully installed cryptography-2.8
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmp85xugM/env /tmp/tmpDGYffm/wheel/gunicorn-20.0.4-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/gunicorn-20.0.4-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: gunicorn
Step #1 - "builder": Successfully installed gunicorn-20.0.4
Step #1 - "builder":
Step #1 - "builder": INFO `pip_install_from_wheels` had stderr output:
Step #1 - "builder": WARNING: The script gunicorn is installed in '/tmp/tmp85xugM/env/bin' which is not on PATH.
Step #1 - "builder": Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmpwrJu3c/env /tmp/tmpDGYffm/wheel/pycparser-2.19-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/pycparser-2.19-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: pycparser
Step #1 - "builder": Successfully installed pycparser-2.19
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmpnObJ5s/env /tmp/tmpDGYffm/wheel/queuelib-1.5.0-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/queuelib-1.5.0-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: queuelib
Step #1 - "builder": Successfully installed queuelib-1.5.0
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmpPvXJiN/env /tmp/tmpDGYffm/wheel/tzlocal-2.0.0-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/tzlocal-2.0.0-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: tzlocal
Step #1 - "builder": Successfully installed tzlocal-2.0.0
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmpVNLN0Z/env /tmp/tmpDGYffm/wheel/pip-20.1-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder": Processing /tmp/tmpDGYffm/wheel/pip-20.1-py2.py3-none-any.whl
Step #1 - "builder": Installing collected packages: pip
Step #1 - "builder": Found existing installation: pip 19.2.3
Step #1 - "builder": Uninstalling pip-19.2.3:
Step #1 - "builder": Successfully uninstalled pip-19.2.3
Step #1 - "builder": Successfully installed pip-20.1
Step #1 - "builder":
Step #1 - "builder": INFO pip_install_from_wheels took 1 seconds
Step #1 - "builder": INFO starting: pip_install_from_wheels
Step #1 - "builder": INFO pip_install_from_wheels /env/bin/python3.7 -m pip install --no-deps --prefix /tmp/tmptNKyMq/env /tmp/tmpDGYffm/wheel/pyasn1-0.4.8-py2.py3-none-any.whl --disable-pip-version-check
Step #1 - "builder": INFO `pip_install_from_wheels` stdout:
Step #1 - "builder":
Step #1 - "builder": INFO `pip_install_from_wheels` had stderr output:
Step #1 - "builder": /env/bin/python3.7: No module named pip
Step #1 - "builder":
Step #1 - "builder": ERROR error: `pip_install_from_wheels` returned code: 1
Step #1 - "builder": INFO pip_install_from_wheels took 0 seconds
Step #1 - "builder": INFO build process for FTL image took 45 seconds
Step #1 - "builder": INFO full build took 45 seconds
Step #1 - "builder": ERROR `pip_install_from_wheels` had stderr output:
Step #1 - "builder": /env/bin/python3.7: No module named pip
Step #1 - "builder":
Step #1 - "builder": error: `pip_install_from_wheels` returned code: 1
Step #1 - "builder": Traceback (most recent call last):
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
Step #1 - "builder": "__main__", fname, loader, pkg_name)
Step #1 - "builder": File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
Step #1 - "builder": exec code in run_globals
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__.py", line 65, in <module>
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__.py", line 60, in main
Step #1 - "builder": File "/usr/local/bin/ftl.par/__main__/ftl/common/ftl_error.py", line 77, in InternalErrorHandler
Step #1 - "builder": IOError: [Errno 2] No such file or directory: '""/output'
Finished Step #1 - "builder"
ERROR
ERROR: build step 1 "gcr.io/gae-runtimes/python37_app_builder:python37_20200405_3_7_7_RC00" failed: step exited with non-zero status: 1
As you can see, this is very perplexing. /env/bin/python3.7: No module named pip? seems like a problem in the app engine build process.
Here is the output of the command gcloud app deploy.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 168573b7-17ed-4bb8-a92d-8cdf7b9ca751 status: FAILURE. Build error details: {
{
"error": {
"errorType": "BuildError",
"canonicalCode": "INVALID_ARGUMENT",
"errorId": "D2E1945E",
"errorMessage": "14 May 2020 04:28:03 INFO Arguments: ['--parser_script=/usr/local/bin/ftl.par', '--src=', '--entrypoint=', '--name=us.gcr.io/gae-cms-277200/app-engine-tmp/app/ttl-2h:b073c253-b4db-4dbf-afef-0bd8a2ac8ccc', '--directory=/workspace', '--destination=/srv', '--cache-repository=us.gcr.io/gae-cms-277200/app-engine-tmp/build-cache/ttl-7d', '--cache', '--builder-output-path=\"\"', '--additional-directory=/.googleconfig', '--python-cmd=/opt/python3.7/bin/python3.7', '--pip-cmd=/env/bin/python3.7 -m pip', '--venv-cmd=/opt/python3.7/bin/python3.7 -m venv /env', '-v=DEBUG', '--base=us.gcr.io/gae-runtimes/python37:python37_20200405_3_7_7_RC00']\n14 May 2020 04:28:03 INFO Unparsed arguments: ['--name=us.gcr.io/gae-cms-277200/app-engine-tmp/app/ttl-2h:b073c253-b4db-4dbf-afef-0bd8a2ac8ccc', '--directory=/workspace', '--destination=/srv', '--cache-repository=us.gcr.io/gae-cms-277200/app-engine-tmp/build-cache/ttl-7d', '--cache', '--builder-output-path=\"\"', '--additional-directory=/.googleconfig', '--python-cmd=/opt/python3.7/bin/python3.7', '--pip-cmd=/env/bin/python3.7 -m pip', '--venv-cmd=/opt/python3.7/bin/python3.7 -m venv /env', '-v=DEBUG', '--base=us.gcr.io/gae-runtimes/python37:python37_20200405_3_7_7_RC00']\n14 May 2020 04:28:03 INFO Executing ['/usr/local/bin/ftl.par', '--name=us.gcr.io/gae-cms-277200/app-engine-tmp/app/ttl-2h:b073c253-b4db-4dbf-afef-0bd8a2ac8ccc', '--directory=/workspace', '--destination=/srv', '--cache-repository=us.gcr.io/gae-cms-277200/app-engine-tmp/build-cache/ttl-7d', '--cache', '--builder-output-path=\"\"', '--additional-directory=/.googleconfig', '--python-cmd=/opt/python3.7/bin/python3.7', '--pip-cmd=/env/bin/python3.7 -m pip', '--venv-cmd=/opt/python3.7/bin/python3.7 -m venv /env', '-v=DEBUG', '--base=us.gcr.io/gae-runtimes/python37:python37_20200405_3_7_7_RC00']\nINFO FTL version python-v0.17.0\nINFO Beginning FTL build for python\nINFO FTL arg passed: virtualenv_dir /env\nINFO FTL arg passed: ttl 168\nINFO FTL arg passed: python_cmd /opt/python3.7/bin/python3.7\nINFO FTL arg passed: cache True\nINFO FTL arg passed: virtualenv_cmd virtualenv\nINFO FTL arg passed: entrypoint None\nINFO FTL arg passed: exposed_ports None\nINFO FTL arg passed: pip_cmd /env/bin/python3.7 -m pip\nINFO FTL arg passed: tar_base_image_path None\nINFO FTL arg passed: export_cache_stats False\nINFO FTL arg passed: builder_output_path \"\"\nINFO FTL arg passed: destination_path /srv\nINFO FTL arg passed: sh_c_prefix False\nINFO FTL arg passed: base us.gcr.io/gae-runtimes/python37:python37_20200405_3_7_7_RC00\nINFO FTL arg passed: cache_key_version v0.17.0\nINFO FTL arg passed: cache_salt \nINFO FTL arg passed: cache_repository us.gcr.io/gae-cms-277200/app-engine-tmp/build-cache/ttl-7d\nINFO FTL arg passed: venv_cmd /opt/python3.7/bin/python3.7 -m venv /env\nINFO FTL arg passed: name us.gcr.io/gae-cms-277200/app-engine-tmp/app/ttl-2h:b073c253-b4db-4dbf-afef-0bd8a2ac8ccc\nINFO FTL arg passed: global_cache False\nINFO FTL arg passed: upload True\nINFO FTL arg passed: fail_on_error True\nINFO FTL arg passed: output_path None\nINFO FTL arg passed: directory /workspace\nINFO FTL arg passed: additional_directory /.googleconfig\nINFO FTL arg passed: verbosity DEBUG\nINFO starting: full build\nINFO starting: builder initialization\nINFO Loading Docker credentials for repository 'us.gcr.io/gae-runtimes/python37:python37_20200405_3_7_7_RC00'\nINFO Loading Docker credentials for repository 'us.gcr.io/gae-cms-277200/app-engine-tmp/app/ttl-2h:b073c253-b4db-4dbf-afef-0bd8a2ac8ccc'\nINFO builder initialization took 0 seconds\nINFO starting: build process for FTL image\nINFO starting: checking_cached_interpreter_layer\nINFO starting: check python version\nINFO `python version` full cmd:\n/opt/python3.7/bin/python3.7 --version\nINFO `python version` stderr:\n\nINFO check pyt."
}
}
Edit. Sorry about the formatting on that error message!
Any suggestions as to how to debug this problem would be very much appreciated.
Edit. I believe the solution is to upgrade from python 36 to 37, as described in app.yaml. I will keep working and post an update.
We do not see your requirements.txt file, but this problem has already appeared.
If you take a look here and here, you will find resolutions. I know they are outdated however if you take similar approach you should easily deal with it.
I hope it will help!
I am trying to integrate protractor e2e tests on my circleCi with the following setup:
config.yml
- run:
name: NPM test
command: |
cd frontend
npm install
apk update
apk add chromium
export CHROME_BIN=$(which chromium-browser)
npm run test -- --no-watch --no-progress --browsers=ChromeHeadlessCI --code-coverage || exit 0
- run:
name: Protractor e2e tests
command: |
cd frontend
npm run e2e -- --protractor-config=./e2e/protractor-ci.conf.js
protractor config:
const config = require('./protractor.conf').config;
config.capabilities = {
browserName: 'chrome',
chromeOptions: {
args: ['--headless', '--no-sandbox']
}
};
exports.config = config;
Unit test run with success, although e2e tests are not running:
[10:12:58] I/file_manager - creating folder /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium
[10:12:58] I/config_source - curl -o/root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
ℹ 「wdm」: Compiled successfully.
[10:12:58] I/downloader - curl -o/root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69.zip https://chromedriver.storage.googleapis.com/81.0.4044.69/chromedriver_linux64.zip
[10:12:59] I/update - chromedriver: unzipping chromedriver_81.0.4044.69.zip
[10:12:59] I/update - chromedriver: setting permissions to 0755 for /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69
[10:12:59] I/launcher - Running 1 instances of WebDriver
[10:12:59] I/direct - Using ChromeDriver directly...
[10:12:59] E/launcher - spawn /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69 ENOENT
[10:12:59] E/launcher - Error: spawn /root/project/frontend/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_81.0.4044.69 ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19)
at onErrorNT (internal/child_process.js:421:16)
at process.internalTickCallback (internal/process/next_tick.js:72:19)
[10:12:59] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
Setup:
Angular CLI: 7.3.9
Node: 10.19.0
Protractor: 5.4.3
Already tried:
- Update webdriver before the tests started.
- Already check thatc hromedriver_81.0.4044.69 file is on the folder of the error
I've an error on circleci that i'm not able to understand. It says that Chrome version must be between 70 and 73 when using selenium chrome webdriver.
[21:58:05] I/downloader - curl -o/home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.45.zip https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip
[21:58:05] I/update - chromedriver: unzipping chromedriver_2.45.zip
[21:58:05] I/update - chromedriver: setting permissions to 0755 for /home/circleci/project/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.45
[21:58:05] I/launcher - Running 1 instances of WebDriver
[21:58:05] I/direct - Using ChromeDriver directly...
[21:58:06] E/launcher - session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.4.0-141-generic x86_64)
[21:58:06] E/launcher - SessionNotCreatedError: session not created: Chrome version must be between 70 and 73
(Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.4.0-141-generic x86_64)
at Object.checkLegacyResponse (/home/circleci/project/node_modules/selenium-webdriver/lib/error.js:546:15)
at parseHttpResponse (/home/circleci/project/node_modules/selenium-webdriver/lib/http.js:509:13)
at doSend.then.response (/home/circleci/project/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession (/home/circleci/project/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/home/circleci/project/node_modules/selenium-webdriver/chrome.js:761:15)
at Direct.getNewDriver (/home/circleci/project/node_modules/protractor/built/driverProviders/direct.js:77:33)
at Runner.createBrowser (/home/circleci/project/node_modules/protractor/built/runner.js:195:43)
at q.then.then (/home/circleci/project/node_modules/protractor/built/runner.js:339:29)
at _fulfilled (/home/circleci/project/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/home/circleci/project/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/home/circleci/project/node_modules/q/q.js:796:13)
at /home/circleci/project/node_modules/q/q.js:556:49
at runSingle (/home/circleci/project/node_modules/q/q.js:137:13)
[21:58:06] E/launcher - Process exited with error code 199
An unexpected error occurred: undefined
my circleci config file
version: 2
jobs:
build:
docker:
- image: circleci/node:8.11-browsers
working_directory: ~/project
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm run lint
- run: npm run e2e
Any idea of what is happening ?
This isn't a problem specific to Circle CI. I was receiving it on my regular IDE setup. The issue is that your chromedriver no longer matches the browser version.
Steps to fix (I'm using Mac OSX):
- Upgrade your chrome browser to latest: currently 74
- Upgrade your chromedriver to latest: you can manually download it from their site, or if installed via brew cask just run brew cask upgrade
This worked for me. In circle.yml
- run:
name: Install Chrome
command: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
Other solutions like using -browsers docker images does not work now
One idea would be to download and install the latest Chrome in the .circleci/config.yml file (similar to #andriy-baran's comment). However, that might use up your build time unless there's a way to cache the Chrome engine directory together with its dependencies.
Check your Chrome version Help -> About Google Chrome.
Download the matching Chromedriver from http://chromedriver.chromium.org/downloads
Should solve the issue.
I'm having a not very meaningful error on my gitlab CI server when running e2e tests.
[22:40:18] I/launcher - Running 1 instances of WebDriver
[22:40:18] I/local - Starting selenium standalone server...
[22:40:18] E/launcher - Error: Error: Server terminated early with status 1
at earlyTermination.catch.e (/selenium-webdriver/remote/index.js:252:52)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[22:40:18] E/launcher - Process exited with error code 100
npm ERR! code ELIFECYCLE
npm ERR! errno 100
npm ERR! guide-scanner-web#0.0.0 e2e-ci: `ng e2e --conf protractor-ci.conf.js`
npm ERR! Exit status 100
npm ERR!
npm ERR! Failed at the guide-scanner-web#0.0.0 e2e-ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-11-28T22_40_19_015Z-debug.log
ERROR: Job failed: exit code 1
Here is the protractor.conf.js
const { SpecReporter } = require('jasmine-spec-reporter');
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
args: ["--headless", '--no-sandbox', "--disable-gpu", "--window-size=800x600"]
}
},
chromeDriver: '/selenium-grid/chromedriver_2.33',
seleniumServerJar: "/selenium-grid/selenium-server-standalone-3.7.1.jar",
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
onPrepare() {
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
}
};
the job desciption in my gitlab-ci.yml
before_script:
- npm install
e2e:
stage: testing
script:
- apt-get update -y
- apt-get install default-jre -y
- npm install -g webdriver-manager
- webdriver-manager update --out_dir /selenium-grid
- npm run e2e
And here is my package.json:
"#angular/language-service": "^5.0.0"
"#types/jasmine": "~2.5.53"
"#types/jasminewd2": "~2.0.2"
"#types/node": "~6.0.60"
"codelyzer": "~3.2.2"
"jasmine-core": "~2.6.2"
"jasmine-spec-reporter": "~4.1.0"
"karma": "~1.7.0"
"karma-chrome-launcher": "~2.1.1"
"karma-cli": "~1.0.1"
"karma-coverage-istanbul-reporter": "^1.2.1"
"karma-jasmine": "~1.1.0"
"karma-jasmine-html-reporter": "^0.2.2"
"protractor": "~5.1.2"
"ts-node": "~3.2.0"
"tslint": "~5.7.0"
"typescript": "~2.4.2"
I've been struggling on setting up the CI for a little while now so any suggestions will be very much appreciated ^^'
Just use image with headless chrome preinstalled. Here is my script for Gitlab pipelines:
cache:
paths:
- node_modules/
before_script:
- npm cache clean --force
- npm install && npm rebuild
stages:
- test
- build
build:
image: node:alpine
stage: build
script:
- ./node_modules/#angular/cli/bin/ng build --prod
test:
image: gnomeontherun/docker-node-chrome-headless:latest
stage: test
script:
- ./node_modules/#angular/cli/bin/ng test --watch=false --single-run=true