Closed Leonardo-Fiori closed 3 years ago
It's OK that it fails getting data from the Mojang API because those IDs aren't real, but it shouldn't be crashing, that's a bug.
In general, though, I'm not supporting non-Mojang IDs right now. So once the crash is fixed, note that you will only see UUIDs in the browser instead of names. I might work on this to use the player cache names in the future for fake UUIDs, but I'll open another issue on that.
Maybe as a quick fix before implementing non-mojang uuids, could we simply hide them? It would be really ugly to see uuids :) Then, take your time, and consider implementing it properly if you want!
After having a look at the code, I'm a bit puzzled as to why this happens, because apparently what I said should already be happening.
I'll try to explain the problem in a nutshell: one of your bedrock players appears to be the best at some award and is supposed to appear on the front page, i.e., he is part of what I call the "summary". But there seems to be a contradiction I don't understand, because that player's ID seems to be unknown when the summary is created.
So I'd like to find out how exactly he got in the summary and how this can happen. I'll open a branch about it with a version of update.py
that I'd like you to try, will get back here in a few minutes,
Could you please try running the update.py
file in this branch: https://github.com/pdinklag/MinecraftStats/tree/debug_issue_111
This should hopefully get a working stat page for you (albeit maybe with some "???" entries for the players it failed on) and help me find out what exactly is wrong. :smiley:
Just replaced update.py with your new version! Thanks for the quick edit :)
Testing... for now i see only stuff like updating profile for 00000000-0000-0000-0009-01f5b2c1b32d
waiting for it to get stuck on something!
We got some true, some false and some ERROR, it is currently stuck, looks like it stopped without crash message: https://hastebin.com/huranowaga.coffeescript
It should eventually have finished? If you have a lot of players, writing the client data may take some time.
Anyway, it's interesting to see that all and only the 000...
UUIDs are affected. You get no (registered: False)
line above the snippet you sent, right? I'll have another look tomorrow and try to understand what's going on. Thanks for giving this a try!
As you can see here, all the registered: False
are 000... UUIDs, BUT not all 000... UUIDs are registered: False
For regular UUIDs, instead, they all look true
https://hastebin.com/ujalifosum.coffeescript
Thanks for giving this a try!
No problems really, thanks for being so willing to fix issues 😄 usually this geyser proxy brings some incompatibilities here and there also with regular spigot plugins. Some devs refuse to even look at it! As of now 2000+ servers are using Geyser, and the number is steadily growing. Finally the poor bedrock players have a decent way to play the game online 😆
It should eventually have finished?
If i keep re-sending the python3 command over and over every time it stops, i think it will eventually finish! https://www.peacefulvanilla.club/mcstats/index.html my plan is to rename index.html and move it into the root folder
Looks like it has completed, take a look here: https://www.peacefulvanilla.club/mcstats/index.html#player:00000000-0000-0000-0009-01fa34ab1ee1
This is a bedrock player, it recognizes it's name. Very strange. Other bedrock players are marked as ??? instead
thanks for being so willing to fix issues
I'm slow adding new features, but fixing bugs is a priority on this project. :smile: It's good to see everything practically working well with the non-Mojang UUIDs.
But yes, the ??? players are the interesting ones and really have me puzzled. There must be stat files for them and somehow they got at least a bronze medal (rank 3 for some stat), but then again their UUID is not known, which is really a contradiction.
Is it possible for you to drop a stat file for one of those players, e.g., the 00000000-0000-0000-0009-01feaa9e5a20.json
file from the stats directory?
I also added some more debug output to update.py
, there should now be some output lines starting with DEBUG
. If any of those contains a UUID for which the script later prints an ERROR
, that confirms the alleged contradiction. I still haven't quite figured why this could happen. 🤔
Is it possible for you to drop a stat file for one of those players, e.g., the 00000000-0000-0000-0009-01feaa9e5a20.json file from the stats directory?
You mean to upload here that file? Here it is! :)
The file looks totally fine to me, but when I put it on my server I can now reproduce your error exactly, so that's good news. 👍 I'll have a look at this soon enough!
Turns out this happened when the Mojang API returns nothing for a UUID (e.g. because it is invalid) and there is also no usercache.json
entry. These players will now be completely excluded, because since their user cache entry expired, they have been inactive in a good while anyway.
The contradiction I spoke of happened because even though the player was filtered later, their stats and rankings were processed, making them appear in rankings even though they were excluded. It should now be fixed (master
branch).
updated mojang.py and update.py taking the files from master branch, now the outputs look different but i think it worked! Don't see any "finish" or "process completed" message tho, but it looks done.
Take a look here: https://www.peacefulvanilla.club/mcstats/index.html#players:1
Are bedrock players still supposed to appear there now that i re-run the command? Looks that ??? players have disappeared, and that's nice
updated mojang.py and update.py taking the files from master branch, now the outputs look different but i think it worked! Don't see any "finish" or "process completed" message tho, but it looks done.
Great! There's indeed no "finish" message. My idea was initially that if there is no output, everything's fine, since Minecraft Stats is usually invoked in an automated manner and the process return code (0 = success) suffices.
Are bedrock players still supposed to appear there now that i re-run the command? Looks that ??? players have disappeared, and that's nice
Yes, they are supposed to appear. I've had reports of people who wanted to see unregistered UUIDs before (probably cracked clients, though the reporters certainly won't admit), so I made Minecraft Stats look up the server's usercache.json
file to get names for those players. Gettings their skins, however, is not possible.
What changed now is that players with unregistered UUIDs are ignored if there is no user cache entry, which happens if they have been away for a good while.
However, once they are in the Minecraft Stats database (in the data
directory) with a valid name, they won't disappear unless you delete the data
directory. Think of it as an extended user cache. 😃
Wow, Amazing explaination! 😊 Thanks for all the good work. For now I will look into configuring a cronjob. How to get the return code zero tho?
Personally, I wrote a wrapper script that calls update.py
and I registered a cronjob for the wrapper. I believe cron notifies you via the Linux internal mail daemon when a job failed (return code other than zero), but I'm no expert for cron, nor is this the place to discuss this. Feel free to contact me via mail or Discord.
Sent you a request on ds! I am Hosom#3615
Update.py was running since 3/4 hours (i have many player files) and suddenly stopped with this error.
Any idea? Some players login trough an amazing piece of sofware called Geyser Proxy, essentially it allows pocket edition (bedrock) players to play on java edition. The authentication happens on my Bungeecord Proxy Server Proxy, with a plugin called floodgate, that generates uuids for them.
Paper version git-Paper-136 Python 3.7.3