With scanner-cli:latest , facing the issue of permission denied

When updating sonar-cli : Latest, facing permission issue denied

ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
sonar-app:
<<: *tpl_build_gcp
stage: sonar_audit
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: [ā€œā€]
script:
- apk add --no-cache chromium
- export CHROME_BIN=/usr/bin/chromium-browser
- ls
- npm install --legacy-peer-deps
- npm run unit-test
- ls
- sonar-scanner -Dsonar.host.url=${SONAR_HOST_URL} -Dsonar.login=${SONAR_TOKEN} Dsonar.javacript.lcov.reportPaths=coverage/report-lcov/lcov.info -Dsonar.verbose=true
artifacts:
when: always

Welcome :slight_smile:

with Sonar CLI scanner latest = 6.1.0 you need to replace
sonar.login with sonar.token

Gilbert

Thank u @anon67236913 , I will try with version update, But I am using
-Dsonar.login=${SONAR_TOKEN} here,
is it anything need to change

you have to change the name of the property, not the property value, means
-Dsonar.login=${SONAR_TOKEN} to -Dsonar.token=${SONAR_TOKEN}

1 Like

I have the same issue with sonar token.
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied

Iā€™m also facing the same issue.

apk add --no-cache bash

outputs

ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied