Skip to content

Guard pod registration against duplicate Velocity server names#63

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-luckperms-error
Open

Guard pod registration against duplicate Velocity server names#63
Copilot wants to merge 3 commits intomainfrom
copilot/fix-luckperms-error

Conversation

Copy link

Copilot AI commented Feb 26, 2026

プロキシ初期化時のサーバーディスカバリで、既に登録済みのサーバー名を再登録しようとして IllegalArgumentException が発生していました。処理全体は継続させつつ、名前衝突時に安全にスキップ/置換できるようにしています。

  • Startup registration hardening (KuvelServiceHandler#registerPod)

    • 既存サーバー取得を1回に集約し、重複判定と再登録処理で再利用。
    • serverName が既存かつ Kuvel 管理外 の場合は、例外を起こさず警告ログを出して登録をスキップ。
    • serverName が既存かつ Kuvel 管理内 の場合は、既存登録を unregister してから再登録。
  • Behavioral impact

    • ServerMap.register(...) の重複名例外で初期化フローが中断されるケースを回避。
    • 既存の Kuvel 管理サーバー更新フロー(再登録)は維持。
var currentServer = plugin.getProxy().getServer(serverName);

if (currentServer.isPresent() && podUidAndServerNameMap.getUidFromServerName(serverName) == null) {
  plugin.getLogger().warn("Skipped registering server " + serverName + " because the name is already used");
  return;
}

currentServer.ifPresent(server -> plugin.getProxy().unregisterServer(server.getServerInfo()));
plugin.getProxy().registerServer(new ServerInfo(serverName, address));

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • nexus.velocitypowered.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Kuvel/Kuvel org.codehaus.plexus.classworlds.launcher.Launcher -B package (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/Kuvel/Kuvel org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -B -V -e -Dfindbugs.skip -Dcheckstyle.skip -Dpmd.skip=true -Dspotbugs.skip -Denforcer.skip -Dmaven.javadoc.skip (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 26, 2026 11:33
Co-authored-by: matsu1213 <85377530+matsu1213@users.noreply.github.com>
Co-authored-by: matsu1213 <85377530+matsu1213@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in LuckPerms server registration Guard pod registration against duplicate Velocity server names Feb 26, 2026
@matsu1213 matsu1213 marked this pull request as ready for review February 27, 2026 01:07
@matsu1213 matsu1213 self-requested a review February 27, 2026 01:07
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

Successfully merging this pull request may close these issues.

2 participants