Facing NPE ClangDriver.envListToMap

I’ve getting a very similar error. We use gcc on Red Hat 7.9 Linux. Sonar Scanner v3.0.3.778 Build wrapper v4.7. What is the following error message trying to tell me? What do I need to check/change?

java.lang.NullPointerException at com.sonar.cpp.analyzer.ClangDriver.envListToMap(ClangDriver.java:500)

Hi @willb ,

are you using SonarCloud or SonarQube? If you are using SonarQube, what version are you using?

SonarQube v7.9.1 (Build 27448) Enterprise edition.

Hi @willb ,

that’s a pretty old version of SonarQube and build-wrapper that you are using. I invite you to give it a try with a newer version of SonarQube and see if you still face the problem.

Yes, it’s old but I have no control over that unfortunately. I have to get this version working. I think it will work on my part, but I need some help with what to look for and where, and what to try. How can I find out what sort of thing the null pointer is supposed to be pointing to? Please could you tell me what line 500 is referring to?

What version of build-wrapper are you using?

Build wrapper 4.7

Please make sure you use the latest version of sonar-cfamily-plugin and build-wrapper, you should always download build-wrapper from the server each analysis, to make sure you are using the up-to-date version.

Ok thanks. What is the latest version of the build wrapper that SonarQube 3.0.3.778 provides?

Hi @willb ,

I think that this is the version of the sonar-scanner.

You can check the version of the sonar-cfamily-plugin in your SonarQube server to know the version of the build-wrapper you should use.

Thanks. I updated the build-wrapper by downloading the latest from the server. I now have a 2019 version instead of the old 2017 one. This fixed the issue. Thank you.

1 Like

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