Skip to content
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

"length" is outside of buffer bounds #2025

Closed
phaistonian opened this issue Aug 23, 2024 · 7 comments
Closed

"length" is outside of buffer bounds #2025

phaistonian opened this issue Aug 23, 2024 · 7 comments

Comments

@phaistonian
Copy link

protobuf.js version: 7.4.0

It appears that the latest nodejs version (22.7.0) triggers this error:

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: "length" is outside of buffer bounds

at

CleanShot 2024-08-23 at 09 21 15@2x

@likezero
Copy link

I have the same error
image

@markkkkas
Copy link

markkkkas commented Aug 23, 2024

We are observing same issue

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: "length" is outside of buffer bounds
    at proto.utf8Write (node:internal/buffer:1066:13)
    at Op.writeStringBuffer [as fn] (/app/node_modules/.pnpm/protobufjs@7.2.4/node_modules/protobufjs/src/writer_buffer.js:61:13)
    at BufferWriter.finish (/app/node_modules/.pnpm/protobufjs@7.2.4/node_modules/protobufjs/src/writer.js:453:14)
    at /app/node_modules/.pnpm/@grpc+proto-loader@0.7.6/node_modules/@grpc/proto-loader/build/src/index.js:152:109
    at Array.map (<anonymous>)
    at createPackageDefinition (/app/node_modules/.pnpm/@grpc+proto-loader@0.7.6/node_modules/@grpc/proto-loader/build/src/index.js:152:39)
    at Object.fromJSON (/app/node_modules/.pnpm/@grpc+proto-loader@0.7.6/node_modules/@grpc/proto-loader/build/src/index.js:205:12)
    at GrpcClient.loadProtoJSON (/app/node_modules/.pnpm/google-gax@4.0.3_encoding@0.1.13/node_modules/google-gax/build/src/grpc.js:228:51)
    at new TranslationServiceClient (/app/node_modules/.pnpm/@google-cloud+translate@8.3.0_encoding@0.1.13/node_modules/@google-cloud/translate/build/src/v3/translation_service_client.js:146:38)
    at new GoogleTranslationService (/app/apps/dist/lib/google-translation.js:55:32)

As a fix, we decided to downgrade node version (22.4.0 works fine).

@cecilulysess
Copy link

Same issue, not necessary to protobufjs@7.4. The error thrown on my 7.3.3

@danielbankhead
Copy link
Contributor

danielbankhead commented Aug 23, 2024

This sounds like an upstream Node issue:

waitingsong added a commit to waitingsong/protobuf.js that referenced this issue Aug 25, 2024
…fer bounds

remove call buf.utf8Write(),  it will be called in buf.write()

ref: protobufjs#2025
waitingsong added a commit to waitingsong/protobuf.js that referenced this issue Aug 25, 2024
…fer bounds since nodejs 22.7

call buf.utf8Write() conditionally,  it will be called in buf.write()

ref: protobufjs#2025
waitingsong added a commit to waitingsong/protobuf.js that referenced this issue Aug 25, 2024
…fer bounds since nodejs 22.7

call buf.utf8Write() conditionally,  it will be called in buf.write()

ref: protobufjs#2025
waitingsong added a commit to waitingsong/protobuf.js that referenced this issue Aug 26, 2024
…fer bounds since nodejs 22.7

call buf.utf8Write() conditionally,  it will be called in buf.write()

ref: protobufjs#2025
aditiharini added a commit to farcasterxyz/hub-monorepo that referenced this issue Aug 26, 2024
## Why is this change needed?

CI is broken because there's some issue with proto serialization in node
22.7.0. I used the same version that's in the hub deployment dockerfile.

protobufjs/protobuf.js#2025

## Merge Checklist

_Choose all relevant options below by adding an `x` now or at any time
before submitting for review_

- [x] PR title adheres to the [conventional
commits](https://www.conventionalcommits.org/en/v1.0.0/) standard
- [ ] PR has a
[changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets)
- [x] PR has been tagged with a change label(s) (i.e. documentation,
feature, bugfix, or chore)
- [ ] PR includes
[documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs)
if necessary.


<!-- start pr-codex -->

---

## PR-Codex overview
This PR updates the Node.js version in the CI workflow to 22.4.1 due to
an issue with 22.7.0. It also specifies different Node.js versions for
x64 and ARM architectures.

### Detailed summary
- Updated Node.js version in CI workflow to 22.4.1
- Added comments about the issue with Node.js 22.7.0
- Specified different Node.js versions for x64 and ARM architectures

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
Lms24 added a commit to getsentry/sentry-javascript that referenced this issue Aug 27, 2024
There's a bug in Node 22.7.0 with protobuf which we're running into:
protobufjs/protobuf.js#2025

Once the bug is fixed, we should revert this PR.

h/t @lforst for figuring this out; I'm just merging it into develop 😅
basti1302 added a commit to dash0hq/opentelemetry-js-distribution that referenced this issue Aug 28, 2024
basti1302 added a commit to dash0hq/opentelemetry-js-distribution that referenced this issue Aug 28, 2024
@nextlevelshit
Copy link

In case you are still experiencing that issues, try these LTS versions:

  • v20.17.0 (april '26)
  • v18.20.4 (april '25)

Everything above looks from my perspective broken and leads to these buffer errors.

@mbrevda
Copy link

mbrevda commented Sep 5, 2024

Also fixed in the latest node (v22.8.0)

haraldkri added a commit to haraldkri/modern_account_system_server that referenced this issue Sep 6, 2024
test will throw errors if you are using an incompatible node version. On version 22.8 it does work as intended.
(a problem with protobufjs: protobufjs/protobuf.js#2025)
@temirrr
Copy link

temirrr commented Sep 10, 2024

@mbrevda thanks, upgrading to v22.8.0 worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants