Players Online always zero

I read the thread from Feb '16 and none of the suggestions there solve my issue.

I’m running a new instance of MineOS (b28c5be) on Fedora 30, managing several world instances where my kids and I play. Each kid has his own world (they like 1:1 time with me), plus we have one communal world we all use together. Finally we have another world that’s exposed to their friends on the internet.

All game instances are vanilla, using the latest (1.14.4) server jar.

Only one of our “family” instances are only ever at any given time, so they’re all configured on the default port. The “exposed” instance runs on a non-default port since I didn’t want to enable port forwarding on my router using a default port.

I’m a fairly seasoned linux admin, and all the game configs work, firewall behaves, etc.

I’ve just never seen the “Players Online” widget ever report a non-zero value on any of the server instances. It does reflect the correct max player value for each (our family server limit is 5, the exposed server limit is 10).

I’ve made sure “enable-query=true” is set in the properties files, and I’m using the java arguments to force the IPv4 tcp/udp stacks (verified via netstat). I’ve tried setting the query-port to both match and differ from the game port. No joy.

What am I missing?

Here are the reasons I can come up with for it won’t work (in general):

  1. plugins modify the query packet
  • mineos is programmed to handle two different query formats, legacy and modern–which is basically the query return value being split into many different, known fields, split on a different separator.

Since you’re using vanilla, this isn’t likely relevant.

  1. 1.14.4 uses a new query specification
  • mineos is hardcoded for two formats, and any new format/separator will break this entire function until I code in an update.

I haven’t actually opened up Minecraft the client since 1.14.x, so if this changed, I feel like I should have heard from the community that you’re not alone in this issue.

  1. it’s failing to poll the first server, and failing the whole attempt, making all 4 servers report 0, so it’s a sane (albeit inaccurate) default.

This is the most likely case, and often this kind of failure should be reported in /var/log/mineos.log. Are you able to check/share that file so we may see if there’s any error tracebacks?

  1. Fedora 30 has really upped their hardening game and this is an unexpected, localized, super-narrow side-effect.

But I really don’t think this should be the case. Let’s see what the #3 logs show us.

Also, run these commands:

cd /usr/games/minecraft
time ./mineos_console.js -s myservername property ping

It should provide some potential value to why it’s always reporting zero.

Sorry for the resurrection, but I’d just kinda gotten used to it being wrong and moved on. Yesterday, I did an upgrade to Fedora 31, and the resulting installation of NodeJS 12.x broke the userid module again, so I thought I’d revisit.

I think the property ping command is enlightening:

[xxxxxx@aries minecraft]$ sudo time ./mineos_console.js -s Private_Server property ping
error: { Error: connect ECONNREFUSED 127.0.0.1:25512
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
errno: ‘ECONNREFUSED’,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘127.0.0.1’,
port: 25512 }
[Private_Server] Successfully executed “property”
0.11user 0.00system 0:00.11elapsed 103%CPU (0avgtext+0avgdata 38176maxresident)k
0inputs+0outputs (0major+4649minor)pagefaults 0swaps

Though the game port is tcp/25512, the query port is set to tcp/25565.

Seems likely that mineos is querying the wrong port?

[EDIT]
OK, perhaps not. I launched a different server instance that’s using the default port config (tcp/25565 for both server and query), and I get the same error:

[root@aries minecraft]# time ./mineos_console.js -s Family property ping
error: { Error: connect ECONNREFUSED 127.0.0.1:25565
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
errno: ‘ECONNREFUSED’,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘127.0.0.1’,
port: 25565 }
[Family] Successfully executed “property”

real 0m0.119s
user 0m0.107s
sys 0m0.017s

Could it be something to do with the use of the loopback address rather than the external one?

OK, it was definitely the IP address. The MineOS commands are calling the loopback address, which is fine unless your server.properties file specifies an IP address like mine was doing.

[myuser@aries Private_Server]$ ncat -vu localhost 25565
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to 127.0.0.1:25565.
BLAHBLAH
Ncat: Connection refused.

[myuser@aries Private_Server]$ ncat -vu aries 25565
Ncat: Version 7.80 ( https://nmap.org/ncat )
Ncat: Connected to 192.168.15.108:25565.
BLAHBLAH
MOARBLAH
???
^C

[root@aries jvm]# netstat -nlp |grep java
tcp        0      0 192.168.15.108:25512    0.0.0.0:*               LISTEN      155446/java
udp        0      0 192.168.15.108:25565    0.0.0.0:*                           155446/java

I removed the server-ip parameter from my properties file entirely, and the ping command succeeds now:

[myuser@aries minecraft]$ sudo time ./mineos_console.js -s Private_Server property ping
[Private_Server] Successfully executed "property"
{ protocol: 127,
  server_version: '1.14.4',
  motd: 'Welcome to Our Epic World!',
  players_online: 0,
  players_max: 10 }
0.11user 0.01system 0:00.12elapsed 104%CPU (0avgtext+0avgdata 38604maxresident)k
0inputs+0outputs (0major+4752minor)pagefaults 0swaps

Thanks for all your work on this project, Will. It rules!

1 Like