Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-13516

Improve logs when GitHub pull request decoration fails

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.5
    • Component/s: None
    • Labels:
      None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      We have a lot of posts regarding problems with pull request decoration. Users have difficulty troubleshooting it when something goes wrong. Our logs should provide much better guidance in identifying the root cause of a failure, possibly with instructions on how to solve it.

      We need to review past topics and also test common failures to come up with specific log messages. 

      Invalid private key

      UI warning: Pull request decoration failed: Invalid Github Application private key. Contact your SonarQube administrator to fix the Github App configuration.
      Logs:

       WARN ce[AXM6IkzdkZWBham0h4nU][c.s.C.D.E.A] Pull request decoration failed
       Caused by: java.lang.IllegalArgumentException: Invalid Github Application private key
       Caused by: java.lang.IllegalArgumentException: Failed to decode Github Application private key

      Wrong repository ID

      UI warning: Pull request decoration failed: can't access the GitHub repository '{repo ID}'. Check that the repo ID is correct and that the GitHub App has permissions to access it.
      Logs:

       WARN ce[AXM6fv1oRX8PKt8B4X0I][c.s.C.B.B.A.A.E] GET response did not have expected HTTP code (was 404): {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.18/v3/apps/#find-repository-installation"}
       WARN ce[AXM6fv1oRX8PKt8B4X0I][c.s.C.D.E.A] Pull request decoration failed
       java.lang.IllegalStateException: Pull request decoration failed: Pull request decoration failed: can't access the GitHub repository '{repo ID}'. Check that the repo ID is correct and that the GitHub App has permissions to access it.

       

      App doesn't have access to repository

      UI warning: Pull request decoration failed: can't access the GitHub repository '{repo ID}'. Check that the repo ID is correct and that the GitHub App has permissions to access it.

      Logs:

       WARN ce[AXM6iwlSRX8PKt8B4X0V][c.s.C.B.B.A.A.E] GET response did not have expected HTTP code (was 404): {"message":"Not Found","documentation_url":"https://developer.github.com/enterprise/2.18/v3/apps/#find-repository-installation"}
       WARN ce[AXM6iwlSRX8PKt8B4X0V][c.s.C.D.E.A] Pull request decoration failed
       java.lang.IllegalStateException: Pull request decoration failed: Pull request decoration failed: can't access the GitHub repository '{repo ID}'. Check that the repo ID is correct and that the GitHub App has permissions to access it.

      Wrong GitHub Client ID / Secret

      (no effect in PR decoration)

      Wrong App ID

      UI warning: Pull request decoration failed: can't find GitHub App. Contact your SonarQube administrator to fix the Github App configuration.
      Logs:

       WARN ce[AXM6gdTIRX8PKt8B4X0L][c.s.C.B.B.A.A.E] GET response did not have expected HTTP code (was 401): {"message":"A JSON web token could not be decoded","documentation_url":"https://developer.github.com/enterprise/2.18/v3"}
       WARN ce[AXM6gdTIRX8PKt8B4X0L][c.s.C.D.E.A] Pull request decoration failed
       java.lang.IllegalStateException: Failed to find details about the GitHub App. Check in the Global configuration the URL, App ID and Private Key

       

      Wrong URL

      UI warning: Pull request decoration failed: can't find GitHub App. Contact your SonarQube administrator to fix the Github App configuration.

      Logs: 

       WARN ce[AXM6h4ovRX8PKt8B4X0R][c.s.C.B.B.A.A.E] GET response did not have expected HTTP code (was 406): 
       WARN ce[AXM6h4ovRX8PKt8B4X0R][c.s.C.D.E.A] Pull request decoration failed
       java.lang.IllegalStateException: Failed to find details about the GitHub App. Check in the Global configuration the URL, App ID and Private Key

      GitHub App not installed anywhere

      UI warning: Pull request decoration failed: GitHub Application has no installations. Contact your SonarQube administrator to fix the problem.
      Logs:

      WARN ce[AXM6jlF8RX8PKt8B4X0X][c.s.C.D.E.A] Pull request decoration failed
       java.lang.IllegalStateException: Github Application has 0 installations.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duarte.meneses Duarte Meneses
              Reporter:
              duarte.meneses Duarte Meneses
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: