Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Error: Basic authentication must be done with auth option #137

Closed
Smasherr opened this issue Mar 4, 2022 · 3 comments
Closed

Error: Basic authentication must be done with auth option #137

Smasherr opened this issue Mar 4, 2022 · 3 comments

Comments

@Smasherr
Copy link

Smasherr commented Mar 4, 2022

When specifying a download mirror that requires authentication...

export SONAR_SCANNER_MIRROR="https://${U}:${P}@${SQ_SCANNER_MIRROR_PATH}/"

the scan fails

$ sonar-scanner -Dsonar.host.url="${SONAR_HOST_URL}" -Dsonar.login="${SONAR_TOKEN}"
[10:12:17] Starting analysis...
[10:12:17] Checking if executable exists: /root/.sonar/native-sonar-scanner/sonar-scanner-4.5.0.2216-linux/bin/sonar-scanner
[10:12:17] Could not find executable in "/root/.sonar/native-sonar-scanner".
[10:12:17] Proceed with download of the platform binaries for SonarScanner...
[10:12:17] Creating /root/.sonar/native-sonar-scanner
[10:12:17] Downloading from [https://[MASKED]/sonar-scanner-cli-4.5.0.2216-linux.zip]
[10:12:17] (executable will be saved in cache folder: /root/.sonar/native-sonar-scanner)
/usr/local/lib/node_modules/sonarqube-scanner/node_modules/got/index.js:274
		throw new Error('Basic authentication must be done with auth option');
		^
Error: Basic authentication must be done with auth option
    at normalizeArguments (/usr/local/lib/node_modules/sonarqube-scanner/node_modules/got/index.js:274:9)
    at Function.got.stream (/usr/local/lib/node_modules/sonarqube-scanner/node_modules/got/index.js:392:38)
    at module.exports (/usr/local/lib/node_modules/sonarqube-scanner/node_modules/download/index.js:78:21)
    at getSonarScannerExecutable (/usr/local/lib/node_modules/sonarqube-scanner/dist/sonar-scanner-executable.js:104:3)
    at scanCLI (/usr/local/lib/node_modules/sonarqube-scanner/dist/index.js:31:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/sonarqube-scanner/dist/bin/sonar-scanner:9:1)
    at Module._compile (internal/modules/cjs/loader.js:10[63](https://tools.services.zh.ch/zhservices/common/common-frontend/-/jobs/5966#L63):30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
@Smasherr
Copy link
Author

Smasherr commented Mar 4, 2022

Related sindresorhus/got#184

@gabssnake
Copy link
Collaborator

Hey @Smasherr, is this still an issue for you in the latest version?

@gabssnake
Copy link
Collaborator

gabssnake commented Dec 4, 2022

Hi @Smasherr,

I created a list of potential improvements and mentioned the problem you are/were experiencing:

I'll close this issue for now. Feel free to reopen if you have more information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants