CI triggered analysis not working anymore

Hi,
Since yesterday, all of the analysis tasks run for our project have started to fail.

The reported problem is:
You are running manual analysis while Automatic Analysis is enabled. Please consider disabling one or the other.

I’ve tried to manually run the analysis with Maven, but also with the manual command-line client and the result is the same for both.

If I go to the project administration interface for the analysis method configuration, it is not possible to disable automatic analysis:

Is there any property or flag we can set at a code level to disable automatic analysis? can we do this with some sort of REST API request?

I checked the web interface to see what API endpoints does the web interface hit when disabling autoscan for other projects and managed to forge a request to:
https://sonarcloud.io/api/autoscan/activation

With the following payload:
enable=false&projectKey=kubernetes_client

But the request doesn’t work, I’m getting the following message:

{"errors":[{"msg":"An error has occurred. Please contact your administrator"}]}

So this workaround doesn’t work :frowning_face:

Please, also note that this repository wasn’t created using the “import” option, but manually:

Hello @manusa,

You were incorrectly marked as an Autoscan user on our end, we have corrected this.
Can I ask you how you were launching the scanner before it started failing? Did you supply a token generated by SonarCloud?

Thanks,
Tom

Hi @TomVanBraband,

Thanks for looking into this.

The procedure was exactly the same, it started to fail from one day to another (everything was Ok on Thursday but it began to fail on Friday). I didn’t change anything on the configuration, I can’t say I’m 100% sure if anyone else in the team did (although I’m quite confident no one touched config).

As this scan is triggered from GitHub Actions during pull requests, execution analysis tasks are public and open to any user (GH Actions won’t propagate secrets to PR triggered executions for security, so token can’t be shared).

That’s why my guess is that something was changed in SonarCloud or the sonar execution service that you run server-side and this verification is now performed when before it wasn’t.

The token is still provided for push events in the repo, although it shouldn’t be necessary either, given the security configuration of the project in SonarCloud.

Our issue is now fixed, I was given access to fabric8io organization (long story) and updated a project that already existed there (maybe this was also causing some trouble).

We’ll probably delete this one (https://sonarcloud.io/dashboard?id=kubernetes_client) unless you need to check something else.

Hello @manusa, thanks for getting back to me!

We deployed a change on Friday that introduced the error you were getting, so that’s completely on our side.

Do you by any chance have the permission set that ‘Anyone’ can execute analysis on this project, like in the attached screenshot?

Thanks,
Tom

Hi @TomVanBraband,

Do you by any chance have the permission set that ‘Anyone’ can execute analysis on this project, like in the attached screenshot?

Yes, this is how the permissions are set up. Although for this project I recall setting them up using a permission template at the organization level.

Regarding the Analysis method configuration, I followed this topic before posting this thread. I understand that not having the check-box visible by default is a UX related thing. I strongly encourage to either set manual as the default method for projects created manually, then maybe display the checkbox once the project is analyzed.

We deployed a change on Friday that introduced the error you were getting, so that’s completely on our side.

Just to be clear, I didn’t mean my comment as some sort of blame but to help find out the issue ;).

Thanks again for your help, it’s much appreciated. Also big praise to the team and community behind Sonar.

How do we know if we are marked as Autoscan users? How do we disable Autoscan?
I am using the sonarcloud hosted paid version

Hello @manusa,

I completely agree, and that is the way it is set-up for most projects. Your project is an edge case because of the way your permissions are configured (which are completely valid). We have been able to identify other projects that are in the same situation as yours, so thanks for reporting this issue.

Thanks for the kind words!

1 Like

Hello @imed,

We resolved the issue @manusa had for all other projects that were in the same situation yesterday. Could you have another try?

Thanks,
Tom

Hi @TomVanBraband,
I just manually disabled Autoscan for each project, and everything works now.
Anything I could do organization-wide to keep Autoscan defaulted to off?

Thanks,
Imed

Hello @imed,

We currently do not have that functionality, Autoscan is automatically enabled on your new projects when your project is eligible.

We could consider adding this though, could you share what your reason is to never want Autoscan enabled for any of your projects?

We are triggering a scan in Jenkins with every push or PR through Github hooks, so there is no need for Autoscan in our case.