-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR_BUFFER_OUT_OF_BOUNDS error with Google Vision package on Node 22.7.0 #54518
Comments
Hi! Can you make a reproduction without using any dependencies? |
Here is an example using purely Buffer.
Using 22.7.0
Using 22.5
|
Thanks! @nodejs/buffer PTAL |
i dont know if my issue has something to do with this, but since 22.7 the encoding of buffers wont work anymore.
even expressjs delivers garbage. yesterday, i build my app on node:22-alpine and all works fine. all is broken. nothing changed in the code base! btw. "node:20-alpine" works as expected (like node:22-alpine yesterday) |
I was able to reproduce using both your snippet, and the slightly modified one below: Buffer.from("abc").utf8Write("abc", 1) $ node repro.js
node:internal/buffer:1066
throw new ERR_BUFFER_OUT_OF_BOUNDS('length');
^
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: "length" is outside of buffer bounds
at proto.utf8Write (node:internal/buffer:1066:13)
at Object.<anonymous> (/repro.js:1:20)
at Module._compile (node:internal/modules/cjs/loader:1546:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
at Module.load (node:internal/modules/cjs/loader:1317:32)
at Module._load (node:internal/modules/cjs/loader:1127:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5)
at node:internal/main/run_main_module:30:49 {
code: 'ERR_BUFFER_OUT_OF_BOUNDS'
}
Node.js v22.7.0 |
Leaving this here as it may help someone, this also happens with OpenTelemetry:
|
Fixes: nodejs#54523 Fixes: nodejs#54518 PR-URL: nodejs#54524
Fixed by #54524 |
We are getting the same thing with Firestore queries when we use the same version. We are downgrading node |
In case helpful - still seeing the const { SecretManagerServiceClient } = require('@google-cloud/secret-manager');
...
const [response] = await (new SecretManagerServiceClient()).accessSecretVersion({
name: secretPath,
}); |
It should be fixed in next week's release (22.8.0) which includes: #54524 as a patch. I will take care of it. |
This reverts commit c597d78. Node.js v22.7.0 has a bug that causes `ERR_BUFFER_OUT_OF_BOUNDS` error. See nodejs/node#54518 for more details.
Did we just witness an example of Hyrum's law? |
|
Fixes: nodejs#54523 Fixes: nodejs#54518 PR-URL: nodejs#54524
This is a temprary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
This is a temporary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
Needs to be pinned until nodejs/node#54518 is resolved. Other references: * protobufjs/protobuf.js#2025 * protobufjs/protobuf.js#2026
Needs to be pinned until nodejs/node#54518 is resolved. Other references: * protobufjs/protobuf.js#2025 * protobufjs/protobuf.js#2026
This is a temporary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
This is a temporary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
This is a temporary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
This is a temporary fix until v22.8.0 is released due to a bug in v22.7.0: nodejs/node#54518
Fixes: #54523 Fixes: #54518 PR-URL: #54524 Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Fixes: #54523 Fixes: #54518 PR-URL: #54524 Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Node 22.7.0 has a bug that causes crashes for google cloud packages: nodejs/node#54518 (comment)
Now that Node.js 22.8 is out, which fixes nodejs/node#54518, we can unpin Node.js 22 again. This commit reverts #80345a1cd11a13a7fa9e7db8230244ed56c78034.
Now that Node.js 22.8 is out, which fixes nodejs/node#54518, we can unpin Node.js 22 again. This commit reverts #80345a1cd11a13a7fa9e7db8230244ed56c78034.
Fixes: nodejs#54523 Fixes: nodejs#54518 PR-URL: nodejs#54524 Reviewed-By: Ethan Arrowood <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Version
22.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
Create a file called test.js with the following content.
Add the
@google-cloud/vision
package to your package.json and runnpm install
.Start via
node test.js
How often does it reproduce? Is there a required condition?
On each NodeJS start
What is the expected behavior? Why is that the expected behavior?
It should not crash.
The same code starts with version 22.5.0, here is the output:
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: