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

Unhandled promise rejection when writing world to disk #65

Open
IceTank opened this issue Jan 9, 2023 · 1 comment
Open

Unhandled promise rejection when writing world to disk #65

IceTank opened this issue Jan 9, 2023 · 1 comment

Comments

@IceTank
Copy link

IceTank commented Jan 9, 2023

Every once in a while I get this error

RangeError: Write error for undefined : The value of "value" is out of range. It must be >= -128 and <= 127. Received 156
    at new NodeError (node:internal/errors:388:5)
    at writeU_Int8 (node:internal/buffer:738:11)
    at Buffer.writeInt8 (node:internal/buffer:869:10)
    at Object.writer [as i8] (/project_path/node_modules/protodef/src/datatypes/numeric.js:97:25)
    at Object.byteArray (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:56:26)
    at Object.nbtSwitch (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:99:49)
    at Object.nbt (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:114:31)
    at Object.compound (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:5:26)
    at Object.nbtSwitch (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:102:47)
    at Object.nbt (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:114:31)
    at Object.compound (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:5:26)
    at Object.nbtSwitch (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:102:47)
    at nbt (eval at compile (/project_path/node_modules/protodef/src/compiler.js:258:12), <anonymous>:114:31)
    at CompiledProtodef.write (/project_path/node_modules/protodef/src/compiler.js:76:12)
    at e.message (/project_path/node_modules/protodef/src/compiler.js:102:25)
    at tryCatch (/project_path/node_modules/protodef/src/utils.js:50:16)
    at CompiledProtodef.createPacketBuffer (/project_path/node_modules/protodef/src/compiler.js:102:5)
    at Object.writeUncompressed (/project_path/node_modules/prismarine-nbt/nbt.js:36:24)
    at RegionFile._write (/project_path/node_modules/prismarine-provider-anvil/src/region.js:151:34) {
  code: 'ERR_OUT_OF_RANGE'
}

I don't know what might be causing this. Any suggestions on how to debug this issue or what might be causing it? This is running on a 1.12.2 paper server.

@IceTank
Copy link
Author

IceTank commented Apr 12, 2023

Looks like this issue is from trying to write Biomes that have an id bigger then 127. For instance in 1.12.2 swamp hills have the id 134 while prismarine-nbt is trying to write the Biome id to a byte array made out of i8 instead of ui8. I am not sure how this could be fixed as the byte array is probably used for other stuff as well that might break when changing it to a ui8?

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

1 participant