Line 128 is out of range in the file batch

A couple weeks after upgrading from 7.7 to 8.2, we started to see the following error:
“[error]java.lang.IllegalStateException: Line 128 is out of range in the file batch”
If we do a server restart the issue goes away for a couple days, but then returns.
A service stop/start does not help, only a server restart. The CPU/Memory usages is always under 50%
for both.

Hi,

Welcome to the community!

Could we have a little more context on this? What language are we talking about? And… I guess you’re seeing this server-side? Or during analysis on the build machine?

 
Ann

C# is the language, during analysis on the build machine. We ended up opening a ticket, and just replied with the following: “We think we found the issue. It appears that SonarQube is putting a file in the build directory and not cleaning it out between builds, or not pulling down the latest version of the code to analyze. We saw that the old file in the build directory had 128 lines in it, but the code from the latest build to analyze had 127 lines (due to recent changes). As a result, SonarQube tried to read 128 lines. We found another build (different solution) with the same issue (trying to read 284 lines when a recent change made the file 283 lines). We have multiple build servers, so we were only seeing this issue when SonarQube hit a build server that had an old file on it that was larger than what the current file is. We changed the checkout options in the build pipeline to clean the repo on checkout (which removes the files in the build directory) and that resolved the read past file issue.” Waiting to hear if what we found is a bug (in 8.2). In the meantime, the workaround is working for us.

Hi,

I’m glad you found a workaround & thanks for the thorough response.

 
Ann