Failed to parse file

Hi Team,

We are using SonarQube Community Edition Version 8.9.10.

Our scan fails with Failed to Parse file error:

ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/custom-property-unmatched-block-3.less, line 3, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/import/invalid-css.less, line 1, Unclosed string
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/plugin.less, line 91, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/mixins-interpolated.less, line 28, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/extract-and-length.less, line 126, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/math/strict-legacy/parens.css, line 39, Unclosed bracket
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-15-value.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.Web/Public/Stylesheets/app-default.css, line 35, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-9-expression.less, line 2, Unknown word
INFO: 270/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/views/groupList/mockAnalysisGroupsList/package-detail.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/permissive-parse.less, line 11, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/import-reference.css, line 95, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-8-element.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-3-assignment.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-4-call.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-7-dimension.less, line 2, Unknown word
ERROR: TypeError: Cannot read properties of undefined (reading '0')
ERROR:     at LessParser.atrule (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\parser.js:305:16)
ERROR:     at LessParser.atrule (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-less\lib\LessParser.js:26:11)
ERROR:     at LessParser.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\parser.js:67:16)
ERROR:     at Proxy.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-less\lib\index.js:11:12)
ERROR:     at parser (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-syntax\parser.js:10:22)
ERROR:     at Object.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-syntax\parse.js:28:10)
ERROR:     at new LazyResult (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\lazy-result.js:64:16)
ERROR:     at C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\stylelint\lib\getPostcssResult.js:99:19
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-6-condition.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/property-ie5-hack.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-13-selector.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/functions.css, line 10, Missed semicolon
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-9-expression.less, line 2, Unknown word
INFO: 551/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/views/uiComponents/buttons/SelectButton.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-1.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/custom-property-unmatched-block-2.less, line 3, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/import/invalid-css.less, line 1, Unclosed string
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/property-name-interp.css, line 20, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-15-value.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-5-color-2.less, line 1, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-10-keyword.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-8-element.less, line 2, Unknown word
INFO: 801/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/AdminMain.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-11-operation.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-1.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/parse-error-curly-bracket.less, line 4, Unexpected }
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/parse-error-with-import.less, line 8, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/custom-property-unmatched-block-2.less, line 3, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-13-selector.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-10-keyword.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/plugin.less, line 91, Unknown word
INFO: 1088/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/style.css
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/parse-error-with-import.less, line 8, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-14-url.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/parse-error-media-no-block-3.less, line 1, Unclosed block
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/custom-property-unmatched-block-3.less, line 3, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-12-quoted.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/mixins-interpolated.less, line 28, Unknown word
INFO: 1369/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/data/awardGradeData/CohortGradeAnalysis.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-6-condition.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/math/strict/parens.css, line 36, Unclosed bracket
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/import-inline.css, line 8, Unclosed string
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/single-character.less, line 1, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-7-dimension.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-5-color.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/javascript-undefined-var.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/property-accessors.less, line 59, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/javascript.less, line 12, Unknown word
ERROR: TypeError: Cannot read properties of undefined (reading '0')
ERROR:     at LessParser.atrule (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\parser.js:305:16)
ERROR:     at LessParser.atrule (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-less\lib\LessParser.js:26:11)
ERROR:     at LessParser.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\parser.js:67:16)
ERROR:     at Proxy.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-less\lib\index.js:11:12)
ERROR:     at parser (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-syntax\parser.js:10:22)
ERROR:     at Object.parse (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss-syntax\parse.js:28:10)
ERROR:     at new LazyResult (C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\postcss\lib\lazy-result.js:64:16)
ERROR:     at C:\SonarQube_Files\Source\.scannerwork\css-bundle\node_modules\stylelint\lib\getPostcssResult.js:99:19
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/custom-property-unmatched-block-1.less, line 2, Unclosed bracket
INFO: 1700/2921 files analyzed, current file: Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/directives-bubling.less
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/javascript.less, line 12, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/custom-property-unmatched-block-1.less, line 2, Unclosed bracket
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/property-ie5-hack.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/root-func-undefined-1.less, line 1, Unknown word
INFO: 2009/2921 files analyzed, current file: Edexcel.SkillsMap.ApiService/Areas/HelpPage/Views/Help/DisplayTemplates/ImageSample.cshtml
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-11-operation.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/parse-error-missing-bracket.less, line 1, Unclosed block
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/parse-error-missing-bracket.less, line 1, Unclosed block
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.Web/Public/Stylesheets/default.css, line 21, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/extract-and-length.less, line 126, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/single-character.less, line 1, Unknown word
INFO: 2301/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/views/achievementsAnalysis/singleGroup/GroupAwardNode.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-3-assignment.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/parse-error-media-no-block-3.less, line 1, Unclosed block
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/javascript-undefined-var.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-12-quoted.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/root-func-undefined-2.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/permissive-parse.less, line 11, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/property-accessors.less, line 59, Unknown word
INFO: 2470/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/bin/alert.css
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-14-url.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.Web/Public/Stylesheets/home-default.css, line 333, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/root-func-undefined-1.less, line 1, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/permissive-parse.css, line 8, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/functions-5-color-2.less, line 1, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/browser/css/plugin/plugin.css, line 2, Missed semicolon
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/functions-4-call.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less-bom/errors/parse-error-curly-bracket.less, line 4, Unexpected }
INFO: 2763/2921 files analyzed, current file: Edexcel.ResultsPlus.Flash/documentation/com/edexcel/resultsPlus/views/subjectsList/cohortDetailed/CohortSubjectsSortNode.html
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/less/errors/root-func-undefined-2.less, line 2, Unknown word
ERROR: Failed to parse file:///C:/SonarQube_Files/Source/Edexcel.ResultsPlus.MATS.Web/node_modules/less/test/css/math/parens-division/parens.css, line 36, Unclosed bracket

Please help us to solve this.

Thanks!

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.9.10 → 9.9.1 → 10.1 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

Hi Colin,

Is Upgrading SonarQube version is the only solution or do we have any work around to fix this issue.

Thanks!

We expect users to use a supported version of our software to troubleshoot it! As mentioned:

If your error persists after upgrade, please come back to us.

I am seeing a similar error when using SonarCloud (which presumably would be running the latest sonar version, no?):

INFO: Sensor CSS Rules [javascript]
INFO: 54 source files to be analyzed
ERROR: Failed to parse [REDACTED].sass, line 48, Please check validity of the block starting from line #48
ERROR: Failed to parse [REDACTED].sass, line 227, Please check validity of the block starting from line #227
ERROR: TypeError: Cannot read properties of undefined (reading 'syntax')
ERROR:     at [REDACTED].sass:163:7

Hey @TheMetalCode

Yes, SonarCloud runs the latest versions of our analyzers. If you’re facing a new issue, I suggest raising a new thread including file contents that fail to be parsed.