2

We have just updated to TFS 2017 and I'm going through setting up SonarQube integration into pull requests for our builds. In the process I've come across an issue that I can't seem to figure out.

We have three build servers each with two sets of build agents on them. Let's call them BA1 and BA2. Also, we are using the new SonarQube plugin for TFS not the deprecated one referenced here.

BA2 works perfectly. Haven't had a single problem with generating both incremental and full analysis reports. However, any build that is using BA1 ultimately makes it about halfway through the End Analysis step before failure with a message similar to this:

ERROR: Error during SonarQube Scanner execution
org.sonar.core.util.ContextException: Unable to write message | file=E:\workingDirectory\_work\3\.sonarqube\out\.sonar\batch-report\component-5072.pb

... //long stacktrace

Caused by: java.io.FileNotFoundException: E:\workingDirectory\_work\3\.sonarqube\out\.sonar\batch-report\component-5072.pb (The directory or file cannot be created)

I'm pretty sure it's not a permissions problem because all builds run under the same user account. It doesn't matter which project or build server it runs on. All jobs that run with BA2 are successful. All jobs that run with BA1 fail with this error. I saw a similar question here but the solution to that problem will not work for me. I don't have an issue with another job being queued into the same workspace.

Just trying to see if its possible anyone has run into this before. I've checked the build agent logs under the _diag directory but haven't been able to find anything useful. I've run out of ideas to check. Thanks for any tips.

Community
  • 1
  • 1
tehbeardedone
  • 2,833
  • 1
  • 15
  • 23
  • Could you please share the .agent file of BA1 and BA2? In particular verify that they are not using the same _workingDirectory_ (i.e. e:\workingDirectory) – Luca Cappa Jan 11 '17 at 23:35
  • Are BA1 and BA2 in terms of configuration the same and did you find some pb-files in the directory? – Jeroen Heier Jan 12 '17 at 05:10
  • Could you reproduce this issue if you configure another build agent? – Cece Dong - MSFT Jan 12 '17 at 07:51
  • @Jeroen As far as I can tell the only difference is that the workspace for all BA1 builds are on the `E:` drive and the workspace for BA2 is on the `D:` drive. So the workspace for BA1 is something like `E:\tfs-build01-agent1\_work\ ` and BA2 is `D:\tfs-build01-agent2\_work\`. I haven't tried configuring another agent yet. I can try that to see if it helps. I'm just confused why it's not working anymore. It used to work regardless of the agent used before we updated TFS. – tehbeardedone Jan 12 '17 at 13:57
  • Also, I can see in the logs that some items are being written to the `.sonarqube\out\.sonar` directory but it looks like the first time it tries to write a `.pb` file to the `.sonarqube\out\.sonar\batch-report` directory with BA1 it fails. – tehbeardedone Jan 12 '17 at 14:07
  • Focus on the "writing the pdb files fails" problem. Check for instance if the disk is full, a security error (check the access rights) problems, .... – Jeroen Heier Jan 12 '17 at 16:25
  • Can you share the entired build log? – Eddie Chen - MSFT Jan 16 '17 at 07:57

1 Answers1

1

Turns out that for the builds that were failing the drive (E:) was formatted as a FAT32 RAM drive. The drive wasn't full but we were still hitting some sort of limit on that drive that was causing the builds to fail.

I don't think it was a file count limit because we deleted several files from the directory and tried to add a new one and it wouldn't allow us to add one. When I deleted all files under the batch-report directory it finally allowed me to add files again. I'm assuming it was some sort of directory size limit that was causing the problem. In any case, instead of wasting time trying to figure out exactly what the cause was we reformatted the drive to NTFS and the build issues went away. Thanks everyone for the ideas and tips.

tehbeardedone
  • 2,833
  • 1
  • 15
  • 23