# C# analyze failed : java.lang.IllegalArgumentException: 60 is not a valid line offset for pointer

**URL:** <https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621>\
**Category:** SonarQube Cloud\
**Tags:** csharp, sonarqube-cloud\
**Created:** [April 24, 2020, 10:13am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621 "2020-04-24T10:13:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolas63](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas63/32/11987_2.png) [@nicolas63](https://community.sonarsource.com/u/nicolas63)\
**Post date:** [April 24, 2020, 10:13am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/1 "2020-04-24T10:13:10Z")

</div>

- versions used (SonarQube, Scanner, Plugin, and any relevant extension)

dotnet-sonarscanner : 4.8.0  
SonarCloud : [https://sonarcloud.io/dashboard?id=jhipster\_jhipster-sample-app-dotnetcore](https://sonarcloud.io/dashboard?id=jhipster_jhipster-sample-app-dotnetcore)

- error observed (wrap logs/code around triple quote ``` for proper formatting)

java.lang.IllegalArgumentException: 60 is not a valid line offset for pointer. File src/JhipsterSampleApplication/Data/ApplicationDatabaseContext.cs has 50 character(s) at line 19

- steps to reproduce

The analyse work locally with SonarQube

- potential workaround

Github Actions :

> **[Revert dotnet scanner version · jhipster/jhipster-dotnetcore@b96021e](https://github.com/jhipster/jhipster-dotnetcore/runs/614887079?check_suite_focus=true)**
>
> JHipster.NET blueprint. Contribute to jhipster/jhipster-dotnetcore development by creating an account on GitHub.

Full log analyse in verbose mode :  
[12\_RUN SONAR ANALYZE on generated app.txt](https://community.sonarsource.com/uploads/short-url/b8Qey5LpWgcSorBgIDEhfaFie5n.txt) (3.1 MB)

---

<div class="post-metadata">

**Author:** ![Andrei\_Epure](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andrei_epure/32/77402_2.png) [@Andrei\_Epure](https://community.sonarsource.com/u/Andrei_Epure)\
**Post date:** [April 29, 2020, 9:27am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/2 "2020-04-29T09:27:51Z")

</div>

thanks @nicolas63, it seems to be related to an open bug we have in the backlog [https://github.com/SonarSource/sonar-dotnet/issues/2484](https://github.com/SonarSource/sonar-dotnet/issues/2484)

---

<div class="post-metadata">

**Author:** ![danieldaeschle](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/danieldaeschle/32/10664_2.png) [@danieldaeschle](https://community.sonarsource.com/u/danieldaeschle)\
**Post date:** [May 8, 2020, 6:42am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/3 "2020-05-08T06:42:58Z")

</div>

Is this fix for the msbuild version as well? I encounter this error with the msbuild version.

---

<div class="post-metadata">

**Author:** ![Andrei\_Epure](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andrei_epure/32/77402_2.png) [@Andrei\_Epure](https://community.sonarsource.com/u/Andrei_Epure)\
**Post date:** [May 8, 2020, 7:41am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/4 "2020-05-08T07:41:17Z")

</div>

hi @danieldaeschle, can you please detail what error you are getting?

---

<div class="post-metadata">

**Author:** ![Andrei\_Epure](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andrei_epure/32/77402_2.png) [@Andrei\_Epure](https://community.sonarsource.com/u/Andrei_Epure)\
**Post date:** [May 8, 2020, 2:25pm UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/6 "2020-05-08T14:25:28Z")

</div>

> [@Andrei\_Epure](#):
>
> thanks @nicolas63, it seems to be related to an open bug we have in the backlog [https://github.com/SonarSource/sonar-dotnet/issues/2484](https://github.com/SonarSource/sonar-dotnet/issues/2484)

Hi @nicolas63

I was wrong there - it’s similar to the #2484 issue, but not the same bug. We’d need more details from you to investigate.

- please give us the verbose output of the `END` step (please run `SonarScanner.MSBuild.exe begin /k:"MyProject" /d:sonar.verbose=true` as the `BEGIN` step, and please attach the output of `END` step)
- please give us the protobuf (`.pb`) files which you find in the `.sonarqube\out\<NUMBER>\output-cs\` directories - the easiest is to do a ZIP archive of the `.sonarqube\out` folder . Please note that the `.sonarqube` folder gets generated during analyses and you can find it in the folder you run the commands from.

---

<div class="post-metadata">

**Author:** ![nicolas63](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas63/32/11987_2.png) [@nicolas63](https://community.sonarsource.com/u/nicolas63)\
**Post date:** [May 8, 2020, 7:19pm UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/7 "2020-05-08T19:19:52Z")

</div>

Hi, I have already share verbose log in my previous message. My error is only on my ci (GithubActions) so how to get .pb ?

---

<div class="post-metadata">

**Author:** ![Andrei\_Epure](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andrei_epure/32/77402_2.png) [@Andrei\_Epure](https://community.sonarsource.com/u/Andrei_Epure)\
**Post date:** [May 11, 2020, 11:52am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/8 "2020-05-11T11:52:30Z")

</div>

> [@nicolas63](#):
>
> Hi, I have already share verbose log in my previous message.

Yes , you’re right.

> [@nicolas63](#):
>
> so how to get .pb ?

On the build machine, in the folder where the SonarCloud scan is done, there’s a `.sonarqube` folder inside which has various metadata for the scanner, including those protobuf files.

However, being an open-source project, we should be able to reproduce your problem ourselves. We’ll get back after we get some time to investigate.

---

<div class="post-metadata">

**Author:** ![nicolas63](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas63/32/11987_2.png) [@nicolas63](https://community.sonarsource.com/u/nicolas63)\
**Post date:** [May 26, 2020, 11:59am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/9 "2020-05-26T11:59:06Z")

</div>

Hi, sorry for the delay.

I have publish here .sonarqube :

> **[jhipster/jhipster-dotnetcore](https://github.com/jhipster/jhipster-dotnetcore/actions/runs/115612198)**
>
> JHipster.NET blueprint. Contribute to jhipster/jhipster-dotnetcore development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![nicolas63](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas63/32/11987_2.png) [@nicolas63](https://community.sonarsource.com/u/nicolas63)\
**Post date:** [May 26, 2020, 12:00pm UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/10 "2020-05-26T12:00:22Z")

</div>

You can download directly here : [https://github.com/jhipster/jhipster-dotnetcore/suites/718841040/artifacts/7099375](https://github.com/jhipster/jhipster-dotnetcore/suites/718841040/artifacts/7099375)

---

<div class="post-metadata">

**Author:** ![Andrei\_Epure](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/andrei_epure/32/77402_2.png) [@Andrei\_Epure](https://community.sonarsource.com/u/Andrei_Epure)\
**Post date:** [May 26, 2020, 1:57pm UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/11 "2020-05-26T13:57:04Z")

</div>

Thanks @nicolas63 for following up. Before investigating on our side, could you take a look at this forum topic: [102 is not a valid line offset for pointer](https://community.sonarsource.com/t/102-is-not-a-valid-line-offset-for-pointer/24342).

Do you have pre and post build events that modify the source code?

If you run

```auto
msbuild foo.sln /p:PreBuildEvent= /p:PostBuildEvent=  

```

will it help ?

---

<div class="post-metadata">

**Author:** ![nicolas63](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/nicolas63/32/11987_2.png) [@nicolas63](https://community.sonarsource.com/u/nicolas63)\
**Post date:** [May 27, 2020, 6:10am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/12 "2020-05-27T06:10:51Z")

</div>

Hi, I have look the other topic and yes i have a ci step who add code, not in post build event but the principle is the same.  
After correct this the sonar analysis work !!

Thanks for your help !

---

<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:** [June 3, 2020, 6:10am UTC](https://community.sonarsource.com/t/c-analyze-failed-java-lang-illegalargumentexception-60-is-not-a-valid-line-offset-for-pointer/23621/13 "2020-06-03T06:10:52Z")

</div>

Closed on June 3, 2020, 6:10am UTC

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