jeremylvln / Shulker

A Kubernetes operator for managing complex and dynamic Minecraft infrastructures, including game servers and proxies.
https://shulker.jeremylvln.fr/
GNU Affero General Public License v3.0
181 stars 14 forks source link

Provided Redis requires username #496

Closed TehNeon closed 6 months ago

TehNeon commented 6 months ago

What happened?

Currently the provided Redis feature doesn't allow you to not defined a username. Redis allows for usernameless authentication by just accepting a password. If you pass in an empty username it still attempts to authenticate with username-pass based auth instead of just password auth.

What components are involved in your issue?

Proxy Agent (BungeeCord), Proxy Agent (Velocity), Server Agent (Paper)

Version

0.8.1

Kubernetes Version

1.28.7

Relevant log output

[20:28:03 ERROR] [io.shulkermc.proxyagent.velocity.ShulkerProxyAgentVelocity]: Shulker Agent crashed, stopping proxy
redis.clients.jedis.exceptions.JedisAccessControlException: WRONGPASS invalid username-password pair or user is disabled.
    at redis.clients.jedis.Protocol.processError(Protocol.java:104) ~[?:?]
    at redis.clients.jedis.Protocol.process(Protocol.java:163) ~[?:?]
    at redis.clients.jedis.Protocol.read(Protocol.java:222) ~[?:?]
    at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:350) ~[?:?]
    at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:268) ~[?:?]
    at redis.clients.jedis.Connection.helloOrAuth(Connection.java:492) ~[?:?]
    at redis.clients.jedis.Connection.initializeFromClientConfig(Connection.java:401) ~[?:?]
    at redis.clients.jedis.Connection.<init>(Connection.java:67) ~[?:?]
    at redis.clients.jedis.Jedis.<init>(Jedis.java:220) ~[?:?]
    at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:170) ~[?:?]
    at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:566) ~[?:?]
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:306) ~[?:?]
    at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:233) ~[?:?]
    at redis.clients.jedis.util.Pool.getResource(Pool.java:38) ~[?:?]
    at redis.clients.jedis.JedisPool.getResource(JedisPool.java:378) ~[?:?]
    at io.shulkermc.proxyagent.ShulkerProxyAgentCommon.onProxyInitialization(ShulkerProxyAgentCommon.kt:62) ~[?:?]
    at io.shulkermc.proxyagent.velocity.ShulkerProxyAgentVelocity.onProxyInitialization(ShulkerProxyAgentVelocity.kt:30) ~[?:?]
    at io.shulkermc.proxyagent.velocity.Lmbda$13.execute(Unknown Source) ~[?:?]
    at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity.jar:3.3.0-SNAPSHOT (git-8891faa5-b370)]
    at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:597) ~[velocity.jar:3.3.0-SNAPSHOT (git-8891faa5-b370)]
    at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:478) ~[velocity.jar:3.3.0-SNAPSHOT (git-8891faa5-b370)]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
    at java.base/java.lang.Thread.run(Unknown Source) [?:?]

Code of Conduct

jeremylvln commented 6 months ago

The default Redis username is "default". How did you produced this error? You are providing the Redis secret yourself and you don't know how to fill the username field?

(with the big protobuf crash, I'm terrified of having shipped another breaking release by mistake 🙃)

TehNeon commented 6 months ago

The default Redis username is "default". How did you produced this error? You are providing the Redis secret yourself and you don't know how to fill the username field?

(with the big protobuf crash, I'm terrified of having shipped another breaking release by mistake 🙃)

I wasn't aware that it used the username "default". That's totally my bad. Going to close this issue. I swapped my cluster over to specify the name as default and it appears to function. Whenever I've used Redis authentication (through Jedis) I've always used the constructor that only takes in the password, and with Redis clients I've always left the username field empty and I guess they also will then fill it in as default when not specified.

jeremylvln commented 6 months ago

I could totally implement a fallback behavior to inject "default" if the value is not filled. That would be a good UX addition.

TehNeon commented 6 months ago

That's not a bad idea. Although currently there is no docs going over the Managed vs Provided Redis setup, which if they were made could also explain that to use the "default" user as well. Since I only found out about the feature from looking at the CRDS for MinecraftCluster.