py-mine / mcstatus

A Python library for checking the status of Minecraft servers
https://mcstatus.readthedocs.io
Apache License 2.0
468 stars 37 forks source link

Errno 8 #866

Closed lavroovich closed 1 month ago

lavroovich commented 1 month ago

Traceback (most recent call last): File "/Users/ivanborisov/PycharmProjects/lavroo/discord.py", line 14, in status=server.status() ^^^^^^^^^^^^^^^ File "/Users/ivanborisov/PycharmProjects/lavroo/.venv/lib/python3.12/site-packages/mcstatus/server.py", line 126, in status with TCPSocketConnection(self.address, self.timeout) as connection: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/ivanborisov/PycharmProjects/lavroo/.venv/lib/python3.12/site-packages/mcstatus/protocol/connection.py", line 540, in init self.socket = socket.create_connection(addr, timeout=timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 828, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/socket.py", line 963, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socket.gaierror: [Errno 8] nodename nor servname provided, or not known

Help me please!

kevinkjt2000 commented 1 month ago

Given the timing on this and the similarity, I am going to assume this is a duplicate of this discord conversation https://discord.com/channels/936788458939224094/1266967430287331348/1266967430287331348

import mcstatus as mc

server=mc.JavaServer.lookup("play.noxenth.ru:25565")
status=server.status()
onlinePlayers=status.players.online
maxPlayers=status.players.max
OnlineData=(f"На сервере {onlinePlayers} из {maxPlayers}")

There is no A record for the server play.noxenth.ru. DNS configuration is the responsibility of the server owner. Please make sure you have the name of the server correct and that the owner of this server has made this DNS name publicly available.

Closing this since it is not an mcstatus issue.