Error while using build-wrapper-linux-x86 for C Code | execvp: No such file or directory

Trying to setup sonarqube for my makefile C project, using the sample Jenkinsfile shared
Jenkinsfile.txt (613 Bytes)
Error seen sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make clean build-wrapper: execvp: No such file or directory

My directory structure is as follows-
sonar
project_folders
Makefile
bw_output

When executing the cmds mentioned in the Jenkinsfile locally, i am able to build successfully, without any issues. I have logs for both (the success case locally & the error case on the Jenkins server) and can be shared via DM.

Things tried already -
Verified the presence of build-wrapper at the correct location
Veried read/write/execute cmd for all relevant folders.
Relative paths replaced with absolute paths.

Hi,

Welcome to the community!

Is that all the error says? Is there nothing after that? Because I suspect this is related to permissions. Does the user account running analysis on the build agent have full permissions to the workspace, recursive?

What happens if you delete the bw_output directory from your project? I assume it’s only there to give the build-wrapper a place to output to, but I believe the build-wrapper will create its output directory, so there shouldn’t be a need to provide it with a pre-created directory.

 
Ann

Thanks Ann,
The error doesnt say anything else
"+ sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output make clean
build-wrapper: execvp: No such file or directory
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Posting build status of FAILED to Bitbucket Server for commit id [5c7a06364d3b42390d3786871fdee65a179efb10] and ref ‘refs/heads/sonarqube_test’
Finished: FAILURE"

I dont think it is a user account based permission issue as it is able to previous cmds without any issues. I have checked the permissions of the specific file & folder as i have mentioned before, they seem to be fine.

You are right bw_output is being created by buildt-wrapper itself. I didnt provide it myself, that was just for representation.

Hi,

Okay, can you provide your versions (SonarQube and the scanner) and the full analysis log, please?

 
Ann

Unable to attach, “Sorry, there was an error uploading build-wrapper_fail.log.txt. Please try again.” any way of DMing or mailing you?

I’m using sonarqube via plugin in jenkins, integrated with Bitbucket so i’m assuming the versions are latest.

Hi,

You can check your SonarQube page footer for your SonarQube version. Your scanner version will show up toward the top of your analysis log.

And for that log, can you try zipping it?

Also, what’s your Linux distribution? It’s not Alpine, is it? We don’t currently support C analysis on Alpine.

 
Ann

Hi Ann,

“Sonarqube Enterprise Edition Version 9.9.1 (build 69595)” distro is Ubuntu.
sonarqube_logs.zip (5.4 KB)
Yes, zipping worked.

Hi,

Thanks for the build-wrapper files. What I’m looking for is your analysis log.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann

Hi,

If you check the Jenkinsfile attached, you can see that the current issue is in “build” stage, before it has had a chance to move to the stage(‘SonarQube Analysis’). That is where i think the analysis will happen, right?

Hi,

It seems like you’re probably affected by this:

CPP-4893 Support CFamily analysis on Alpine

 
HTH,
Ann

Hi,

Can you point me in the log where it says we are using Alpine?

Regards,
Nitish

Hi,

Your title and first post say “execvp: No such file or directory, which seem to correspond to the issue I linked.

On the other hand, your “failed” dump does not show such an error, just an empty json (so the build wrapper did run).

Can you try running the clean beforehand, and only wrapping the make?

 
Ann