Getting scan errors on large *.go files: The file size is too big

I am getting scan error on large *.go files. Error message is "ERROR: Unable to parse file: file:///**/admin_bundle.go.
ERROR: The file size is too big and should be excluded, its size is 2175478 (maximum allowed is 700000 bytes)

I am on Sonarqube Version 8.1. I am using sonar-scanner-4.3.0.2102 to do a scan. just a basic “sonar-scanner -Dsonar.projectBaseDir” command. nothing fancy in sonar-project.properties (list below). Any idea what might be causing this?

sonar.projectKey=
sonar.nodejs.executable=<node.exe>
sonar.java.binaries=<java/bin>
sonar.sourceEncoding=UTF-8
sonar.host.url=<host_url>
sonar.login=<sonar_api_token>
sonar.sources=.

1 Like

Same issue here: “maximum allowed is 700000 bytes”. Sonarqube community edition 8.5.0.37579, sonar-scanner version 4.5.0.2216

Hello,

Is the file exceeding the maximum size one that you own, or expect to be analyzed?

If no, you should probably redefine your inclusions/exclusions, to something more specific. More information here: Narrowing the Focus.

For me it’s a yes to both questions. The file is owned and expected to be analyzed.

Out of curiosity, what is the size of the file?

This limitation is due to the JSON parser we are using during the analysis process, I’m afraid that for now, you don’t have another choice than excluding this file from the analysis.

I created a ticket to improve the situation (SONARSLANG-521), but be aware that it will only slightly increase the limit, supporting arbitrary large files is another story.