Project scans were working fine for over thirty days. Nothing has changed in source, sonarcloud settings or azure-pipeline yml. All of a sudden the project cannot be found. The Azure Personal Access Token has not expired.
Error Log:
INFO: Load project branches
INFO: Load project branches (done) | time=162ms
INFO: Check ALM binding of project 'macro-pfa_pfa'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project 'macro-pfa_pfa' (done) | time=109ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=173ms
INFO: Load branch configuration
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 35.419s
INFO: Final Memory: 20M/67M
INFO: ------------------------------------------------------------------------
##[error]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.
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.
##[error]The process '/home/vsts/work/_tasks/SonarCloudAnalyze_ce096e50-6155-4de8-8800-4221aaeed4a1/1.31.1/sonar-scanner/bin/sonar-scanner' failed with exit code 2
Finishing: SonarCloud Run Code Analysis
azure-pipelines.yml:
variables:
# Agent VM image name
vmImageName: 'ubuntu-18.04'
npm_config_cache: $(Pipeline.Workspace)/.npm
trigger:
batch: true
branches:
include:
- master
- develop
- releases/*
- preview-space
jobs:
- job: build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- template: templates/npm-steps.yml
- task: Npm@1
displayName: Prune
inputs:
command: custom
customCommand: run prune
- task: SonarCloudPrepare@1
displayName: SonarCloud Prepare
inputs:
SonarCloud: 'macro-sonar-connection'
organization: 'macro-pfa-org-key'
scannerMode: 'CLI'
configMode: 'manual'
cliProjectKey: 'macro-pfa_pfa'
cliProjectName: 'pfa'
- task: Npm@1
displayName: Create Cloudfoundry Build
inputs:
command: custom
customCommand: run cf:build
- task: SonarCloudAnalyze@1
displayName: 'SonarCloud Run Code Analysis'
- task: SonarCloudPublish@1
displayName: 'SonarCloud Publish Quality Gate Result'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: ./dist/
archiveFile: '$(Build.ArtifactStagingDirectory)/packages.zip'
- publish: $(Build.ArtifactStagingDirectory)/packages.zip
artifact: drop
- job: unit_tests
displayName: Unit Tests
pool:
vmImage: $(vmImageName)
steps:
- template: templates/npm-steps-nobuild.yml
# - task: Npm@1
# condition: or(
# eq(variables['Build.SourceBranch'], 'refs/heads/develop'),
# startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')
# )
# displayName: Prepare for Audit
# inputs:
# command: custom
# customCommand: run audit:prep
# - task: Npm@1
# displayName: Run Audit
# condition: or(
# eq(variables['Build.SourceBranch'], 'refs/heads/develop'),
# startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')
# )
# inputs:
# command: custom
# customCommand: run audit
- task: Npm@1
displayName: Linting
inputs:
command: custom
customCommand: run lint
- task: Npm@1
displayName: Run Unit Tests
condition: succeededOrFailed()
inputs:
command: custom
customCommand: run test
- task: Npm@1
displayName: Run Unit Tests With Coverage
condition: succeededOrFailed()
inputs:
command: custom
customCommand: run test:cov
- template: templates/publish-test-report.yml
parameters:
package: bank-api
- template: templates/publish-test-report.yml
parameters:
package: datamanager
- template: templates/publish-test-report.yml
parameters:
package: bankfind-ui
- template: templates/publish-test-report.yml
parameters:
package: common-modules
- job: e2e_tests
displayName: E2E Tests
pool:
vmImage: $(vmImageName)
steps:
- template: templates/npm-steps.yml
- bash: |
sudo sysctl -w vm.max_map_count=262144
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
displayName: Increase Max Virtual Memory
- task: Npm@1
displayName: Start Docker
inputs:
command: custom
customCommand: run docker-compose:up
- template: templates/datamanager-e2e.yml
- task: Npm@1
displayName: Run Bank API E2E Tests
condition: succeededOrFailed()
inputs:
command: custom
customCommand: run test:ci:e2e
workingDir: ./packages/bank-api
- task: PublishTestResults@2
displayName: Bank API - Publish E2E Test Results
condition: succeededOrFailed()
inputs:
testResultsFiles: 'packages/bank-api/test-report-e2e.xml'
testRunTitle: 'E2E Tests - Bank API'
- task: Npm@1
displayName: Run BankFind UI E2E Tests
condition: succeededOrFailed()
inputs:
command: custom
customCommand: run test:e2e
workingDir: ./packages/bankfind-ui
- task: PublishCucumberReport@1
displayName: 'Publish CucumberReport'
inputs:
jsonDir: ./packages/bankfind-ui/features/
outputPath: ./packages/bankfind-ui/features/
theme: 'bootstrap'
reportSuiteAsScenarios: true
name: 'Regression Tests'
title: BankFind UI - E2E
- deployment: deploy
displayName: Deploy
dependsOn:
- build
- unit_tests
- e2e_tests
pool:
vmImage: $(vmImageName)
environment: 'fdic-nongfe-dev'
condition: |
and(
succeeded(),
or(
eq(variables['Build.SourceBranch'], 'refs/heads/develop'),
startsWith(variables['Build.SourceBranch'], 'refs/heads/releases'),
eq(variables['Build.SourceBranch'], 'refs/heads/preview-space')
)
)
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: drop
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/drop/packages.zip'
destinationFolder: drop
cleanDestinationFolder: true
- bash: curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar -zx
displayName: Install CF CLI
- bash: ./cf api api.fr.cloud.gov
displayName: Set CF API URL
- bash: ./cf auth
displayName: Authenticate CF CLI
env:
CF_PASSWORD: $(CF_PASSWORD)
CF_USERNAME: $(CF_USERNAME)
- bash: ./cf t -o fdic-nongfe -s pfa-dev
displayName: CF Target Non-GFE
- bash: ./cf push -f $(Build.SourcesDirectory)/drop/dist/manifest.yml --vars-file $(Build.SourcesDirectory)/drop/dist/environments/vars/nongfe.yml
displayName: CF Push
# - bash: ./cf terminate-task pfadatamanagerapi $(./cf tasks pfadatamanagerapi | grep -m 1 'work-manager' | cut -d' ' -f1)
# # gets the ID number of the most recent "work-manager" task
# displayName: Cancel any previous work-manager task
# continueOnError: true
# - bash: ./cf run-task pfadatamanagerapi "npm run task:dist:work-manager" -m 2G --name work-manager
# displayName: Run all indexing tasks
sonar-project.properties
sonar.projectKey=macro-pfa_pfa
sonar.organization=macro-pfa-org-key
# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=pfa
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=.
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
# identify branch as long living
# sonar.branch.name=develop
# sonar.branch.target=develop