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

CorruptedFrameException on 1.20.3 protocol #3378

Open
1 task done
Emibergo02 opened this issue May 10, 2024 · 4 comments
Open
1 task done

CorruptedFrameException on 1.20.3 protocol #3378

Emibergo02 opened this issue May 10, 2024 · 4 comments

Comments

@Emibergo02
Copy link

Emibergo02 commented May 10, 2024

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: latest
  • server: velocity 1.20.4
  • bun: 1.1.8

Detailed description of a problem

Malformed protocol for ClientSettingsPacket

What did you try yet?

Join the client on Velocity proxy

##Error on Velocity

[18:25:33 ERROR]: [connected player] bot4 (/2.42.7.131:59082): exception encountered in com.velocitypowered.proxy.connection.client.ClientConfigSessionHandler@8981fc
io.netty.handler.codec.CorruptedFrameException: Error decoding class com.velocitypowered.proxy.protocol.packet.ClientSettingsPacket Direction SERVERBOUND Protocol 1.20.3 State CONFIG ID 0
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.handleDecodeFailure(MinecraftDecoder.java:131) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:86) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:61) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: io.netty.handler.codec.CorruptedFrameException: Bad VarInt decoded
        at com.velocitypowered.proxy.protocol.ProtocolUtils.readVarInt(ProtocolUtils.java:132) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at com.velocitypowered.proxy.protocol.ProtocolUtils.readString(ProtocolUtils.java:236) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at com.velocitypowered.proxy.protocol.packet.ClientSettingsPacket.decode(ClientSettingsPacket.java:131) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:84) ~[velocity.jar:3.3.0-SNAPSHOT (git-1228f147-b389)]
        ... 28 more
@Emibergo02 Emibergo02 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 May 10, 2024
@extremeheat
Copy link
Member

Can you reproduce on a vanilla server? This is odd as we don't get the error on CI.

@Emibergo02
Copy link
Author

yes

@extremeheat
Copy link
Member

Please provide code to reproduce on vanilla 1.20.3

@extremeheat extremeheat added waiting info from op and removed possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels May 12, 2024
@Emibergo02
Copy link
Author

Emibergo02 commented May 27, 2024

const {createBot} = require('mineflayer');


let bot = createBot({
    host: 'hidden',
    port: 25565,
    username: 'gglglgll',
    viewDistance: 'tiny',
    keepAlive: true,
    version: '1.20.4',
    checkTimeoutInterval: 30000,
});

bot.on("end", (reason) => {
    console.log("Bot " + bot.username + " ended for " + reason)
});

bot.on('messagestr', (msg,position,json) => {
    console.log("Message: " + msg);
});
bot.on('kicked', (reason, loggedIn) => {
    console.log("Bot " + bot.username + " kicked for " + JSON.stringify(reason) + " loggedIn: " + loggedIn);
});

bot.on('resourcePack', (url, uuid) => {
    bot.acceptResourcePack();
});
bot.on("error", (err) => {

    throw err;
});

As simple as that

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

No branches or pull requests

2 participants