Troubleshooting Darkflame Lego Universe logins
I spent about 3 hours troubleshooting my Darkflame Lego Universe server. My users could not connect. I turned the server back on after a few months of being offline, and nobody could connect. I wanted to test the new Chat Web API, and yes, I know it was limited to localhost specifically.
So I had 2 problems to solve: use the chat web api to list active players, and also fix the server so people can use it.
I could not confirm inside the docker container that the port was listening. There was no ss or netstat installed, so I searched and found a guide that provided this useful snippet.
grep -v "rem_address" /proc/net/tcp | awk 'function hextonum(str, ret, n, i, k, c) {if (str ~ /^0[xX][0-9a-fA-F]+$/) {str = substr(str, 3);n = length(str);ret = 0;for (i = 1; i <= n; i++) {c = substr(str, i, 1);c = tolower(c);k = index("123456789abcdef", c);ret = ret * 16 + k}} else ret = "NOT-A-NUMBER";return ret} {y=hextonum("0x"substr($2,index($2,":")-2,2));x=hextonum("0x"substr($3,index($3,":")-2,2));for (i=5; i>0; i-=2) {x = x"."hextonum("0x"substr($3,i,2));y = y"."hextonum("0x"substr($2,i,2));} print y":"hextonum("0x"substr($2,index($2,":")+1,4))" "x":"hextonum("0x"substr($3,index($3,":")+1,4));}'
So I logged in to the container, and ran that.
127.0.0.1:2005 0.0.0.0:0 127.0.0.11:39406 0.0.0.0:0 172.18.0.3:38700 172.18.0.2:3306 172.18.0.3:60628 172.18.0.2:3306 172.18.0.3:38688 172.18.0.2:3306 172.18.0.3:38698 172.18.0.2:3306 172.18.0.3:59388 172.18.0.2:3306 127.0.0.1:58922 127.0.0.1:2005 172.18.0.3:60142 172.18.0.2:3306 172.18.0.3:60722 172.18.0.2:3306 172.18.0.3:38696 172.18.0.2:3306 172.18.0.3:60092 172.18.0.2:3306
Hm, so loopback, inside the container. So I started poking at it with netcat, once I had docker-cped it into the container and its libraries. No go. I even started trying with raw bash.
root@76611a2e385a:/app# echo "GET /api/v1/players HTTP/1.1" > /dev/tcp/127.0.0.1/2005 root@76611a2e385a:/app#
Still not any good. Eventually, I copied in curl, and that finally got results!
root@76611a2e385a:/app# curl http://localhost:2005/api/v1/players [{"gm_level":0,"id":1152921504606848632,"muted":false,"name":"TardyHippyWarrior","zone_id":{"clone_id":0,"instance_id":21,"map_id":1200}}]
So now we can prove it's working! And yes, I solved the user login problem too.
My server seemed unstable, and even user logins would not get started. Eventually I got it to the point where the database was working and users could try to log in, and the server logs would indicate it has started a session for the user, but the client would just return to the login screen.
I restarted the containers, and even rebooted the host! I still couldn't solve it. I started digging through the code, and even compiled it. Maybe there was a compile flag turned off or something. I never got around to using my compiled thing, but some random notes: on my single-core dev vm, it took 17 minutes to compile DarkflameServer, and also it needed g++-12 and not g++-15. I'm guessing whatever default c++ standard is used in gcc 15 doesn't include the u_int32 headers or whatever. I don't want to deal with that baloney.
I finally got around to checking my network infrastructure. Obviously I was getting to the public IP address and hostname. It's just after that it's not working. And then I found the problem: I didn't have the world ports 3000-3300/udp forwarded from my router! I had replaced my egress router and had missed the port range forwarding rule!
I have since learned that the darkflameserver container is based on debian, so I can make a small container image based on the darkflameserver one, with my additions.
# Startdate: 2025-10-15-4 21:35 # Purpose: add useful tools to container: curl ps ss # Usage: # docker build --tag dlu1:latest . FROM ghcr.io/darkflameuniverse/darkflameserver:latest WORKDIR /app RUN apt-get update && \ apt-get install --quiet --yes \ --no-install-recommends curl procps iproute2 && \ apt-get clean && rm -rf /var/lib/apt/lists/* ENTRYPOINT [ "/app/entrypoint.sh" ]
Comments