Gitlab SonarCloud Pipeline failure

Hi,

I have been given access in SonarCloud of a Gitlab project of which I am an owner through. I have set up a pipeline in Gitlab for Sonar Analysis. All configuration and setup was done as per the Analysis guideline in SonarCloud. This setup was worked for my other testing project which was public. But in this piepeline I am getting the below error.

INFO: EXECUTION FAILURE

[82](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L82) INFO: ------------------------------------------------------------------------

[83](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L83) INFO: Total time: 36.640s

[84](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L84) INFO: Final Memory: 21M/69M

[85](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L85) INFO: ------------------------------------------------------------------------

[86](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L86) ERROR: Error during SonarScanner execution

[87](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L87) ERROR: You're not authorized to run analysis. Please contact the project administrator.

[88](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L88) ERROR:

[89](https://gitlab.com/third-eye-dev-group/syra-consumer/-/jobs/513544739#L89) ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

m/third-eye-dev-group/syra-consumer/-/jobs/513544739#L95) ERROR: Job failed: exit code 1

Could you please help me what is to be done in SonarCloud UI to make this work. Is there any special access my sonar account is to be given to get the pipeline working. Need your urgent assistance.

Hello @thirdeyedataanalytic,

The account you used to generate the token you provided to GitLab should have the permission to “Execute Analysis”. This permission can be given by the project administrator by going to the relevant project on SonarCloud and navigating to Administration > Permissions.

Hope that helps,
Tom

Thanks Tom. Now I have come up with below error:
ERROR: Error during SonarScanner execution

334 java.lang.OutOfMemoryError: Java heap space.
Could u pls help.

I have also added sonar.exclusions=**/*.java to sonar-scanner-cli/conf/sonar-scanner.properties. Still the same error.

FYI. I am using Gitlab shared runner for the analysis and the CI/CD pipeline

Hello @thirdeyedataanalytic,

Do you confirm that the Gitlab shared runner has 4 GB of available memory? Could you share the full log output?

Hi Tom,

As per the Gitlab documentation, below are the shared runner configuration:

All your CI/CD jobs run on [n1-standard-1 instances](https://cloud.google.com/compute/docs/machine-types) with 3.75GB of RAM, CoreOS and the latest Docker Engine installed. Instances provide 1 vCPU and 25GB of HDD disk space.

Please find the attached output.pipeline_error.txt (11.5 KB)

Hello @thirdeyedataanalytic,

Thanks, my guess is that the frontend/assets/dist/plugins/global/plugins.bundle.js fie is just too big. Does this file need to be analyzed? Otherwise you can add this to your exclusions.

Many Thanks @TomVanBraband. The suggestion has worked. Just one more query:

I have been added to the organization by my colleague who has created the paid sonarcloud account. He has provided me all the access so that I can add other project members and set customized quality checks. But I am unable to do both. Please find the screenshot.

I am not finding any option to add members or create quality gates as compared to the access I have for my personal account. How can I achieve a complete administrative access to add other members of gitlab organization in the sonarcloud account.

Hello @thirdeyedataanalytic,

Glad to hear that worked.

You are a member of the organization, but you do not have Administer organization permission. You should ask your colleague to give you those permissions, he can do this by navigating to the Organization > Administration > Permission.

Many Thanks Tom for all the assistance. Your suggestions have worked for us.

1 Like