Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: ?projectKey=undefined on node v18 #222

Open
almas opened this issue Sep 25, 2023 · 3 comments
Open

Bug: ?projectKey=undefined on node v18 #222

almas opened this issue Sep 25, 2023 · 3 comments

Comments

@almas
Copy link

almas commented Sep 25, 2023

I got error projectKey=undefined.

node -v
v18.18.0
npm -v
9.8.1

Command that I executing:

sonar-report --sonarurl "http://localhost:9000/" --project MyProject --output "/tmp/sonar-report_sonar-report.html" --allbugs --sonartoken squ_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

lbugs --sonartoken squ_xxxxxxxxxxxxxxxxxxxxxxxxx

sonarqube version: 9.9.2
http://localhost:9000/api/hotspots/search?projectKey=**undefined**&ps=500&p=1&statuses=TO_REVIEW
Error while getting hotspots list : ERR_NON_2XX_3XX_RESPONSE - Response code 404 (Not Found) - 404 - Not Found - {"errors":[{"msg":"Component key \u0027undefined\u0027 not found"}]}
node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

HTTPError: Response code 404 (Not Found)
    at Request.<anonymous> (/home/ccs/.nvm/versions/node/v18.18.0/lib/node_modules/sonar-report/node_modules/got/dist/source/as-promise/index.js:118:42)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_NON_2XX_3XX_RESPONSE',
  timings: {
    start: 1695601707195,
    socket: 1695601707196,
    lookup: 1695601707196,
    connect: 1695601707196,
    secureConnect: undefined,
    upload: 1695601707197,
    response: 1695601707208,
    end: 1695601707208,
    error: undefined,
    abort: undefined,
    phases: {
      wait: 1,
      dns: 0,
      tcp: 0,
      tls: undefined,
      request: 1,
      firstByte: 11,
      download: 0,
      total: 13
    }
  }
}

Node.js v18.18.0

I also tried on version 10.2.0:

sonarqube version: 10.2.0
http://localhost:9000/api/hotspots/search?projectKey=undefined&ps=500&p=1&statuses=TO_REVIEW
Error while getting hotspots list : ERR_NON_2XX_3XX_RESPONSE - Response code 404 (Not Found) - 404 - Not Found - {"errors":[{"msg":"Project \u0027undefined\u0027 not found"}]}
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
@almas almas changed the title Bug: ?projectKey=undefined Bug: ?projectKey=undefined on node v18 Sep 25, 2023
@almas
Copy link
Author

almas commented Sep 25, 2023

Same error with:

$ node -v
v14.21.3
$ npm -v
6.14.18

@thecampagnards
Copy link
Member

Hello, can you add this flag --sonarcomponent="..." so the cli will be able to get the project info

@almas
Copy link
Author

almas commented Sep 25, 2023

Hello, can you add this flag --sonarcomponent="..." so the cli will be able to get the project info

Oh I see. Thank you for your support.
What should I pass to for --sonarcomponent? I couldn't find information about it from the Readme.
Can you help me? I find it in the SonarQube project page, but I didn't find and component part.

Also, Can I ask one thing? Is this tool support with version 10 of SonarQube?

Thank you.

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

No branches or pull requests

2 participants