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

Cannot invoke "java.util.Locale.getLanguage()" because "locale" is null #510

Closed
andrewkm opened this issue May 13, 2024 · 22 comments
Closed
Labels
bug Something isn't working

Comments

@andrewkm
Copy link

Using floodgate compiled against: 4404c15
Using Paper 1.20.4 Build 496

Getting the following spam in Waterfall console:
https://pastebin.com/0qx71Ewx

@Brasil150
Copy link

Yes, this is happening here too. I'm desperate because my players, both Java and Bedrock, can't log in. I even went so far as to blame ViaVersion.

@Camotoy
Copy link
Member

Camotoy commented May 14, 2024

Can you post full logs and a Geyser dump if relevant?

@Brasil150
Copy link

@Camotoy Sorry but it's not the Geyser dump. This is what is happening on my Proxy. Kicks players as they enter.

[21:16:46 ERROR]: [/0.0.0.0|frestxl] <-> DownstreamBridge <-> [lobby] - encountered exception
java.lang.NullPointerException: Cannot invoke "java.util.Locale.getLanguage()" because "locale" is null
        at org.geysermc.floodgate.util.Utils.getLocale(Utils.java:87) ~[?:?]
        at org.geysermc.floodgate.util.BungeeCommandUtil.getUserAudience(BungeeCommandUtil.java:66) ~[?:?]
        at org.geysermc.floodgate.player.audience.FloodgateSenderMapper.map(FloodgateSenderMapper.java:44) ~[?:?]
        at org.geysermc.floodgate.player.audience.FloodgateSenderMapper.map(FloodgateSenderMapper.java:34) ~[?:?]
        at org.geysermc.floodgate.shadow.org.incendo.cloud.bungee.BungeeCommand.hasPermission(BungeeCommand.java:83) ~[?:?]
        at net.md_5.bungee.connection.DownstreamBridge.handle(DownstreamBridge.java:806) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at net.md_5.bungee.protocol.packet.Commands.handle(Commands.java:230) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:127) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:455) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:801) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]
        at java.lang.Thread.run(Thread.java:840) [?:?]

@andrewkm
Copy link
Author

@Camotoy Sorry but it's not the Geyser dump. This is what is happening on my Proxy. Kicks players as they enter.


[21:16:46 ERROR]: [/0.0.0.0|frestxl] <-> DownstreamBridge <-> [lobby] - encountered exception

java.lang.NullPointerException: Cannot invoke "java.util.Locale.getLanguage()" because "locale" is null

        at org.geysermc.floodgate.util.Utils.getLocale(Utils.java:87) ~[?:?]

        at org.geysermc.floodgate.util.BungeeCommandUtil.getUserAudience(BungeeCommandUtil.java:66) ~[?:?]

        at org.geysermc.floodgate.player.audience.FloodgateSenderMapper.map(FloodgateSenderMapper.java:44) ~[?:?]

        at org.geysermc.floodgate.player.audience.FloodgateSenderMapper.map(FloodgateSenderMapper.java:34) ~[?:?]

        at org.geysermc.floodgate.shadow.org.incendo.cloud.bungee.BungeeCommand.hasPermission(BungeeCommand.java:83) ~[?:?]

        at net.md_5.bungee.connection.DownstreamBridge.handle(DownstreamBridge.java:806) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at net.md_5.bungee.protocol.packet.Commands.handle(Commands.java:230) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:127) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:455) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:801) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.20-R0.3-SNAPSHOT:37a9ace:577]

        at java.lang.Thread.run(Thread.java:840) [?:?]

Exact same issue here.

@Brasil150
Copy link

Testing a few Floodgate builds ago doesn't cause this.

@andrewkm
Copy link
Author

Testing a few Floodgate builds ago doesn't cause this.

Same here, I've reverted back for now to mitigate the issue.

@Camotoy
Copy link
Member

Camotoy commented May 14, 2024

Do any of you have disabled commands in your Bungee config?

@Brasil150
Copy link

There are no commands disabled in my Waterfall config. (Except "bungee" command but this is default).

@Brasil150
Copy link

Testing a few Floodgate builds ago doesn't cause this.

Same here, I've reverted back for now to mitigate the issue.

