Issue with github actions and api 500 response

I am trying to use sonarsource/sonarcloud-github-action

My config is next:

- name: SonarCloud Scan
        uses: sonarsource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

CI output:

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /github/workspace/sonar-project.properties
INFO: SonarScanner 4.3.0.2102
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 5.3.0-1034-azure amd64
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /github/workspace/sonar-project.properties
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "US-ASCII" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=610ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=142ms
INFO: Load/download plugins (done) | time=22232ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: dealroom_dealroom
INFO: Base dir: /github/workspace
INFO: Working dir: /github/workspace/.scannerwork
INFO: Load project settings for component key: '...'
INFO: Load project settings for component key: '...' (done) | time=197ms
INFO: Found an active CI vendor: 'Github Actions'
INFO: Load project branches
INFO: Load project branches (done) | time=109ms
INFO: Check ALM binding of project '...'
INFO: Detected project binding: BOUND
INFO: Check ALM binding of project '...' (done) | time=107ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=193ms
INFO: Load branch configuration
INFO: Github event: pull_request
INFO: Auto-configuring pull request 1776
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 28.231s
ERROR: Error during SonarScanner execution
ERROR: Something went wrong while trying to get the pullrequest with key '1776'
ERROR: Caused by: Error 500 on https://sonarcloud.io/api/alm_integration/show_pullrequest?project=...&pullrequestKey=1776 : {"errors":[{"msg":"An unexpected error occurred. Please try again later."}]}
INFO: Final Memory: 6M/24M
INFO: ------------------------------------------------------------------------
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

How can i solve that issue?

Hi Roman,

Welcome to the Community Support!

Did you try again?
Could be a transient error on Github or our side.

Best.

Hi Oliver.

Tried right now - same error

Hi Roman,

Is your project a public project?

Best.

No, that’s a private repositroy

Hello @Roman_Kunashko,

The logs contain an entry of a 403 response when SonarCloud tries to fetch additional information from GitHub about the PR it is scanning.

We authenticate to GitHub using the SonarCloud GitHub application, could you confirm that the application is still installed on your organization and that it has access to the repository you are trying to scan?

1 Like

Hi @TomVanBraband
We have sonarcloud application installed


But when this application enabled i am getting another error:

INFO: Load active rules (done) | time=3369ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 33.912s
INFO: Final Memory: 6M/24M
ERROR: Error during SonarScanner execution
INFO: ------------------------------------------------------------------------
ERROR: You are running CI analysis while Automatic Analysis is enabled. Please consider disabling one or the other.
ERROR: 
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Hello,

I’m not sure I follow, did you already have the application installed but it was not enabled on the correct repository? I would like to understand so that we can improve the onboarding experience.

Regarding the current error you are facing: it seems that Automatic Analysis was enabled when you imported the repository in SonarCloud. You can find more information about the feature and how to disable it here.

1 Like

Yeah, now it works, thanks. Hope you will improve error message text :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.