Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unable to fetch/send metadata of connected players: list index out of range] #9

Closed
liam6080 opened this issue Feb 1, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@liam6080
Copy link

liam6080 commented Feb 1, 2024

Every so often in the discord server it will throw the error:
Unable to process your request

The console error:
2024-02-01 20:04:17,373 - client - INFO - Setting up RCON connection
2024-02-01 20:04:17,373 - client - DEBUG - Fetching online players
2024-02-01 20:04:17,417 - main - ERROR - Unable to fetch/send metadata of connected players: list index out of range

It does get a little annoying as we rely on this to work all the time, I love the thing you have made :)
I would at least like to know why this happens and if this can be fixed/When it will be fixed?

This was working before and I have not touched the configs, It just seems to happen from time to time.

@liam6080 liam6080 added the bug Something isn't working label Feb 1, 2024
@Bratah123
Copy link
Collaborator

Bratah123 commented Feb 1, 2024

Interesting thanks!
I do have some seldom knowledge related to this but idk if its true, PalWorld RCON requests for GetPlayers seems to be a bit buggy when used too often AFAIK (not sure if its fixed in v1.4.0) and I don't know if it's related to this issue at all.

Seems like another person #7 (comment) also is having the same problem as you.

If you could provide some of this information it would help us get down to the bottom of this:

  • What operating system is the PalWorld server and Discord Bot hosted on? Are they on the same machine?
  • How many players are present in your server at the time that the command was called?
  • How often is the command called?

Currently it's difficult for me to reproduce so all these questions will help me try and get this error myself,
Thank you!

@Bratah123
Copy link
Collaborator

I pushed a possible fix for this issue in: baf0b93

Turns out it might be from our side making assumptions about the data PalWorld sends us. I couldn't reproduce the error naturally, so this was tested using intentionally modifying the information.

LMK if this fixes it after you update the bot!

@liam6080
Copy link
Author

liam6080 commented Feb 1, 2024

Hello,

Q1: What operating system is the PalWorld server and Discord Bot hosted on?

A: Ubuntu.

Q2: Are they on the same machine?

A: Yes.

Q3: How many players are present in your server at the time that the command was called?

A: This has happened with 12 players on, But it has done it before with less players.

Extra add on: Also I would like to let you know that even tho it was failing, rebooting it didn't fix it, Something I noticed was that with another Rcon running on a different Ubuntu OS/IP on the same machine (As a CT), I was able to still pull the showplayers command via Rcon, Something I do notice is after X time it will re force me to run the command to connect to Rcon on this on I was using before I got this discord bot one. (I am unsure if palworld kills the connection or it's the Rcon program I am using on the second OS).

Q4: How often is the command called?

A:I can call it as many times as I want in a row without an issue, It just seems to error or time out after awhile.

Thanks,
Liam.
I hope this helps some how & Give you some testing you can do 😃.

@liam6080
Copy link
Author

liam6080 commented Feb 1, 2024

I pushed a possible fix for this issue in: baf0b93

Turns out it might be from our side making assumptions about the data PalWorld sends us. I couldn't reproduce the error naturally, so this was tested using intentionally modifying the information.

LMK if this fixes it after you update the bot!

I just did a reboot & It updated.
It looks to be working so far, I will keep an eye out & Let you know if I have any more issues, Thanks 😃.

@liam6080
Copy link
Author

liam6080 commented Feb 1, 2024

Now there is an issue where it's only showing 3 people online, When there is 9 on currently.
The latest update just broke something.
Just to let you know 😃.

@Bratah123
Copy link
Collaborator

Thanks, I think that narrows it down for us actually. Does one of the player's name have spaces in it? Or does someone have a comma in their name?

It actually seems our parsing logic did not cover for this edge case

@liam6080
Copy link
Author

liam6080 commented Feb 1, 2024

Thanks, I think that narrows it down for us actually. Does one of the player's name have spaces in it? Or does someone have a comma in their name?

It actually seems our parsing logic did not cover for this edge case

There is a person with that has a
Person 1: Normal
Person 2: Twitch.tv/NameNameM8
Person 3: Normal
Person 4: Normal
Person 5: Normal
Person 6: Normal
Anything beyond this I can't answer as I don't have player names in front of me unfortunately.

@Bratah123
Copy link
Collaborator

Thanks, I think that narrows it down for us actually. Does one of the player's name have spaces in it? Or does someone have a comma in their name?
It actually seems our parsing logic did not cover for this edge case

There is a person with that has a Person 1: Normal Person 2: Twitch.tv/NameNameM8 Person 3: Normal Person 4: Normal Person 5: Normal Person 6: Normal Anything beyond this I can't answer as I don't have player names in front of me unfortunately.

Gotcha thanks, I'll try to get this promptly fixed

Bratah123 added a commit that referenced this issue Feb 1, 2024
This may provide a possible fix, I still cannot reproduce the error naturally, but have an idea why it might occur.

I made some tests cases on my end to test, and now added more loggers to narrow down the problem in case it happens again.
@Bratah123
Copy link
Collaborator

Bratah123 commented Feb 1, 2024

I hate to ping you on this issue once more, but I just pushed a commit: c0f085a

That MIGHT help us figure out what is happening..
If it fixes it that's great as well!

I still cannot reproduce the error naturally, so I used test cases with the names you provided me and some names with commas.
This may be caused by the command's embed itself as well, which if this commit does not fix the issue then I'll check that after.

Do let me know what you see in the command logs if you get around to testing it.

Thanks so much for your help on debugging

EDIT: I just realized, that it might be possible for someone to play palworld without a steamID ? and that the command may be skipping those players. I will need further confirmation

@liam6080
Copy link
Author

liam6080 commented Feb 2, 2024

I don't mind being pinged.
Also now it just shows 0 players online.
Also do you have a discord server or something I can work with you in to get this sorted, Plus I had another request we need in our server to.

@Bratah123
Copy link
Collaborator

Yes! Feel free to add me on discord, my discord is: newhashmap

@liam6080
Copy link
Author

liam6080 commented Feb 2, 2024

Yes! Feel free to add me on discord, my discord is: newhashmap

Added.

@liam6080
Copy link
Author

liam6080 commented Feb 2, 2024

Yes! Feel free to add me on discord, my discord is: newhashmap

Mine is: liam6080

@Bratah123
Copy link
Collaborator

Issue has not arisen since latest build, closing issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants