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

struct.error: unpack requires a buffer of 8 bytes #23

Open
m3dus444 opened this issue Jul 29, 2024 · 1 comment
Open

struct.error: unpack requires a buffer of 8 bytes #23

m3dus444 opened this issue Jul 29, 2024 · 1 comment

Comments

@m3dus444
Copy link

m3dus444 commented Jul 29, 2024

Hi @aladras,

I'm using Windows 10 (10.0.19045 build 19045) and a Minecraft Forge 47.3 server. MCRcon is 0.7.0 version.
I did all the server config to accept RCON.
While following your exemple usage i'm stuck at very first exemple, MCRcon.py cannot connect to the server due to a struct function.

I'll try to fix the problem but in the meantime i'm opening this issue.

Here's the whole trackeback :

Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner self.run() File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run self._target(*self._args, **self._kwargs) File "C:\Users\user\curseforge\minecraft\Instances\Earthians\playground\scripts\autoforgegen.py", line 28, in check_player_count with MCRcon(RCON_IP, RCON_PASSWORD) as mcr: File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\mcrcon.py", line 57, in enter self.connect() File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\mcrcon.py", line 78, in connect self._send(3, self.password) File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\mcrcon.py", line 112, in _send in_id, in_type = struct.unpack("<ii", in_payload[:8]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ struct.error: unpack requires a buffer of 8 bytes

Thanks, m3dus444.

@m3dus444
Copy link
Author

Update :
For whoever has the same issue : if you are running your server on a SaaS Hosting Provider (such as BisectHosting, Hosterfy etc) make sure you change the default port given by the provider to one of your allocated ports (or create the corresponding one). I didn't know but they won't give by default the right port.
If you are running your own server, make sure the port is open in the firewall of your machine.

I close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant