PaperMC / PaperMC/Paper

unix address support is half arsed

Open
#9,923 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted type: bug
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Stack trace

https://paste.gg/p/anonymous/22ef4f7a69cb4276a77dd4aa569f5420

Plugin and Datapack List

no

Actions to reproduce (if known)
  1. use a unix address in the server-ip setting in server.properties such as unix:/tmp/paper-server.sock
  2. enable velocity/bungeecord in various configs
  3. patch velocity/bungeecord to allow for proper unix address support between the server and the proxy
  4. add the server's unix address to the proxy's server list
  5. start both the server and the proxy
  6. (if ping passthrough is enabled on the proxy) pinging the proxy will cause the big stacktrace to be shown, the ping will fail
  7. attempting to connect will fail and the small stacktrace will be shown
Paper version

This server is running Paper version git-Paper-280 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 4675152)

Other

patches/server/0602-Add-Unix-domain-socket-support.patch adds support for unix addresses between the proxy and the server, but the server still performs unconditional casts to InetSocketAddress pointed out in the stacktraces (and maybe some other places). Fixing these should be trivial.

More problematically, NetworkClient.getAddress() has a return type of @NotNull InetSocketAddress and so the PaperNetworkClient unconditionally casts the address, moreover Player.getAddress() is @Nullable and returns null when the address is not an InetSocketAddress, this is an API break. Either the annotation on NetworkClient has to be changed or some exception-being-thrown-behaviour has to be specified and CraftPlayer.getAddress need follow. Either case is API break.

Alternatively, drop the patch adding support for unix addresses, but that would make me very sad.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with patches/server/0602-Add-Unix-domain-socket-support.patch and the linked stack traces, then inspect NetworkClient.getAddress(), PaperNetworkClient, and CraftPlayer.getAddress(). Determine the intended API behavior for Unix addresses, then verify proxy ping passthrough and connection attempts no longer fail without invalid casts.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.