I have created a bitbucket pipeline for one of my repository but the analysis always failed with ERROR

Hello,
I have created a bitbucket pipeline for one of my repository but the analysis always failed with ERROR.
I had tired to make the changes in YML file and rerun the pipeline but still not able to resolve and complete the scanning process.
Here I’m attaching the screenshot of the error.
Please help and pass your information on the same.

Thank You.

Hello Team,
Please provide any solution, I’m stucked in it from last three days.

Thank in advance.

Hello Team,

I need to configure sonar cloud.
So, Please provide your valuable update on this.

#Scanner #help #help:sc #scanner
Thank in advance.

Hi @Satish_Appsquadz, welcome to the community forum.

Could you please re-run the task with the “-X” switch as advised in the logs, and post the full logs here?

Hello @Claire_Villard ,
Firstly, I would like to say thanks for the reply.
I tried to enable the debug mode but how to enable this “-X”. I doesn’t find any doc related to this.
Please help me to resolve this.

If you are using the sonarsource/sonarcloud-scan pipe to run the scan, you can add the DEBUG: 'true' variable to the pipe definition.

- pipe: sonarsource/sonarcloud-scan:1.2.2
  variables:
    DEBUG: 'true'

If you use the sonar-scanner command line, adding -X, --verbose , or -Dsonar.verbose=true to the command line does the same.

@Claire_Villard , I already set the DEBUG TRUE but error is same.

  • pipe: sonarsource/sonarcloud-scan:1.2.2
    variables:
    DEBUG: “true”
    VERBOSE: “true”
    SONAR_SCANNER_OPTS: “-Xmx2048m”
    SONAR_TOKEN: ‘{MY_TOKEN}’

and I also tried

  • pipe: sonarsource/sonarcloud-scan:1.2.2
    variables:
    DEBUG: ‘true’
    VERBOSE: ‘true’
    SONAR_SCANNER_OPTS: ‘-Xmx2048m’
    #SONAR_TOKEN: ‘{MY_TOKEN}’

Can I share the yml file so that you can check.

Yes, this flag won’t solve the error, but make the execution logs more precise. Could you please post those logs here?

The Max upload size of attachment is 4MB so I’m sharing you the link for the same.
So please get the LOG file from the link.

Here is a Log file:

Greeting of the @Claire_Villard ,

Have you go through this file, I’m stuck in implementing this.

Hi,

At the very end of the logs, there is this message:

15:09:18.800 ERROR: 

The only way to get an accurate analysis of C/C++/Objective-C files is by using the SonarSource build-wrapper and setting the property "sonar.cfamily.build-wrapper-output" or by using Clang Compilation Database and setting the property "sonar.cfamily.compile-commands". None of these two options were specified.

If you don't want to analyze C/C++/Objective-C files, then prevent them from being analyzed by setting the following properties:

    sonar.c.file.suffixes=-
    sonar.cpp.file.suffixes=-
    sonar.objc.file.suffixes=-

If your project contain C, C++ or ObjectiveC files, you should not use the sonarcloud-scan pipe, but the Sonar Build Wrapper.
I recommend to import the project from BitBucket onto SonarCloud, and then to follow the tutorial to configure the analysis with BitBucket pipelines.
At the third step, when creating the pipeline, please choose the C, C++ or ObjC option and use the the pipeline example provided by SonarCloud. Do not forget to replace <insert_your_clean_build_command> by yours on this line of the example:

build-wrapper-linux-x86-64 --out-dir $BW_OUTPUT <insert_your_clean_build_command>

Thanks for the information @Claire_Villard , Hopefully this will resolve the problem.

Can you please share the documentation related to configure the project(coded in Swift + Objective C language) with the Sonar Build Wrapper.

Also, In case of any query, I will share that in the same thread.

The tutorial provides you an example of pipeline with all the needed configuration, except for the build command that is specific to your project and not to SonarCloud.

All the SonarCloud documentation is online here: https://sonarcloud.io/documentation
The advanced setup documentation for C, C++, ObjC languages is here, if ever the example is not enough for your needs.

@Claire_Villard
Thanks a lot, I will go through this and let you know accordingly.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.