# java.lang.IllegalArgumentException: 88 is not a valid line offset for pointer

**URL:** <https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924>\
**Category:** SonarQube Cloud\
**Tags:** msbuild, scanner, sonarqube-cloud\
**Created:** [September 25, 2020, 9:04am UTC](https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924 "2020-09-25T09:04:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VicZhang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/viczhang/32/15505_2.png) [@VicZhang](https://community.sonarsource.com/u/VicZhang)\
**Post date:** [September 25, 2020, 9:04am UTC](https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924/1 "2020-09-25T09:04:08Z")

</div>

Details:

- versions used:
  - SonarCloud and GitHub

- Sonar MSBuild
  - [https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.10.0.19059/sonar-scanner-msbuild-4.10.0.19059-net46.zip](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.10.0.19059/sonar-scanner-msbuild-4.10.0.19059-net46.zip)

- error observed

> **15:23:38** ERROR: Error during SonarScanner execution **15:23:38** java.lang.IllegalArgumentException: 88 is not a valid line offset for pointer. File xxxx/Properties/AssemblyInfo.cs has 87 character(s) at line 23 **15:23:38** at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:29) **15:23:38** at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:325) **15:23:38** at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:258) **15:23:38** at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:274) **15:23:38** at org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange(SensorContextUtils.java:43) **15:23:38** at org.sonarsource.dotnet.shared.plugins.protobuf.CPDTokensImporter.consumeFor(CPDTokensImporter.java:48) **15:23:38** at org.sonarsource.dotnet.shared.plugins.protobuf.CPDTokensImporter.consumeFor(CPDTokensImporter.java:34) **15:23:38** at org.sonarsource.dotnet.shared.plugins.protobuf.ProtobufImporter.consume(ProtobufImporter.java:73) **15:23:38** at org.sonarsource.dotnet.shared.plugins.protobuf.RawProtobufImporter.accept(RawProtobufImporter.java:49) **15:23:38** at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.parseProtobuf(ProtobufDataImporter.java:103) **15:23:38** at org.sonarsource.dotnet.shared.plugins.ProtobufDataImporter.importResults(ProtobufDataImporter.java:74) **15:23:38** at org.sonarsource.dotnet.shared.plugins.DotNetSensor.executeInternal(DotNetSensor.java:93) **15:23:38** at org.sonarsource.dotnet.shared.plugins.DotNetSensor.execute(DotNetSensor.java:71) **15:23:38** at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:45) **15:23:38** at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(ProjectSensorsExecutor.java:38) **15:23:38** at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:378) **15:23:38** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122) **15:23:38** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108) **15:23:38** at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:126) **15:23:38** at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:122) **15:23:38** at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:108) **15:23:38** at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58) **15:23:38** at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52) **15:23:38** at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46) **15:23:38** at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) **15:23:38** at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) **15:23:38** at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) **15:23:38** at java.lang.reflect.Method.invoke(Method.java:498) **15:23:38** at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60) **15:23:38** at com.sun.proxy.$Proxy0.execute(Unknown Source) **15:23:38** at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189) **15:23:38** at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138) **15:23:38** at org.sonarsource.scanner.cli.Main.execute(Main.java:112) **15:23:38** at org.sonarsource.scanner.cli.Main.execute(Main.java:75) **15:23:38** at org.sonarsource.scanner.cli.Main.main(Main.java:61) **15:23:38** ERROR: **15:23:38** The SonarQube Scanner did not complete successfully

Note:  
Scan the same repository on my own development machine works fine, but on CI machine, the error occurs

Steps to reproduce

1. Existing project in SonarCloud
2. Clone a GitHub repository
3. Run powershell commands to update AssemblyInfo.cs like

> $content = Get-Content -Path $assemblyInfoFile
> 
> ```
> $props = @{'AssemblyVersion' = $version; 'AssemblyFileVersion' = $version; 'AssemblyCopyright' = $copyright}
> 
> foreach($prop in $props.Keys) {
> 
> $regex = $prop + '.*?\(.*?\)'
> 
> $value = $prop + '("' + $props.Item($prop) + '")'
> 
> $content = $content -replace $regex, $value
> 
> }
> 
> Set-Content -Path $assemblyInfoFile -Value $content -Encoding UTF8 -Force
> 
> ```

1. Run SonarScanner.MSBuild.exe begin/end and msbuild commands to scan projects

---

<div class="post-metadata">

**Author:** ![mickaelcaro](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/mickaelcaro/32/4147_2.png) [@mickaelcaro](https://community.sonarsource.com/u/mickaelcaro)\
**Post date:** [September 25, 2020, 1:52pm UTC](https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924/5 "2020-09-25T13:52:16Z")

</div>

Hi @VicZhang and welcome to the community !

From our past experience, this error happen most of the time when the given file is modified between the begin and the end step of the analysis. Is that your case ?

Thank you.

---

<div class="post-metadata">

**Author:** ![VicZhang](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/viczhang/32/15505_2.png) [@VicZhang](https://community.sonarsource.com/u/VicZhang)\
**Post date:** [September 27, 2020, 1:23am UTC](https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924/6 "2020-09-27T01:23:41Z")

</div>

Got it. Yeah, the Jenkins CI pipeline does modify the version, copyright etc of AssemblyInfo.cs file during building between begin and end commands. Thanks a lot.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [October 4, 2020, 1:23am UTC](https://community.sonarsource.com/t/java-lang-illegalargumentexception-88-is-not-a-valid-line-offset-for-pointer/31924/7 "2020-10-04T01:23:56Z")

</div>

Closed on October 4, 2020, 1:23am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
