ERROR: Caused by: Failed to index files Caused by: /app/localstorage/BuildAgent2/work/4b0ae3/src/project/WebApp/links/bash/root

  • I am using SonarQube Runner 2.4
  • SonarQube scanning is failed with the ERROR: Caused by: Failed to index files Caused by: /app/localstorage/BuildAgent2/work/4b0ae3/src/project/WebApp/links/bash/root
  • I have tried to exclude the links directory with the option -Dsonar.exclusions=/links/

But the scan is failing at indexing level, i believe exclusion comes after indexing.

The symbolic link inside our project is referring to root ( links/ bash -> / ) and the sonarqube is failing here to perform indexing

[08:30:01] [Step 4/4] ERROR: Error during Sonar runner execution

[08:30:01] [Step 4/4] ERROR: Unable to execute Sonar

[08:30:01] [Step 4/4] ERROR: Caused by: Failed to index files

[08:30:01] [Step 4/4] ERROR: Caused by: /app/localstorage/BuildAgent2/work/4b0ae3/src/project/WebApp/links/bash/root

[08:30:01] [Step 4/4] ERROR:

[Step 4/4] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.

[08:30:01] [Step 4/4] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

[08:30:01] [Step 4/4] Process exited with code 1

[08:30:02] [Step 4/4] Process exited with code 1 (Step: New build step (SonarQube Runner))

[08:30:02] [Step 4/4] Step New build step (SonarQube Runner) failed

Can someone please help on how to get this solved

Hi,

Please try updating your exclusion to **/links/**/*.*. Also, for the record, exclusions are easier to manage via the UI.

 
Ann

Thanks for your response Ann, i updated my exclusion with **/links/**/*.*
Still it is failed with the same error message.
I see in the debug log, sonarqube has expended all the links till it encountered this link, which is referring to root ( / )

[10:29:35][Step 3/4] 05:29:35.063 DEBUG - ‘src/project/WebApp/links/CORE_LOGWRITER/links/ant/LICENSE’ indexed with language ‘null’
[10:29:35][Step 3/4] 05:29:35.063 DEBUG - ‘src/project/WebApp/links/CORE_LOGWRITER/links/ant/NOTICE’ indexed with language ‘null’
[10:29:35][Step 3/4] 05:29:35.064 DEBUG - ‘src/project/WebApp/links/CORE_LOGWRITER/links/ant/README’ indexed with language ‘null’
[10:29:35][Step 3/4] 05:29:35.064 DEBUG - ‘src/project/WebApp/links/CORE_LOGWRITER/links/ant/WHATSNEW’ indexed with language ‘null’
[10:29:36][Step 3/4] INFO: ------------------------------------------------------------------------
[10:29:36][Step 3/4] INFO: EXECUTION FAILURE
[10:29:36][Step 3/4] INFO: ------------------------------------------------------------------------
[10:29:36][Step 3/4] Total time: 1:07.745s
[10:29:36][Step 3/4] Final Memory: 15M/491M
[10:29:36][Step 3/4] INFO: ------------------------------------------------------------------------
[10:29:36][Step 3/4] ERROR: Error during Sonar runner execution
[10:29:36][Step 3/4] ERROR: Unable to execute Sonar
[10:29:36][Step 3/4] ERROR: Caused by: Failed to index files
[10:29:36][Step 3/4] ERROR: Caused by: /app/localstorage/BuildAgent2/work/4f0ae3/src/project/WebApp/links/CORE_LOGWRITER/links/bash/root
[10:29:36][Step 3/4] ERROR:
[10:29:36][Step 3/4] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
[10:29:36][Step 3/4] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
[10:29:36][Step 3/4] Process exited with code 1
[10:29:37][Step 3/4] Process exited with code 1 (Step: SonarQube Scan (SonarQube Runner))
[10:29:37][Step 3/4] Step SonarQube Scan (SonarQube Runner) failed

Hi,

Could you re-run analysis with either the -X switch or -Dsonar.verbose=true so we have a little more to go on in the error message?

 
Ann

I’m having the same issue too. Could you tell how this issue is resolved?