Within the past 2 days since April 13th, my SonarScan action within GitHub Actions has failed with the error ‘1 is not a valid line offset for pointer’. We have been using the action ‘SonarSource/sonarqube-scan-action@v5’ for about a year now with no issues. I tried upgrading the action to version 5.1, with no change. The error suggests that removing any empty first line of any file should resolve the issue, but this has worked previously and it would be quite a pain to go hunt down every file that has an empty line on line 1.
ALM: GitHub
CI System Used: GitHub Actions
Scanner command used: SonarSource/sonarqube-scan-action@v5 and SonarSource/sonarqube-scan-action@v5.1
Language: Typescript
Error Observed:
2025-04-15T19:08:25.4158656Z 19:08:24.710 WARN Failed to parse range Location[file=packages/mobile/src/screens/SettingsScreen/InviteUser/InviteUserScreen.tsx, kind=file, startLine=1, startColumn=1, endLine=1, endColumn=2] for InviteUserScreen.tsx, 1 is not a valid line offset for pointer. File packages/mobile/src/screens/SettingsScreen/InviteUser/InviteUserScreen.tsx has 0 character(s) at line 1
2025-04-15T19:08:25.4158766Z 19:08:24.715 DEBUG Shutting down the worker
Hello @csmith-weavix,
can you make sure the file is utf-8 and also provide the sonar property to ensure the encoding during analysis?
sonar.sourceEncoding=UTF-8
If the host has another default locale, this will affect the way the scanner decodes the file.
Cheers,
Victor
All files in the repository are UTF-8 and I went ahead and added the sonar property with the same result.
From the error log:
File packages/mobile/src/screens/SettingsScreen/InviteUser/InviteUserScreen.tsx has 0 character(s) at line 1
Can you confirm that file has no characters at line 1? Can you also please make sure there are no special/control/hidden characters?

I have confirmed there is an empty line on line 1 of the file. The line has no special characters outside of the carriage-return/newline.
Thanks Colin,
would it be possible to have the full debug logs, please?
21_SonarCloud.txt (18.1 MB)
You will see from these logs that this run was on SonarSource/sonarqube-scan-action@v4.2.1, but I have tried v5 and v5.1 as well with the same results.
1 Like
Are there any updates on this?
My team has also been seeing this issue over the past few weeks in typescript using plain command line (in a github action workflow)… Seems very similar.
Error: ScannerEngine: Error during SonarScanner Engine execution
java.lang.IllegalArgumentException: 1 is not a valid line offset for pointer. File src/app/modules/alert/alert.module.ts has 0 character(s) at line 1
at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:338)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:271)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:287)
at com.sonarsource.architecture.B.A.D.A(na:2153)
at com.sonarsource.architecture.B.A.D.A(na:794)
at com.sonarsource.architecture.B.A.D.A(na:366)
at com.sonarsource.architecture.D.D.A(na:62)
at com.sonarsource.architecture.D.D.A(na:2641)
at com.sonarsource.architecture.A.execute(na:3125)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:63)
at org.sonar.scanner.sensor.ProjectSensorsExecutor.execute(ProjectSensorsExecutor.java:40)
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:160)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:414)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:137)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:52)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:38)
Error: Bootstrapper: An error occurred: Error: Scanner engine failed with code 1
Hi @csmith-weavix,
sorry for the late reply. I’ll write you privately as I may need a small reproducer to see which rule is generating the failing range.
@leap-vaudette pinging @DesignArchitecture as it seems that error comes from the architecture analyzer.