New "not a valid line offset for pointer" error on old file

We started receiving this error during PR analysis in the past day:

15:24:39.687 DEBUG The worker thread exited with code 0
15:24:39.687 DEBUG Closing server
15:24:39.688 DEBUG WebSocket connection closed:  (code: 1006)
15:24:39.688 DEBUG WebSocket client disconnected:  with code 1006
15:24:39.688 DEBUG Closed WebSocket connection
15:24:39.689 DEBUG The bridge server shut down
15:24:39.693 INFO  ╔═══╤══════╤═══════════╤══════════╗
15:24:39.693 INFO  ║ # │ Rule │ Time (ms) │ Relative ║
15:24:39.693 INFO  ╚═══╧══════╧═══════════╧══════════╝
15:24:39.693 INFO  
15:24:39.880 DEBUG Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda/0x00007fa9203943c0@656922a0 during JVM shutdown
15:24:39.880 ERROR Error during SonarScanner Engine execution
java.lang.IllegalStateException: Analysis of JS/TS files failed
	at org.sonar.plugins.javascript.analysis.WebSensor.execute(WebSensor.java:175)
	at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:68)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)
	at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)
	at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:74)
	at org.sonar.scanner.spring.SpringComponentContainer.startComponents(SpringComponentContainer.java:208)
	at org.sonar.scanner.spring.SpringComponentContainer.execute(SpringComponentContainer.java:187)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:219)
	at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:214)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:182)
	at org.sonar.scanner.spring.SpringComponentContainer.startComponents(SpringComponentContainer.java:208)
	at org.sonar.scanner.spring.SpringComponentContainer.execute(SpringComponentContainer.java:187)
	at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:480)
	at org.sonar.scanner.spring.SpringComponentContainer.startComponents(SpringComponentContainer.java:208)
	at org.sonar.scanner.spring.SpringComponentContainer.execute(SpringComponentContainer.java:187)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:150)
	at org.sonar.scanner.spring.SpringComponentContainer.startComponents(SpringComponentContainer.java:208)
	at org.sonar.scanner.spring.SpringComponentContainer.execute(SpringComponentContainer.java:187)
	at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:143)
	at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:58)
	at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:42)
Caused by: java.util.concurrent.CompletionException: java.lang.IllegalStateException: WebSocket connection error
	at java.base/java.util.concurrent.CompletableFuture.reportJoin(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture.join(Unknown Source)
	at org.sonar.plugins.javascript.bridge.BridgeServerImpl.analyzeProject(BridgeServerImpl.java:372)
	at org.sonar.plugins.javascript.analysis.WebSensor.analyzeFiles(WebSensor.java:223)
	at org.sonar.plugins.javascript.analysis.WebSensor.execute(WebSensor.java:150)
	... 22 common frames omitted
Caused by: java.lang.IllegalStateException: WebSocket connection error
	at org.sonar.plugins.javascript.analysis.WebSensor$AnalyzeProjectHandler.onError(WebSensor.java:375)
	at org.sonar.plugins.javascript.bridge.JSWebSocketClient.onError(JSWebSocketClient.java:102)
	at org.java_websocket.client.WebSocketClient.onWebsocketError(WebSocketClient.java:698)
	at org.java_websocket.drafts.Draft_6455.logRuntimeException(Draft_6455.java:973)
	at org.java_websocket.drafts.Draft_6455.processFrameText(Draft_6455.java:988)
	at org.java_websocket.drafts.Draft_6455.processFrame(Draft_6455.java:910)
	at org.java_websocket.WebSocketImpl.decodeFrames(WebSocketImpl.java:397)
	at org.java_websocket.WebSocketImpl.decode(WebSocketImpl.java:229)
	at org.java_websocket.client.WebSocketClient.run(WebSocketClient.java:544)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException: 197 is not a valid line offset for pointer. File db/deatil_questions.html has 196 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:343)
	at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:276)
	at org.sonar.plugins.javascript.analysis.AnalysisProcessor.processParsingError(AnalysisProcessor.java:175)
	at org.sonar.plugins.javascript.analysis.AnalysisProcessor.lambda$processResponse$0(AnalysisProcessor.java:96)
	at java.base/java.util.ArrayList.forEach(Unknown Source)
	at org.sonar.plugins.javascript.analysis.AnalysisProcessor.processResponse(AnalysisProcessor.java:96)
	at org.sonar.plugins.javascript.analysis.WebSensor$AnalyzeProjectHandler.handleMessage(WebSensor.java:330)
	at org.sonar.plugins.javascript.bridge.JSWebSocketClient.onMessage(JSWebSocketClient.java:76)
	at org.java_websocket.client.WebSocketClient.onWebsocketMessage(WebSocketClient.java:661)
	at org.java_websocket.drafts.Draft_6455.processFrameText(Draft_6455.java:986)
	... 5 common frames omitted

The file in question contains only valid ASCII characters (attached with .txt extension). It hasn’t been updated in three years. We’ve recently updated from GHA plugin v6 to v7, but we saw successful analyses after that upgrade before encountering this error.

I’ve tried excluding this file from analysis, but analysis still fails with exit code 3 but no visible error message.

deatil_questions.html.txt (10.2 KB)

Hi,

Thanks for providing the file with the initial report! :star_struck:

When I look at it, I’m seeing a lot of explicit \n\t\t characters. That shouldn’t impact the analysis, and they all occur after line 1, where the error happens. But I’m wondering if the file has been munged in transmission.

 
Thx,
Ann

The file looks intact when downloaded from the ticket. Here’s the original file rendered in Cursor:

Here is the file downloaded from the ticket, rendered in TextEdit.

The \n, \t characters are distasteful but intentional and hadn’t caused a problem before last week.

–p.

Hello @pdconant,

thanks for reporting this, indeed there seems to be an issue on how our CSS analyzer handles Macintosh end of line characters (\r). We have fixed the issue and should be released within the next days.

This was not visible until now because CSS parsing errors were silently skipped before last week.

Cheers,
Victor

2 Likes

Hi – any update on this fix? Builds continue to fail for the past week due to this issue.

Hi,

If the fix was committed a week ago with a release in the following few days, I would expect deployment any day. And unfortunately, Europeans take a 4-day weekend for Easter. (Who’s jealous? I’m not jealous. :green_circle:) So that has probably impacted deployment schedules slightly.

 
Ann