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- to do a scan. just a basic “sonar-scanner -Dsonar.projectBaseDir” command. nothing fancy in (list below). Any idea what might be causing this?


1 Like

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


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.