ERROR: Failed to deserialize Protobuf message

Hi,

An error occurs during SonarCloud analysis of a Node.js project:


...
15:20:48.753  INFO: Sensor IaC Shell Sensor [iac] (done) | time=5ms
15:20:48.757  INFO: Sensor JavaScript/TypeScript analysis [javascript]
15:20:49.119  INFO: Detected os: Linux arch: amd64 alpine: false. Platform: LINUX_X64
15:20:49.119  INFO: Deploy location /home/runner/.sonar/js/node-runtime, tagetRuntime: /home/runner/.sonar/js/node-runtime/node,  version: /home/runner/.sonar/js/node-runtime/version.txt
15:20:52.279  INFO: Using embedded Node.js runtime.
15:20:52.28  INFO: Using Node.js executable: '/home/runner/.sonar/js/node-runtime/node'.
15:20:54.289  INFO: Memory configuration: OS (7944 MB), Node.js (2240 MB).
15:20:54.401  INFO: WebSocket client connected on /ws
15:20:54.405  INFO: Plugin version: [11.7.0.36965]
15:22:20.373  ERROR: Failed to deserialize Protobuf message: Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.
15:24:48.457  INFO: JasminAstConsumer done
15:24:48.459  INFO: Hit the cache for 0 out of 3969
...

Tried different scanner versions:

  • sonar-scanner-6.2.1.4610
  • sonar-scanner-7.2.0.5079
  • sonar-scanner-7.3.0.5189
  • sonar-scanner-8.0.1.6346

Please assist.

Hi,

Welcome to the community and thanks for this report!

Could you add -Dsonar.verbose=true to your analysis command line and provide that full log, redacted as necessary, starting from the command itself?

 
Thx,
Ann

Here is a log part:

...
18:04:56.935 DEBUG Cache entry created for key 'js:ast:11.7.0.36965:xxxx.ts'
18:04:56.936 DEBUG Cache entry created for key 'js:filemetadata:11.7.0.36965:xxxx.ts'
18:04:56.936 DEBUG JasminAstConsumer accepted file: xxxx.ts
18:04:57.083 DEBUG Cache entry created for key 'js:ast:11.7.0.36965:xxxx.ts'
18:04:57.086 DEBUG Cache entry created for key 'js:filemetadata:11.7.0.36965:xxxx.ts'
18:04:57.086 DEBUG JasminAstConsumer accepted file: xxxx..ts
18:04:57.214 DEBUG Saving issue for rule S3516 on file xxxx.ts at line xx
18:04:57.214 DEBUG Cache entry created for key 'js:ast:11.7.0.36965:xxxx.ts'
18:04:57.214 DEBUG Cache entry created for key 'js:filemetadata:11.7.0.36965:xxxx..ts'
18:04:57.214 DEBUG JasminAstConsumer accepted file: xxxx.ts
18:04:57.815 DEBUG Cache entry created for key 'js:ast:11.7.0.36965:xxxx..ts'
18:04:57.818 DEBUG Cache entry created for key 'js:filemetadata:11.7.0.36965:xxxx.ts'
18:04:57.819 DEBUG JasminAstConsumer accepted file: xxxx.ts
18:04:58.594 ERROR Failed to deserialize Protobuf message: Protocol message had too many levels of nesting.  May be malicious.  Use setRecursionLimit() to increase the recursion depth limit.
18:04:58.597 DEBUG Saving issue for rule S7772 on file xxxx.ts at line xx
18:04:58.597 DEBUG Saving issue for rule S7735 on file xxxx.ts at line xxx
18:04:58.597 DEBUG Saving issue for rule S6582 on file xxx.ts at line xxx
18:04:58.599 DEBUG Cache entry created for key 'js:ast:11.7.0.36965:xxxx.ts'
18:04:58.601 DEBUG Cache entry created for key 'js:filemetadata:11.7.0.36965:xxxx.ts'
18:04:58.612 DEBUG Saving issue for rule S7772 on file xxx.ts at line xxx
18:04:58.612 DEBUG Saving issue for rule S1874 on file xxxx.ts at line xx
...

Hi,

Could I have the full log, please?

 
Thx,
Ann

How can I share it securely?

Hi,

Feel free to redact as necessary.

 
:slight_smile:
Ann

30+ megabytes redact???

It is a good joke… I guess it is joke.

Please take a look at what you already have. JS scanner collect data and than the error occurs, I think communicating with the server via protobuf causes the error. Scanner tried to parse a message but it can’t. I believe it uses grpc-java library, please look at the following issue Support configuring a deeper recursion limit for protobuf deserialization · Issue #9643 · grpc/grpc-java · GitHub