oshi / oshi

Native Operating System and Hardware Information
https://oshi.ooo
MIT License
4.97k stars 895 forks source link

Sonar GHA is broken #2870

Closed dbwiddis closed 1 month ago

dbwiddis commented 1 month ago

Sonar-maven-plugin is broken since at least 2025-03-22T22:20:08Z. (See Actions.)

Error: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389:sonar (default-cli) on project oshi-parent: Error status returned by url [https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64]: 403 -> [Help 1]

Possibly relevant https://community.sonarsource.com/t/403-after-upgrading-sonar-maven-plugin-to-5-0-0-4389/135514/3 but the same version worked for prior builds and we want to be using sonarcloud.

dbwiddis commented 1 month ago

More useful error:

Warning: Both 'sonar.login' and 'sonar.token' (or the 'SONAR_TOKEN' env variable) are set, but only the latter will be used. [INFO] User cache: /home/runner/.sonar/cache [INFO] Communicating with SonarQube Cloud [INFO] JRE provisioning: os[linux], arch[x86_64] Error: Failed to query JRE metadata: GET https://api.sonarcloud.io/analysis/jres?os=linux&arch=x86_64 failed with HTTP 403. Please check the property sonar.token or the environment variable SONAR_TOKEN.

dbwiddis commented 1 month ago

Sample that maybe we should switch to from command line?

name: My Test Single Project
on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  sonarqube:
    name: SonarQube
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0  
      - name: SonarQubeScan
        uses: SonarSource/sonarqube-scan-action@v4
        env: 
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
hazendaz commented 1 month ago

resolved. I ran the prior failed build rather than changes I made to sonar.yaml since that one is being ignored until some other code change so please test that again. The real issue is that sonar expires tokens more frequently and its possible it was mine, I revoked all tokens a few weeks ago. Anyway, at least the failed build is up and running, feel free to close once some other change confirms additional changes I made are successful.

hazendaz commented 1 month ago

confirmed, resolved, closing.