Closed KarsonTheFoxx closed 1 year ago
Both https://mcsrvstat.us, and https://mcstatus.io/status work and so does running it on windows
Sounds like this Linux machine has an outgoing firewall
Not enough information without a stacktrace, code, version of mcstatus, and firewall setup of the raspberry pi.
Please also provide server public IP (if it's public) and try to get status with https://statusmc.perchun.it (it uses mcstatus under the hood, so this eliminates the problem in your computer setup).
With the lack of information, I will assume this is a duplicate of #538.
Sorry, got busy with work. The website that uses mcstatus works fine, and pi has default firewall configuration the code is just a copy + paste of the example minus the ping
The code is just that thrown into a disnake / command
The code is just that thrown into a disnake / command
Don't really understand what you mean. Just send code and traceback, it would be much better.
pi has default firewall configuration
What exactly is that configuration?
the code is just a copy + paste of the example minus the ping
The example in readme includes a query request, query needs to be enabled on the server, and utilizes UDP. It's possible that the firewall configuration prevents UDP here, or that the server you're trying to obtain query data from simply doesn't have query enabled (you need to set enable-query=true
in server.properties
)
pi has default firewall configuration
What exactly is that configuration?
the code is just a copy + paste of the example minus the ping
The example in readme includes a query request, query needs to be enabled on the server, and utilizes UDP. It's possible that the firewall configuration prevents UDP here, or that the server you're trying to obtain query data from simply doesn't have query enabled (you need to set
enable-query=true
inserver.properties
)
Ok, I see how that could be an issue but the problem is that the code works from a different device
That just means the raspberry pi likely has a firewall which prevents the connection. I don't know what the firewall configuration of raspberry pi is, so I can't tell you much more here, however it is clear that this is not an issue with mcstatus, rather with the configuration of your device. If you do need some more help, feel free to ask on our discord server: https://discord.gg/C2wX7zduxC
I have 2 raspberry pi 4's both with raspiOS 32 bit. Both are using default settings for wireless wifi, the issue is pi 1 gets that error, despite my pc having the program and it works
Disnake is kinda unrelated to the problem
I also can't send a stack trace because I lost the power cord for the pi that's throwing the error. I can however send the code
I also can't send a stack trace because I lost the power cord for the pi that's throwing the error. I can however send the code
That won't really help us considering it works on another device, again, this is not an issue with mcstatus, it's an issue with the configuration of your device.
from disnake.ext import commands
import disnake
from mcstatus import JavaServer
class minecraft(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.slash_command(name="status", description="Get minecraft server status")
async def status(inter:disnake.CommandInteraction):
await inter.response.defer()
try:
server = JavaServer.lookup("my server", 19132)
query = server.query()
emb = disnake.Embed(title=f"Server status", description="The server is Currently Online!", color=disnake.Color.green())
emb.add_field(name=f"{query.players.online}/{query.players.max} Online", value=f"{', '.join(query.players.names)}")
except TimeoutError:
emb = disnake.Embed(title="The server is offline", color=disnake.Color.red())
await inter.followup.send(embed=emb)
def setup(bot):
bot.add_cog(minecraft(bot))
I refuse to give tge ip as the ip is unprotected and traces directly back to my home ip, I edited out the ip and deleted its context for my safety
If this same code works on another device, it's clear that query is enabled on the server, and the issue is that the raspberry pi just can't connect to it, this could be because of it's internal firewall configuration (likely blocking UDP), or a network-wide firewall, maybe it's on a VLAN that doesn't allow connections elsewhere, or maybe it's the device where the minecraft server is hosted that has the IP of the raspberry pi blocked.
But it's trying to connect via the same ip on both devices from the same network
Please, stop. We can't help with your firewall here, it is just not the right place.
I get this as an error while using my bot on a Linux machine, however not windows.
Specifically raspberry pi OS 32 bit and windows 10 pro