Another thing, it was very difficult to find previous builds as there is no download button for other builds on the website. I had to go to Github Actions, download the zipped Build and extract it to get the jar.

@Camotoy
Copy link
Member

Camotoy commented May 14, 2024

I cannot replicate it. I've tried with forwarding on and off, I've tried with Waterfall and Bungee, I've tried with 1.20.6 and 1.20.4, I've tried with and without LuckPerms. Something's missing - I need all the information on your setups that I can get, that you're comfortable with sharing.

@Brasil150
Copy link

Brasil150 commented May 14, 2024

I cannot replicate it. I've tried with forwarding on and off, I've tried with Waterfall and Bungee, I've tried with 1.20.6 and 1.20.4, I've tried with and without LuckPerms. Something's missing - I need all the information on your setups that I can get, that you're comfortable with sharing.

In my case it is happening in:

Waterfall #577 - Java 17
Backend: 1.12.2(Dionysus git 899c2f4) - Java 17

If you enter 1.20.4 and 1.20.6 in Java you will not have this problem. However, if you enter something like 1.18.2, you will be disconnected with the error described.

In the case of Bedrock players, the same error occurs and they are disconnected.

@Z3r0xh
Copy link

Z3r0xh commented May 14, 2024

We have been talking about the problem here, in my tests you can enter with current clients, but from 1.20.1 onwards it no longer allows entry.

My tests have been on the latest version of both geyser and floodgate and bungeecord and papermc

#506

@onebeastchris
Copy link
Member

I am still unable to replicate this issue, but i think this was caused by bumping cloud from beta.2 to a newer snapshot, which introduced the changes in hasPermission: Incendo/cloud-minecraft@857e537, which invokes the floodgate sender mapper, and then failing here.
The root cause here seems to be that bungee's getLocale() method returned null here; ill see if i can track that down.

@onebeastchris
Copy link
Member

onebeastchris commented May 14, 2024

Was able to replicate with calling getLocale during the post login event; that returns null. Made a BungeeCord issue: SpigotMC/BungeeCord#3680

I will open a floodgate PR to fall back to the default locale though in this case.

EDIT: This is, apparently, intended. The PR addresses this issue properly by not assuming locale to be NonNull.

@onebeastchris onebeastchris added the bug Something isn't working label May 14, 2024
onebeastchris added a commit to onebeastchris/Floodgate that referenced this issue May 14, 2024
onebeastchris added a commit that referenced this issue May 14, 2024
* Temporary fix for #510, bump cloud to rc candidate

* apparently it is supposed to be nullable. okay then.
@onebeastchris
Copy link
Member

Should be resolved in the latest build. Thanks for reporting!

@andrewkm
Copy link
Author

Latest has resolved this issue on our end.
Thank you! :)

@Brasil150
Copy link

I would just like to point out the difficulty of finding previous builds in cases like this, as the site only has downloads for the most recent version.

@Z3r0xh
Copy link

Z3r0xh commented May 14, 2024

Thank you very much for reviewing and fixing the error!

@andrewkm
Copy link
Author

I would just like to point out the difficulty of finding previous builds in cases like this, as the site only has downloads for the most recent version.

Thankfully we build the project on our jenkins, so have older builds available for testing.
Would be nice if Floodgate/Geyser had a jenkins/similar.

@AlexProgrammerDE
Copy link

Well there is a very badly advertised official jenkins: https://ci.opencollab.dev/job/GeyserMC/

@Camotoy
Copy link
Member

Camotoy commented May 14, 2024

Neither Floodgate nor Geyser are uploaded to the Jenkins anymore, hence why it is badly advertised. (Even when it did, Geyser only kept the last 20 builds).

Thank you for your suggestions on older builds.

@onebeastchris
Copy link
Member

Making older builds available isn't generally something we're really interested in - since especially Floodgate is compatible all the way back to 1.8.9, and Geyser to 1.16.5, so there isn't a big use for old builds.
However, for cases such as these - or finding regressions - having access to the last 10-20 builds seems reasonable, I agree.
Maybe we could start uploading all builds to modrinth; that would have the benefit - meaning that we wouldn't need our own additional infrastructure/downloads site with a build picker. Not sure though, we'll see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants