one of the branches has The last analysis has warnings.: The token used for this analysis will expire on: July 29, 2026
After this date, the token can no longer be used to execute the analysis. Please consider generating a new token and updating it in the locations where it is in use.
Idk what is this about and what to do. what token will expire? how to locate this token? what is the token name? why other branches or other projects don’t have this message? Please help me to clarify what is this message about and how to generate a new token. thank you!
This warning is about the token that is passed to the Sonar Scanner to run the analysis against the server. The Sonar Scanner is invoked in your CI pipeline, so that’s usually where the token is configured too, as a secret or environment variable (SONAR_TOKEN) that is set in the CI pipeline.
It’s possible that you only see this warning for this project and this branch because other projects use other tokens (configured on your CI system on a per-project basis) or because you have some logic in your CI script that passes different tokens depending on the branch. Of course, it’s also possible that it’s simply because you haven’t analyze the other branches or projects in a while, and haven’t triggered it yet.
Once you have located the token, you can see to which user it belongs like this: curl -u "${SONAR_TOKEN}:" "https:///api/users/current". Once you have found which user it is, if you are a SonarQube admin, you can see all tokens for that user in Administration > Security > Users > Tokens (3 dots).