- ALM used: GitLab
- CI system used: GitLab
- Scanner command used:
sonar-scanner -Xin .gitlab-ci.yml - Languages of the repository: Node
- Error observed: [at the bottom of this textbox]
- I went to the project configuration page, at https://sonarcloud.io/project/configuration?id= and selected “With GitLab CI/CD Pipeline,” which had a blue “Recommended” bar below it.
- That brought me to " Analyze with GitLab CI/CD Pipeline", so I updated the CI variables in GitLab UI. The environment for all variables is “All (default)”.
- Next is " Create or update a
.gitlab-ci.ymlfile", so I copied and pasted the generated script into my .gitlab-ci.yml fil, updating only the execution rules so that it only runs SonarCloud onpush. - The final step is " Create a
sonar-project.propertiesfile", so I pasted that verbatim into thesonar-project.propertiesfile.
I went line-by-line through the error trace but could not find anything that illuminated why my project was not found.
Error trace running just sonar-scanner command:
e[0KRunning with gitlab-runner 15.4.0~beta.5.gdefc7017 (defc7017)e[0;m
e[0K on green-5.shared.runners-manager.gitlab.com/default xS6Vzpvoe[0;m
section_start:1664547313:resolve_secrets
e[0Ke[0Ke[36;1mResolving secretse[0;me[0;m
section_end:1664547313:resolve_secrets
e[0Ksection_start:1664547313:prepare_executor
e[0Ke[0Ke[36;1mPreparing the "docker+machine" executore[0;me[0;m
e[0KUsing Docker executor with image sonarsource/sonar-scanner-cli:latest ...e[0;m
e[0KPulling docker image sonarsource/sonar-scanner-cli:latest ...e[0;m
e[0KUsing docker image sha256:73368e6b06a60f07bc652db44194f3af8ecca6224cc17cd7c53d760981f6ac16 for sonarsource/sonar-scanner-cli:latest with digest sonarsource/sonar-scanner-cli@sha256:7eeb9a64762d3db08f90096dc3f332e6a34d8fb49ef48ed624917de2b9595c38 ...e[0;m
section_end:1664547328:prepare_executor
e[0Ksection_start:1664547328:prepare_script
e[0Ke[0Ke[36;1mPreparing environmente[0;me[0;m
Running on runner-xs6vzpvo-project-31343446-concurrent-0 via runner-xs6vzpvo-shared-1664547263-74e4a5ed...
section_end:1664547329:prepare_script
e[0Ksection_start:1664547329:get_sources
e[0Ke[0Ke[36;1mGetting source from Git repositorye[0;me[0;m
e[32;1m$ eval "$CI_PRE_CLONE_SCRIPT"e[0;m
e[32;1mFetching changes...e[0;m
Initialized empty Git repository in /builds/<my company>/practice/<my project>/.git/
e[32;1mCreated fresh repository.e[0;m
e[32;1mChecking out 6f37ba53 as smd-1129/sonarcloud-cypress-etc-for-pipeline...e[0;m
e[32;1mSkipping Git submodules setupe[0;m
section_end:1664547334:get_sources
e[0Ksection_start:1664547334:restore_cache
e[0Ke[0Ke[36;1mRestoring cachee[0;me[0;m
e[32;1mChecking cache for sonarcloud-check-non_protected...e[0;m
e[0;33mWARNING: file does not exist e[0;m
e[0;33mFailed to extract cachee[0;m
section_end:1664547335:restore_cache
e[0Ksection_start:1664547335:step_script
e[0Ke[0Ke[36;1mExecuting "step_script" stage of the job scripte[0;me[0;m
e[0KUsing docker image sha256:73368e6b06a60f07bc652db44194f3af8ecca6224cc17cd7c53d760981f6ac16 for sonarsource/sonar-scanner-cli:latest with digest sonarsource/sonar-scanner-cli@sha256:7eeb9a64762d3db08f90096dc3f332e6a34d8fb49ef48ed624917de2b9595c38 ...e[0;m
e[32;1m$ sonar-scannere[0;m
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/<my company>/practice/<my project>/sonar-project.properties
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.15 Alpine (64-bit)
INFO: Linux 5.4.109+ amd64
INFO: User cache: /builds/<my company>/practice/<my project>/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/<my company>/practice/<my project>/sonar-project.properties
INFO: Analyzing on SonarQube server 8.0.0.32648
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=727ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /builds/<my company>/practice/<my project>/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=688ms
INFO: Load/download plugins (done) | time=7595ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Gitlab CI'
INFO: Load project settings for component key: '<my company>_<my project>'
INFO: Load project settings for component key: '<my company>_<my project>' (done) | time=626ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: <my company>_<my project>
INFO: Base dir: /builds/<my company>/practice/<my project>
INFO: Working dir: /builds/<my company>/practice/<my project>/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=605ms
INFO: Check ALM binding of project '<my company>_<my project>'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project '<my company>_<my project>' (done) | time=612ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=606ms
INFO: Load branch configuration
INFO: Auto-configuring branch smd-1129/sonarcloud-cypress-etc-for-pipeline
INFO: Load branch configuration (done) | time=9ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=699ms
INFO: Load active rules
INFO: Load active rules (done) | time=6113ms
INFO: Organization key: <my company>-1
INFO: Branch name: smd-1129/sonarcloud-cypress-etc-for-pipeline, type: short-lived
INFO: Load project repositories
INFO: Load project repositories (done) | time=587ms
INFO: SCM collecting changed files in the branch
INFO: SCM collecting changed files in the branch (done) | time=589ms
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/build-wrapper-dump.json
INFO: 332 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: 1 file ignored because of scm ignore settings
INFO: Quality profile for css: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for web: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module <my company>_<my project>
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=879ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=1680ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=827ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=9ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=30ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=165ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=446ms
INFO: Sensor Text Sensor [text]
INFO: 307 source files to be analyzed
INFO: 307/307 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=1389ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=3ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=37ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=0ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=10ms
INFO: Sensor JavaScript analysis [javascript]
INFO: Deploying custom rules bundle jar:file:/builds/<my company>/practice/<my project>/.sonar/cache/985cd0bb0f213099aac4466b1eea8b9a/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /builds/<my company>/practice/<my project>/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules8321217062000453175
INFO: 258 source files to be analyzed
INFO: 19/258 files analyzed, current file: /builds/<my company>/practice/<my project>/services/dashboard/test/unit/CaseDay.test.js
INFO: 65/258 files analyzed, current file: /builds/<my company>/practice/<my project>/ui/src/pages/requestCaseDays/calendar/test/calendar.test.js
INFO: 119/258 files analyzed, current file: /builds/<my company>/practice/<my project>/ui/src/components/calendarCaseDay/tests/calendarCaseDayFuture.test.js
INFO: 177/258 files analyzed, current file: /builds/<my company>/practice/<my project>/services/patient/addPatient/test/unit/apigHandler.test.js
INFO: 241/258 files analyzed, current file: /builds/<my company>/practice/<my project>/ui/src/pages/addPatient/dateOfProcedure/dateOfProcedure.test.js
INFO: 258/258 source files have been analyzed
INFO: Hit the cache for 0 out of 258
INFO: Miss the cache for 258 out of 258: ANALYSIS_MODE_INELIGIBLE [258/258]
INFO: Sensor JavaScript analysis [javascript] (done) | time=59315ms
INFO: Sensor TypeScript analysis [javascript]
INFO: No input files found for analysis
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor TypeScript analysis [javascript] (done) | time=10ms
INFO: Sensor JavaScript inside YAML analysis [javascript]
INFO: 8 source files to be analyzed
INFO: 8/8 source files have been analyzed
INFO: Hit the cache for 0 out of 8
INFO: Miss the cache for 8 out of 8: ANALYSIS_MODE_INELIGIBLE [8/8]
INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=323ms
INFO: Sensor JavaScript/TypeScript Coverage [javascript]
INFO: No LCOV files were found using ./services/dashboard/coverage/lcov.info
INFO: No LCOV files were found using ./services/patient/getPatients/coverage/lcov.info
INFO: No LCOV files were found using ./services/patient/addPatient/coverage/lcov.info
INFO: No LCOV files were found using ./ui/coverage/lcov.info
INFO: No LCOV files were found using ./services/caseDays/coverage/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=832ms
INFO: Sensor CSS Metrics [javascript]
INFO: Sensor CSS Metrics [javascript] (done) | time=84ms
INFO: Sensor CSS Rules [javascript]
INFO: 15 source files to be analyzed
INFO: 15/15 source files have been analyzed
INFO: Hit the cache for 0 out of 0
INFO: Miss the cache for 0 out of 0
INFO: Sensor CSS Rules [javascript] (done) | time=474ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=6ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 8 Serverless function entries were found in the project
INFO: 8 Serverless function handlers were kept as entrypoints
WARN: Could not find handler file corresponding to 'services/patient/addPatient/dist/apigHandler.*'
WARN: Could not find handler file corresponding to 'services/dashboard/dist/awsFunctionHandler.*'
WARN: Could not find handler file corresponding to 'services/caseDays/dist/getCaseDays/httpGetHandler.*'
WARN: Could not find handler file corresponding to 'services/caseDays/dist/getConfirmedCaseDays/httpGetHandler.*'
WARN: Could not find handler file corresponding to 'services/patient/getPatients/dist/handler.*'
WARN: Could not find handler file corresponding to 'services/patient/updatePatientCaseDay/dist/httpPutHandler.*'
WARN: Could not find handler file corresponding to 'services/caseDays/dist/postCaseDays/httpPostHandler.*'
WARN: Could not find handler file corresponding to 'services/caseDays/dist/putCaseDays/httpHandler.*'
INFO: Sensor Serverless configuration file sensor [security] (done) | time=320ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=2ms
INFO: Sensor javabugs [dbd]
INFO: Reading IR files from: /builds/<my company>/practice/<my project>/.scannerwork/ir/java
INFO: No IR files have been included for analysis.
INFO: Sensor javabugs [dbd] (done) | time=2ms
INFO: Sensor pythonbugs [dbd]
INFO: Reading IR files from: /builds/<my company>/practice/<my project>/.scannerwork/ir/python
INFO: No IR files have been included for analysis.
INFO: Sensor pythonbugs [dbd] (done) | time=4ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=6ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /builds/<my company>/practice/<my project>/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /builds/<my company>/practice/<my project>/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=9ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=2ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /builds/<my company>/practice/<my project>/.scannerwork/ucfg2/js
INFO: 14:17:22.82684 Building Runtime Type propagation graph
INFO: 14:17:23.096352 Running Tarjan on 12438 nodes
INFO: 14:17:23.144837 Tarjan found 12438 components
INFO: 14:17:23.227405 Variable type analysis: done
INFO: 14:17:23.235016 Building Runtime Type propagation graph
INFO: 14:17:23.404175 Running Tarjan on 12438 nodes
INFO: 14:17:23.437329 Tarjan found 12438 components
INFO: 14:17:23.557694 Variable type analysis: done
INFO: Analyzing 2699 ucfgs to detect vulnerabilities.
INFO: Taint analysis starting. Entrypoints: 260
INFO: Running symbolic analysis for 'JS'
INFO: Taint analysis: done.
INFO: Sensor JsSecuritySensor [security] (done) | time=8990ms
INFO: ------------- Run sensors on project
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=6ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=91ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 5 source files to be analyzed
INFO: Blaming files using native implementation
INFO: Blaming files using native implementation (done) | time=2199ms
INFO: SCM Publisher 5/5 source files have been analyzed (done) | time=2249ms
INFO: CPD Executor 59 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 200 files
INFO: CPD Executor CPD calculation finished (done) | time=275ms
INFO: SCM writing changed lines
INFO: SCM writing changed lines (done) | time=549ms
INFO: Analysis report generated in 953ms, dir size=1 MB
INFO: Analysis report compressed in 774ms, zip size=560 KB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2:05.585s
INFO: Final Memory: 83M/200M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
section_end:1664547462:step_script
e[0Ksection_start:1664547462:cleanup_file_variables
e[0Ke[0Ke[36;1mCleaning up project directory and file based variablese[0;me[0;m
section_end:1664547463:cleanup_file_variables
e[0Ke[31;1mERROR: Job failed: exit code 1
e[0;m
Bottom of error trace running sonar-scanner -X. (Can’t print the whole thing because it’s 3,473 lines long):
15:15:09.575 DEBUG: Upload report
15:15:10.758 DEBUG: POST 404 https://sonarcloud.io/api/ce/submit?organization=<company>&projectKey=<company>&projectName=<project>&characteristic=branch%3Dsmd-1129%2Fsonarcloud-cypress-etc-for-pipeline&characteristic=branchType%3DSHORT | time=1182ms
15:15:10.766 DEBUG: eslint-bridge server will shutdown
15:15:15.771 DEBUG: eslint-bridge server closed
15:15:16.608 INFO: ------------------------------------------------------------------------
15:15:16.608 INFO: EXECUTION FAILURE
15:15:16.609 INFO: ------------------------------------------------------------------------
15:15:16.609 INFO: Total time: 1:30.555s
15:15:16.832 INFO: Final Memory: 64M/173M
15:15:16.833 INFO: ------------------------------------------------------------------------
15:15:16.834 ERROR: Error during SonarScanner execution
Project not found. Please check the 'sonar.projectKey' and 'sonar.organization' properties, the 'SONAR_TOKEN' environment variable, or contact the project administrator






