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

Error: Read error for undefined : array size is abnormally large #3573

Open
rarelywin opened this issue Jan 27, 2025 · 3 comments
Open

Error: Read error for undefined : array size is abnormally large #3573

rarelywin opened this issue Jan 27, 2025 · 3 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f

Comments

@rarelywin
Copy link

trying to open the window on server and getting this

Error: Read error for undefined : array size is abnormally large, not reading: 591808056
at Object.byteArray (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :4253:60)
at Object.nbtSwitch (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :4316:49)
at Object.anonymousNbt (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :82:64)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :159:56)
at Object.SlotComponent (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :755:9)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :774:49)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :779:15)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :797:13)
at Object.Slot (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :799:9)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :1877:34) {
field: 'play.toClient'
}
Error: Read error for undefined : array size is abnormally large, not reading: 591808056
at Object.byteArray (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :4253:60)
at Object.nbtSwitch (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :4316:49)
at Object.anonymousNbt (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :82:64)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :159:56)
at Object.SlotComponent (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :755:9)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :774:49)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :779:15)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :797:13)
at Object.Slot (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :799:9)
at eval (eval at compile (D:..secretproject\holyworldbot\node_modules\protodef\src\compiler.js:262:12), :1877:34) {
field: 'play.toClient'
}
Error: client timed out after 30000 milliseconds
at Timeout._onTimeout (D:..secretproject\holyworldbot\node_modules\minecraft-protocol\src\client\keepalive.js:18:28)
at listOnTimeout (node:internal/timers:594:17)
at process.processTimers (node:internal/timers:529:7)
Error: client timed out after 30000 milliseconds
at Timeout._onTimeout (D:..secretproject\holyworldbot\node_modules\minecraft-protocol\src\client\keepalive.js:18:28)
at listOnTimeout (node:internal/timers:594:17)
at process.processTimers (node:internal/timers:529:7)

my code

const mineflayer = require('mineflayer');
const FlayerCaptcha = require('flayercaptcha');
const mineflayerViewer = require('prismarine-viewer').mineflayer;
const inventoryViewer = require('mineflayer-web-inventory');
const registry = require('prismarine-registry')('1.16');
const ChatMessage = require('prismarine-chat')(registry);

(async () => {
const bot = mineflayer.createBot({ host: 'mc.holyworld.me', port: 25565, username: 'i1232j5v' });

bot.once('login', () => {
    mineflayerViewer(bot, { port: 3001, firstPerson: true });
    inventoryViewer(bot);
    
});
    const captcha = new FlayerCaptcha(bot);
    captcha.on('success', async (image, viewDirection) => {
        await image.toFile('captcha.png');
        console.log('Captcha saved');
    });
    
    bot.on('message', (jsonMSG, position) => {
        if (jsonMSG) {
            console.log(jsonMSG.toString());
        }
    });

    process.stdin.on('data', (data) => {
        const command = data.toString().trim();
        if (command) {
            bot.chat(command);
            console.log(`successful ${command}`);
        }
    });

bot.on('kicked', console.log);
bot.on('error', console.log);

})();

@rarelywin rarelywin added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jan 27, 2025
@extremeheat
Copy link
Member

Known issue, need contributors in PrismarineJS/minecraft-data#948

@deinemuttermitbutter
Copy link

hi, uhm i had the same issue ... i just edited the compiler.js of protodef to pass every array trough, no matter how big it is...
works for me...

file: /node_modules/protodef/src/compiler.js
the change i did: https://github.com/deinemuttermitbutter/node-protodef/blob/2936e87f8f7636e950fa07ae5374ffbadda0d26a/src/compiler.js#L110

as i said before: as long as it works ... its fine

@extremeheat
Copy link
Member

No, it doesn't work. That error being hit is not being hit because the array is big but as a sanity check as invalid data is being read. The protocol spec in minecraft-data is wrong and needs to be fixed. For that it is waiting on contributors in PrismarineJS/minecraft-data#948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f
Projects
None yet
Development

No branches or pull requests

3 participants