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.
Sadly no steps to reproduce other than running it. It happens randomly and not all the time but is creating a lot of inconsistent results with SonarQube due to missed scans.
Some extra details is that since we’re a monorepo I set it up to be individual projects. Not sure if we’re hitting some invisible limit. Have not been able to find a similar topic. Maybe the GITHUB CI/CD is failing to pass the secret sometimes. I am unsure at this point.
You say this behavior is inconsistent. Does that mean that for any given project sometimes it fails and sometimes it succeeds? Or are the errors, perhaps, clustered in specific projects?
Any given project it fails randomly. I can update a PR and it will be one or more of the jobs that fail or it will all succeed. Gathering some data I can see it happens possibly significantly more on our test client jobs. But I’ve seen it happen on every SonarQube job we have since we implemented them recently.
Given the inconsistency, I suspect something “helpful” on your network is interfering. I would start by checking your $SONARQUBE-HOME/logs/access.log` to see if the calls actually make it to SonarQube and it’s SonarQube actually returning the 403s.
I’m not seeing any /logs/ being populated by the SonarQube action. I looked through the source of the action and nothing stands out. I’ve logged every possible sonar location on the runner. I’ve figured out how to enable --debug with the action and that’s giving some details. Trying to get it to fail again with that flag. Tried logging out ubuntu NetworkManager logs. Not really sure how else to gather this network data.
We’re new to GitHub Actions and we’re seeing this issue consistently when trying to migrate our java pipelines
Bizarrely it works locally using the same SONAR_TOKEN, but not on GitHub actions. Secrets are setup correctly
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.
Our investigations show that the IPs that are used in Github Actions are blocked in AWS due to its reputation (maybe someone used the same actions for some suspicious activity and AWS added them in the block list).
Unfortunately, we’re all kinda in the middle here.
Probably the best course is that you each raise this with GitHub.
Happy to hear back! That’s a fairly tough outcome. Appreciate the investigation. I thought this might be the case but was hoping it was as easy as whitelisting some IP’s in your cloud config. Seems like we’re stuck in a AWS vs Azure situation. We’ll try to contact Github. Maybe we can host our own runner elsewhere.