Sonarqube api get status. You can also access the web API documentation from the top bar in SonarQube: Jun 16, 2023 · This topic was automatically closed 7 days after the last reply. This header contains the token expiration date and can help third-party tools track upcoming expirations; this method allows the token to be rotated in time. We wanted to have a curl command that would retrieve this data from SonarQube after the scan has completed in the scanning stage of the pipeline. , the Anyone group) don't have the permission to read api/qualitygates/project_status, we get same failure. You can also access the web API documentation from the top bar in SonarQube: Jul 1, 2021 · API documentation for my version (8. A unique security token is generated for each project badge and is required to make the badge accessible from third-party tools. md file on gitlab/github. 0 our pipelines fail with the error ## [error] [SQ] API GET '/api/server/version' failed, error is Request failed with status code 400 B… Feb 17, 2025 · SonarQube Server Developer v2025. I’ve been encountering the same issue over the past few days. With the SonarQube Server instance admin permissions, you can change the instance’s mode from Standard Experience to MQR Mode and vice versa. This is the overall Quality Gate (the one you see in the UI). Mar 20, 2025 · Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)! ## [error] [ERROR] SonarQube Server: Error while executing task Prepare: API GET ‘/api/server/version’ failed. If this happens, wait a few minutes Dear users, We're excited to inform you that our status page has been migrated to a new domain. SonarQube Community Build provides the Web API to access its functionalities from applications. If it's not there you're likely hitting a network issue. May 1, 2020 · I am adding a new project and running all 3 tasks for SonarQube. This article will delve into SonarQube Web API examples, explaining how developers can use it effectively. Aug 23, 2022 · This topic was automatically closed 7 days after the last reply. I am open to other approaches of triggering a hipChat notifications as well. To fix this error, I had to use the correct "SonarQube Server Endpoint" which I didn't figure it had changed. Could you please help on this. Feb 4, 2021 · ## [error] [SQ] API GET '/api/ce/task' failed, status code was: 400 I have searched a lot and all clues are pointing that “report-task. The SonarQube API allows users to interact programmatically with their projects, issues, and quality gates. To use API without repetitively getting 401 Unauthorized, you may have to set authorization for your request. To see the response you can change your maven log level to debug. For that I used the "Get project badges" button on the bottom right corner of your sonarqube project overview. When publishin… Welcome to the SonarQube API portal, your central hub for integrating and extending SonarQube's powerful code quality analysis capabilities. Apr 11, 2019 · When I use that api call, the URL will display the info I expect, but the json that gets stored in the variable is the results from a master branch instead of the branch I specify. Through the SonarQube Web API’s, you can retrieve code metric values and histories by using the /api/measures ``endpoint. login and sonar. SonarQube REST APIs to detect bugs, code smells & security vulnerabilities Get API details, uptime stats, pricing info, and integration examples for SonarQube. When limiting search with the q parameter, directories are not returned. After you change the mode, you may have to update some quality gates, as the modes use different metrics and affect software qualities in different ways. Feb 24, 2023 · which versions are you using: 9. Best Regards, Musa Quality gates are displayed in the SonarQube Cloud interface along with the code review and analysis results of the main branch of the project, other non-main branches, and pull requests. Nov 17, 2023 · We need more information in order to help you, could you please: SonarQube provides a web API to access its functionalities from applications. Topic Replies Views Activity /api/measures/component returns 404 SonarQube Server / Community Build sonarqube 4 2079 May 25, 2021 SonarQube Web API - Issue About api/measures/component SonarQube Server / Community Build sonarqube , web_api , web-api , api 3 2498 December 6, 2021 Get /api Oct 2, 2019 · Must-share information (formatted with Markdown): which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) SonarQube : 7. 1 set with the following configuration: Aug 6, 2021 · After producing build warnings as expected, I'm finding that My SonarQube Publish Quality Gate Result step gets to an error 400 and I appear to have hit a bit of a Apr 23, 2018 · Continue to help good content that is interesting, well-researched, and useful, rise to the top! To gain full voting privileges, SonarQube is a static code analysis tool that provides development teams with insights into the quality of their code. Azure DevOps supports this tool and I've installed the add on for it. This guide will explore best practices and examples for effectively using the SonarQube web API. 18. 6. New replies are no longer allowed. Nov 5, 2020 · I have list of projects in my sonarqube dashboard, how can I get quality information like code coverage, code smell, vulnerability, and other details of all the projects in a single api call (sonarqube web api) ? Nov 30, 2023 · Could you please clarify if the SonarQube and self-hosted agent are in the same Vnet? If they are, remote to your self-hosted agent, is it able to ping the Sonarqube https://lnos-devops-conapp-sonarqube-dev. org/api_documentation/api/qualitygates/project_sta Sep 22, 2025 · Prepare SonarQube analysis configuration (task version 6). What is SonarQube? SonarQube is an open-source platform that enables developers to continuously inspect the code quality and security of their projects. SonarQube Server and SonarQube Community Build are widely used static analysis solutions for continuous code quality SonarQube provides a web API to access its functionalities from applications. How to get project_status overall instead of period? Jul 30, 2018 · I’ve a little question relating to the SonarQube (version 6. Unfortunately, I could not get all data I need via APIs. 3006 Sonarqube is dep… User guide Issues Managing issues In SonarQube, you can change the status of an issue, reassign an issue, tag an issue, and comment on an issue. However, in the SonarCloudPublish@1 step, I’m facing a failure with the following error: ## [error] [SQ] API GET ‘/api/ce/task’ failed, status code was: 404 ## [error] [SQ] Could not fetch task for Mar 20, 2023 · Using the CI/CD of github action we are trying to analysis the projects code. In most cases, you should take this into account when automating tasks and processes by using the SonarQube Cloud Web API. Mar 14, 2019 · I had the 404 error: "API GET '/api/server/version' failed, status code was: 404". For this, I use GET api/measures/component HTTP request with project key as ‘component’ parameter and the keys of the elements I want to retrieve as the ‘metricKeys’ parameter The SonarQube web API provides a powerful interface for interacting programmatically with SonarQube, allowing users to retrieve data, add projects, and manage activities on their SonarQube instance. 6, TFS and the V4. For MSBuid and Standalone Scanner options we can use Inline Powershell to define the Sonar_Scanner_opts to use the proxy connection to sonarqube instance Dec 12, 2015 · I doubt there's a reliable way to do this. qualitygate. 3) with TFS 2018, however, the first task (SonarQube - Prepare analysis) is always failing with a 401 error. For applications, it also requires 'Browse' permission on its child projects. It is simply also telling you what the New Code Period is, as that will affect the metrics prefixed with new_* Feb 24, 2023 · caycStatus should be about the Quality Gate itself, not about your project. I can get the number of vulnerabilities (on metric level) w… Mar 7, 2016 · How do I get a project's last analysis time (the one you can see in the dashboard) with the REST API of SonarQube? I am working with SonarQube 4. I’m using SonarCloud in an Azure DevOps pipeline for PR analysis of a TypeScript project. The only other alternative seems to be to go one by one through each component, which wouldn't be ideal given that I have over 500 projects I would like get metrics for. Jun 22, 2022 · How to get members and permissions of a Portfolio Sonarcloud API create project and initial scan SonarQube API endpoint Powershell script to pull the sonarqube metrics and show the results in Pull Request Setting project settings via REST calls Apr 11, 2022 · I am using Azure Devops sonar cloud plugin and am randomly getting API GET ‘/api/qualitygates/project_status’ failed, error was: {“errno”:“ECONNRESET Jul 23, 2024 · Hello @PatrickAngrezani @mrinardo @Michal_Chudziak @KennyRogers @elliechen We were able to reproduce your failure in specific setups where proxy variables were not always set: For instance, if you are reaching an https SQ through a proxy and you are only passing HTTP_PROXY, not HTTPS_PROXY. wait=t… Jul 5, 2017 · It seems like GET api/measures/component can give me the XML I want, but only if given a specific componentKey (project name). 1 (102418) Deployment: zip ADO SonarQube Extension 7. 9. Get the quality gate status of a project or a Compute Engine task. Apr 4, 2018 · Description I have a simple PowerShell script in TFS 2017 that does a GET request to retrieve quality gate status for a given project. 9 Enterprise, web-api how is SonarQube deployed: no-idea what are you trying to achieve: I’m trying to know the status of a Customized quality-gate by project what have you tried so far … Jul 20, 2023 · SonarQube Server / Community Build sonarqube , scanner 7 2391 April 30, 2021 Analysis fails with "Failed to upload report" , server responds with HTTP 500 SonarQube Server / Community Build scanner 2 6386 January 17, 2020 ## [error] [SQ] API GET '/api/server/version' failed, status code was: 502 SonarQube Server / Community Build sonarqube Some of SonarQube Cloud’s APIs are rate-limited in order to ensure that we can continue to deliver the service smoothly and with optimum performance. One of its powerful features is the Web API, which allows developers to interact programmatically with the platform. 6, but if it's only available on later versions I'd Jul 22, 2025 · which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) - Community BUild v25. I couldn't find it under api/quailty_gate or api/projects. 1 SonarScanner for MSBuild 9. SonarQube Community edition: get quality gate status after analysis and retrieve possible issues with theirs severities; then create bugs, linked to some issues in Jira - sonarQubeAnalyzer. I’m pretty sure this is related to Auth via token in our setup. Since, We have two different instances of GitHub, cannot add the GitHub Aug 14, 2023 · Hello, I would like to build some SonarQube dashboards on Elasticsearch by using the SonarQube API’s. 6 rest api issue Oct 1, 2021 · When I run the sonar analysis on my code there is no problem, even the results are published in the Sonar tool but when executing the publish quality gate task the pipeline fails and shows the following error: ## [error] [SQ] API GET '/api/ce/task' failed, status code was: 400 ## [error] [SQ] Could not fetch task for ID 'AXw8YqgBUKkK2z5OofBY' Aug 6, 2021 · I hope this message finds you well. sonarqube. So whatever your query on closed issues, the (potentially incomplete) result isn't trustworthy. All requests to the SonarQube API must be made over HTTPS. The power of SonarQube not only lies in its analysis capabilities but also in its Web API that SonarQube provides web API to access its functionalities from applications. revision value. Aug 8, 2017 · I tried "/api/qualitygates/search?gateId=1" after confirming that the Default Qualitygate is "SonarQube way" using this api to confirm it "api/qualitygates/list" but I get. This portal provides comprehensive documentation to help you seamlessly connect your applications, scripts, and workflows with SonarQube. You can include dynamic SonarQube Server badges on your web pages to display information about your project such as the current value of specific metrics or the current quality gate status. It also presents the issue's lifecycle and details issue-related features. Dec 20, 2023 · Hi, newcomer to SonarQube and the community here, and i think this is probably a very basic question - although i’ve been unable to find the solution in the documentation or the forum posts. . The quality gates will indicate a Passed or Failed status (or if not properly set up, a Not User guide Managing issues Issue management solution This document describes how SonarQube Server and its automated code review identify, assign, and synchronize issues. The SonarQube project (PC_civil-affairs) has three branches, master ( Jun 25, 2025 · Invoke-RestMethod: This PowerShell cmdlet makes the actual HTTP GET request to the SonarQube API. This guide seeks to equip you with Mar 29, 2023 · But to be accurate you need the sonar. The Sonar Prepare Analysis step fails ## [error] [SQ] API GET '/api/server/version' failed SonarQube provides web API to access its functionalities from applications. So checking the status of a given Pull Request in SonarQube without the revision will be wrong in most of the case. The different statuses returned are: OK, WARN, ERROR, NONE. Aug 16, 2018 · If I call same SonarQube URL direct from outside TFS the using the same Token as configured I can get the JSON file that the SonarQube server returns, so I am thinking that this task is maybe using a wrong auth schema. My SonarQube version is 6. x what are you trying to achieve … Jun 12, 2018 · I'm using SonarQube branch plugin (1. Mar 29, 2016 · 3 I need to trigger HipChat notification for a project as soon as quality gate fails for a project in SonarQube. Topic Replies Views Activity Getting Started With Web API SonarQube Server / Community Build web_api 2 4893 July 18, 2019 SonarQube Web API - Issue About api/measures/component SonarQube Server / Community Build sonarqube , web_api , web-api , api 3 2496 December 6, 2021 Sonar 7. I’m pretty much down to wild Dec 17, 2024 · which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) : Sonar Qube Version: v9. I am able to access the endpoints in my browser, so the endpoints exist on our instance. You can also access the web API documentation from the top bar in SonarQube: Navigate through components based on the chosen strategy with specified measures. Apr 20, 2021 · This is the overall Quality Gate (the one you see in the UI). 1829 what are you trying to achieve Do a API call to the PR analysis of a GitHub PR to get the status and report for that analysis. If after this you still encounter issues Nov 27, 2015 · Check your SonarQube access log: sonarqube_access. Markdown snippets and simple image URLs are provided to generate the badge code. Hope to hear from you soon. 9 Enterprise Edition How can we obtain for a given project, using Sonarqube API, the last analysis date and the subset of metrics associated with that last analysis date? So far we are using the GET api/mea… The Project Information page shows details of your project settings, such as quality gate and quality profiles used for project analysis. Issue management solution This page explains how SonarQube Server identifies, assigns, and synchronizes issues, the issue lifecycle, and issue-related features. 6 with LDAP plugin 1. 7) API and more especially the method project_status. 7. Open issues are obviously kept in the database, but closed ones get cleaned up (to not bloat the DB). With Web API I am able to authenticate, create and delete projects. The NONE status is returned when there is no quality gate associated with the analysis. If you're hitting a network firewall/proxy issue the response should give some clue as to what generated the 404. It provides robust features such as code analysis, technical debt management, and bug detection, ensuring that the code adheres to best practices. SonarQube Server provides the Web API to access its functionalities from applications. 3 (build 82913) Version of Scanner: 5. Either 'analysisId', 'projectId' or 'projectKey' must be provided. When running a build we get a "Could not fetch metrics" and "Could not fetch task for ID" errors (build breaks) but we still see some results in the Portal. 5. I hope SonarQube will be aligned with SonarCloud soon. We are addressing this with the API v2, and we will ensure that both products comply with the same API contracts for their API v2 endpoints. Feb 8, 2024 · One API to rule them All… Another frequent need of our API consumers is interoperability between the Web APIs of SonarQube Server and SonarQube Cloud. Aug 9, 2017 · But now, after upgrading from SonarQube 5. The web services composing the web API are documented within SonarQube, by URL. To access the documentation, select the help button from the top bar in SonarQube: Note that the Web API V2 will gradually replace the Web API as endpoints get deprecated and replaced. Retrieving issues This page explains how to retrieve and filter issues. Jan 13, 2016 · GET api/qualitygates/project_status call to sonar requires analysisId. I’ve a little question relating to the SonarQube(version 6. Thank you Jul 30, 2018 · Hello all, Hope you’re fine. Do you have any API to check the status of a pull request by its id. 1, suddenly all projects are set to private and since anonymous users (e. According to the documentation of the method, there is no ‘branch Mar 12, 2018 · We are using SonarQube 5. I’m trying to connect to the SonarQube API of the on-prem instance of my organisation using the powershell script below (having substituted the variables for my own instance etc). txt” file may be cached from old builds and the solution is that I remove it but actually I am not sure where it is generated inside the working directory of the pipeline. Jan 22, 2024 · SonarQube Cloud javascript , typescript , coverage , azuredevops , sonarqube-cloud 6 517 January 25, 2024 Github actions yml script use sonarcloud point "Project was never analyzed" SonarQube Cloud sonarqube 1 1662 December 4, 2019 Azure Devops PR Build NOT reporting SonarCloud Quality Gate - Stuck in 'Waiting' SonarQube Cloud Dec 6, 2021 · I am using Sonarqube Web, version API-9. For pull requests, the quality gate will also be displayed in the repository platform as a pull request decoration. 1 and updated the Azure DevOps Extensions to 7. You can now access our new status page at: status. I use the API and this method to get the status of the quality gate of the project. Your API calls will fail with a 429 status code when the rate limit has been reached. 47736. Response Processing: It parses the JSON response from SonarQube. I made a test adding the parameters sonar. It is simply also telling you what the New Code Period is, as that will affect the metrics prefixed with new_* Take a look at any project you query GET api/qualitygates/project_status for, it will match the Quality Gate you see in the overview of a SonarQube project. scm. g. Able to see projects are getting analysed in the sonarcloud but when trying to get the status from the github action (sonar. If a token is used to interact with the API, a SonarQube-Authentication-Token-Expiration HTTP header is added to the response. password in the Advanced -> Additional Properties, and this way it STARTING: SonarQube Web Server is up and serving some Web Services (eg. Either 'analysisId', 'projectId' or 'projectKey' must be provided The different statuses returned are: OK, WARN, ERROR, NONE. I have a problem when I try to get the results of the completed evaluation of my projects. We are using Hosted Agents in a… Jul 2, 2020 · 14 I have a project on gitlab for which I'm trying to display quality badges from sonarqube on. Jan 17, 2025 · It seems to me like using the SCM revision would be a better indicator of whether or not the latest analysis matches what commit you want to deploy (the revision from GET api/project_analyses/search) Sep 21, 2021 · What’s the HTTP response status code you get for the second request? Can you try to send the request in Postman? Jun 8, 2016 · Sonar version is 5. Note The SonarQube tasks are part of the SonarQube extension for Azure DevOps, which is pre-installed in Azure DevOps Services. The web services composing the web API are documented within SonarQube. Aug 17, 2018 · Description I am trying to use SonarQube (server version 7. eastus. With the growing need for quality code in software development, SonarQube has emerged as a reliable tool for static code analysis. API Endpoints Get Project analysis GET /api/project_analyses Dec 25, 2020 · This way Prepare Analysis Task works perfectly to achieve connection to sonarqube instance through a proxy when we use "Integrate With Maven or Gradle option". Regards, Nagaraj Jun 18, 2018 · The SonarQube extension make various http requests to the SonarQube server for various reasons. Stay up-to-date with the latest Sonar content. Dive into its features, integrations, and best practices for optimal software development. The metric keys are listed in the metric tables in Metric definitions or you can use the /api/metrics endpoint to retrieve them. Jul 24, 2023 · Dear SonarCloud Team, When I check the Pull Requests API in the web API, I couldn’t find the API to check the status of a pull request instead of the list of all pull requests. api/system/status) but initialization is still ongoing UP: SonarQube instance is up and running Feb 11, 2025 · Unlock the power of code quality with the SonarQube API. Reviewing issues This page explains how to view and understand your issues in the SonarQube Server UI. Apr 10, 2022 · It seems it has to do something with the fact that it’s a new pull request and regardless scan is finished and it generates link with results, it still requires some time before it will be possible for the api call i mentioned to be able to return coverage. 16. I assume that general value is for overall value and period value is for the new code. Nov 15, 2022 · Sonarqube 8. 0 (build 507)) and want to retrieve information from branches. For more information and support for SonarQube and SonarQube tasks, see SonarQube extension for Azure DevOps, SonarQube - Visual Studio Marketplace, and Sonar Community. 6 to 6. ps1 While running an analysis, SonarQube raises an issue every time a piece of code breaks a coding rule. The GitLab event is emitted especially when there are a new commit added to the MR. Oct 17, 2023 · Hi, after the update of Sonarqube Extension for Azure DevOps today to version 5. They give you for each badge a Markdown which you can easily copy & paste to your README. I keep getting 401 Check the Quality Gate of your code with SonarQube Server or SonarQube Community Build to ensure your code meets your own quality standards before you release or deploy new features. While 2 tasks are executed with no issues the “Publish Quality Gate Result” task fails with: Sep 24, 2020 · Hi Team, In SonarQube do we have the REST APIs that would allow us to retrieve some kind a ‘result’ after a scan has completed. 1. Also, if i retry the operation (scan and get results) on already existing pull request there are no issues like this. 5 (build 90363) how is SonarQube deployed: zip, Docker, Helm: : We use SonarQube … SonarQube provides web API to access its functionalities from applications. Version of Sonarqube: Community Edition 10. 9) only states period, which probably stands for Leak Period as the New Code used to be called. It was working perfectly until the activation of the branch plugin, I’ve the wrong information. com Please update your bookmarks accordingly! We appreciate your understanding and continued support. Oct 16, 2018 · Description Build running on internal build server, attempting to run analysis reaching our SonarQube server on another machine, on the same subnet. log. If your SonarQube server is using a custom/self-signed SSL certificate, it will fail for security reasons. 1 Enterprise Edition Scanner: 4. Is there a REST API for checking the quality gate status of a project. As per documentation on History and Events: All closed issues more than 30 days old are deleted. Since we have enabled AD authentication, the script fails with Jan 17, 2021 · which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) Hi, I’m new to sonarQube, our company is using enterprise edition of sonarQube with version 7. Requires the following permission: 'Browse' on the specified project. 1 SonarQube task (See also the closed issue VSTS-134). We just released 5. Sep 18, 2025 · Error retrieving analysis: API GET '/api/qualitygates/project_status' failed SonarQube Server / Community Build a11smiles (Joshua Davis) September 18, 2025, 4:31am 1 Get webhook notifications whenever SonarQube createsan incident, updatesan incident, resolvesan incident or changesa component status. 3 to 2025. Feb 1, 2024 · The Issue: I am trying to access the Web API of our SonarQube instance, but all attempted endpoints report a 401 (Not Authorized) when accessing programtically following the instructions in the documentation. http://nemo. I've added the step to my Pipeline and configured the service connection. ambitiousmeadow-06ff8bca. Jun 21, 2024 · Hello, I’m running into a problem where I’m gettting 401 errors when scanning my project via a CI environment. Aug 18, 2024 · Error while executing SonarQube:Prepare task: [SQ] API GET '/api/server/version' failed, error is The operation was aborted. azurecontainerapps. io? Try to add host on the machine for a check. 107428 - MQR MODE how is SonarQube deployed: zip what are you trying to achieve - I am trying to get the Sonar Quality Gate - Coverage value using Rest API what have you tried so far to achieve this - Below is the Azure DevOps Task where I am trying to use Feb 3, 2023 · SonarQube Web API use authentication by default, which is so called Basic Auth. This new page will continue to provide you with the latest updates on the availability and performance of SonarQube services. I am not able to figure out that how to get the same. SonarQube provides a web API to access its functionalities from applications. Apr 20, 2021 · A SonarQube project has a single Quality Gate. 3 which we hope will fix your issue. 2 We upgraded from 10. Jun 23, 2022 · I have a server in AWS, which is hosting an on prem instance of Sonarqube. 0. That will dump the response to the maven console so you can see it. edxnokd xlnqzkb ktjany prkhf j1 lszl dsii dmnve uykskn kp