[script:sessionmanage] RangeError: index out of range: 14 + 4 > 15

In our live server, we are experiencing this error every restart. Sometimes it happens within the first 5 minutes or sometimes a few hours, it’s unknown exactly what the cause is but I’m reporting it so hopefully the team can fix it.

Any idea what happens to the server when this error occurs? Does the session manager fail at this point?

Some parts of the stacktrace have been redacted to hide the server specifics.

[script:sessionmanage] RangeError: index out of range: 14 + 4 > 15
[script:sessionmanage] at indexOutOfRange (\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@citizenfx\protobufjs\src\reader.js:13:12)
[script:sessionmanage] at Reader.read_float [as float] (***********\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@citizenfx\protobufjs\src\reader.js:272:15)
[script:sessionmanage] at Type.TransitionToSession_Parameters$decode [as decode] (eval at Codegen **\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@protobufjs\codegen\index.js:1:1), :14:9)
[script:sessionmanage] at Object.TransitionToSession (@sessionmanager-rdr3/sm_server.js:186:47)
[script:sessionmanage] at handleMessage (@sessionmanager-rdr3/sm_server.js:303:33)
[script:sessionmanage] at @sessionmanager-rdr3/sm_server.js:314:27
[script:sessionmanage] at citizen:/scripting/v8/main.js:477:30
[script:sessionmanage] at Number.__cfx_wrap_1479 (citizen:/scripting/v8/main.js:23:12)
[script:sessionmanage] at citizen:/scripting/v8/main.js:29:16
[script:sessionmanage] at citizen:/scripting/v8/main.js:450:3
[script:sessionmanage] RangeError: index out of range: 14 + 4 > 15
[script:sessionmanage] at indexOutOfRange (
\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@citizenfx\protobufjs\src\reader.js:13:12)
[script:sessionmanage] at Reader.read_float [as float] (
\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@citizenfx\protobufjs\src\reader.js:272:15)
[script:sessionmanage] at Type.TransitionToSession_Parameters$decode [as decode] (eval at Codegen (***********\server\resources[CFX][system]\sessionmanager-rdr3\node_modules@protobufjs\codegen\index.js:1:1), :14:9)
[script:sessionmanage] at Object.TransitionToSession (@sessionmanager-rdr3/sm_server.js:186:47)
[script:sessionmanage] at handleMessage (@sessionmanager-rdr3/sm_server.js:303:33)
[script:sessionmanage] at @sessionmanager-rdr3/sm_server.js:314:27
[script:sessionmanage] at citizen:/scripting/v8/main.js:477:30
[script:sessionmanage] at Number.__cfx_wrap_1479 (citizen:/scripting/v8/main.js:23:12)
[script:sessionmanage] at citizen:/scripting/v8/main.js:29:16
[script:sessionmanage] at citizen:/scripting/v8/main.js:450:3

I do experience the same problem on my server, i don’t know if it’s related to this but i have some players that sometimes get pulled into a solo session and can’t be solved until relog.

This is not related to OneSync.

It kind of is but isn’t at the same time, the root cause comes from the use of protobuf.js which is used by the cfx server resources and utilized for packaging and unpacking data for the session. The root cause is a bug in protobuf.js and it can be best described here:

The user describes how the position head can be calculated wrong depending on if the VARINT is a full 10 bytes or not. If this issue is resolved in protobuf it would be a really good improvement for the CFX session manager resource to point to the latest version of protobuf and rebuild/redistribute over NPM.

In the meantime, if someone can figure out how to fix that section of code and send us all the change please do!