SonarQube Server version: 10.3
Sonar scanner version: 4.0.1
Since version 4.0 was published we are receiving the following error in every scan attempt, at the very beginning of the scan, for some of our projects:
[INFO] Bootstrapper: Retrieving info from “package.json” file
[ERROR] Bootstrapper: An error occurred: Error: slugify: string argument expected
After some testing we found that the problem is happening when the scan is processing a ‘package.json’ file that is found in the root of the working directory. That package.json doesn’t contains a name property, and we believe that the lack of that property is triggering the error in this line of the scanner:
Just to be sure I understand – are you setting sonar.projectKey somewhere else? LIke a sonar-project.properties file or a command line parameter (-Dsonar.projectKey=...)
Hello Collin,
We have a sonar-project.properties file that contains the project key & name, but according to our tests, the issue appears always, no matter if you set project.key in the command line or in the sonar-project.properties. As soon as it starts processing the package.json that does not contains any name property it crashes.