Closed codahq closed 1 month ago
Hey there @elmurato, mind taking a look at this issue as it has been labeled with an integration (minecraft_server
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
minecraft_server documentation minecraft_server source (message by IssueLinks)
If you're familiar with Python, could you please try reading information using the Python package mcstatus? You can install it via pip. You can find the documentation here.
I'm not very familiar but I'll figure it out for this and report back soon.
Can you also please check if the setting enable-status
is set to true
in your server.properties
on the server side?
@home-assistant add-label needs-more-information
Sorry for spamming, but you could also re-test it with the upcoming HA core release 2024.1.3. It will include a fix for a problem with newer server versions.
What is your server version? 1.19.x/1.20.x or older?
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
@codahq your not alone im having the same issue
@progamer562 Since you're also affected, could you give me the information I am awaiting from @codahq? Thanks.
oh yes sure what you would need. to fix this
Great, thanks. Basically all questions I asked above.
If you're familiar with Python, could you please try reading information using the Python package mcstatus? You can install it via pip. You can find the documentation here.
sorry for the delay. not a lot of free time to fix non-essentials, you know?
mcstatus had no problem reading data from the server. i didn't think it would because i essentially use a javascript version of this library to pull status for a webpage. i can also use any of the public web services to pull status from the server. (and as i mentioned before i used this integration previously)
the screenshots show that both protocols are configured on the server (i think). the problem is definitely at the home assistant level. what can i provide from my home assistant environment to help?
No problem 🙂
The query protocol is not supported yet in the HA integration. Could you please re-run the command with the status protocol?
mcstatus 10.10.10.5:63001 status
after i posted i immediately realized you would ask that. i updated my last post probably while you were typing your reply
Okay then from server point of view everything is fine. Good.
Next: Did you retry with HA core 2024.1.3 or newer? It included a fix for newer server version like yours. Additionally it gives now better debug messages if the setup fails.
i'm on 2024.1.5 currently. i did try again but i didn't have debug output turned on. i've done that now though and the result is the same.
I'm so stupid, forgive me, my fault. The improved debug messages will probably be in the next major HA core release. It's not in the current releases yet. That's why you don't see any difference.
Since the next major release is just around the corner, I would propose that you retest with 2024.2.0 once it's available and recheck the debug messages. Hopefully we will get a good hint.
Or if you open your server to the outside and send me the server address via Discord, I could test it for you with my dev environment.
my server is open to the world wide web
I'm so stupid, forgive me, my fault. The improved debug messages will probably be in the next major HA core release. It's not in the current releases yet. That's why you don't see any difference.
Since the next major release is just around the corner, I would propose that you retest with 2024.2.0 once it's available and recheck the debug messages. Hopefully we will get a good hint.
Or if you open your server to the outside and send me the server address via Discord, I could test it for you with my dev environment.
no apologies necessary. i will retest next version.
as a side note, i am fairly confident that an external home assistant environment will be able to connect to my server. i think the issue is in how home assistant makes local connections potentially.
do you happen to have the ability to setup a local minecraft server? if so, is your HA running supervised? do integrations have to do anything to be able to communicate locally? i have no idea how the architecture works for home assistant OS but if it's just a vm running containers i could see it introducing a network layer where communication to local network devices could be blocked.
I could be wrong but i've not had a problem with the minecraft integration monitoring an external minecraft server. it's only servers on my LAN that it can't seem to see.
do you happen to have the ability to setup a local minecraft server? if so, is your HA running supervised? do integrations have to do anything to be able to communicate locally? i have no idea how the architecture works for home assistant OS but if it's just a vm running containers i could see it introducing a network layer where communication to local network devices could be blocked.
I am running Paper 1.16.4 (local IP 192.168.x.y) on Pterodactyl and HA OS both as VMs inside Proxmox, with no issues.
HA core 2024.2 is now live. Please re-test with it. Thanks!
Tested and confirmed still not working. The error is the same as before where I posted that it tries both a bedrock and then java server and times out on both.
Help me understand how the networking works for integrations. Are they containerized or segregated from the LAN network interface in some way? This integration was working just fine and now has stopped because of connectivity issue. Keep in mind these points.
Does HA treat 192.168.x.y differently than other local IP address ranges like 10.10.x.y?
I was expecting that with the new version it would still not work. But I was interested in the now more detailed debug messages. Unfortunately, we now just get a TimeoutError
, which doesn't really help understanding the problem further.
Home Assistant can ping the minecraft server via the Ping (ICMP) integration
It really looks like that your HA instance cannot access your local server (at least not via the status protocol). Which IP address has your HA instance? Is it in the same subnet? Did you change anything in your network hardware, like your router? Are you using VLANs or something like this which might block the status request from HA to your MC server?
Other external server status libraries can read the minecraft server
How does this work with your local server? Is it also open to the outside of your network?
Help me understand how the networking works for integrations. Are they containerized or segregated from the LAN network interface in some way? This integration was working just fine and now has stopped because of connectivity issue.
Unfortunately I don't know how the networking layer works in detail in HA. But I can try to find help on Discord.
It really looks like that your HA instance cannot access your local server (at least not via the status protocol). Which IP address has your HA instance? Is it in the same subnet? Did you change anything in your network hardware, like your router? Are you using VLANs or something like this which might block the status request from HA to your MC server?
There are no VLANs. They are both on the same subnet; the Minecraft server is at 10.10.10.5 and the hass-os is sitting at 10.10.10.200 or something like that. Since there are no VLANs and there is only one subnet and it's just a standard home type router I don't think any of that is the problem. They are on different switches but as a test I put them on the same switch just now and the problem still exists.
How does this work with your local server? Is it also open to the outside of your network?
I have made it public for testing this issue and the configuration of query and status periodically. Always the testing is successful and the server is configured correctly.
Is there anything other than the Ping integration that I can do to prove that HA can see the minecraft server? For example, from my computer or any device on my LAN I can also telnet the port of the minecraft server and get a connection. I noticed I can setup telnet in configuration.yaml but I don't know if it's setup in a way that I could use it to just test connectivity.
To add to this, I haven't made any network changes. The router is the same for many years and I haven't changed any settings there. I have some switches attached to it but those have not changed for many years either. That is why I think this is related to a change in HA or the MC integration.
I remembered something by the way. I know which version it completely stopped working. It was the next version after I reported having this issue .
https://github.com/home-assistant/core/issues/90485
Did you change the timeout to be longer or shorter? If you decreased the timeout, it is it possible that the status request always fails. I have no idea why the ping would take so long either. Everything else is immediate (including telnet and mcstatus from my workstation to the minecraft server). Is there a possibility that the hass-os installation is unhealthy or has a long network queue because of something else going on? I don't see any other traces of unhealthiness or slowdowns but maybe these requests go in a different queue than the ones I can notice.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
no
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Looking for a solution.
@elmurato are there additional layers of debugging we can see anywhere? did you happen to try anybody in discord? i floated teh question a week or so ago in the integrations channel but nobody responded.
I just removed the non-working server entry and added a new entry for the same server with the same settings and it started working.
I just removed the non-working server entry and added a new entry for the same server with the same settings and it started working.
there haven't been any changes to the integration but regardless i tested this again in case it was platform changes and it did not work. this is something i have done probably a hundred times during troubleshooting.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
this makes me sad. this has to be an issue with home assistant or this integration. the underlying library that this integration uses works without any issue. there is something in the implementation, a restriction, configuration, etc. that is preventing this from working. i've checked my system load and its extremely low on cpu and ram. disk space is extremely fast.
and this was working without any changes until a home assistant upgrade of minecraft integration upgrade.
i've asked in the discord and here. is the only help i'm going to get to learn everything about everything and figure this out myself? i think it's clear that i've shown this is a problem in home assistant from the information above.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
this makes me sad. this has to be an issue with home assistant or this integration. the underlying library that this integration uses works without any issue. there is something in the implementation, a restriction, configuration, etc. that is preventing this from working. i've checked my system load and its extremely low on cpu and ram. disk space is extremely fast.
and this was working without any changes until a home assistant upgrade of minecraft integration upgrade.
i've asked in the discord and here. is the only help i'm going to get to learn everything about everything and figure this out myself? i think it's clear that i've shown this is a problem in home assistant from the information above.
Sorry for the long delay. I just asked for support in the Discord server. Hopefully someone is willing to help. I'm unfortunately at the end of my debugging capabilities here. Don't know much about the network layer in HA core.
PS: To avoid this issue to be closed by the bot please always just comment something once the bot adds the stale label.
@home-assistant remove-label needs-more-information
I remembered something by the way. I know which version it completely stopped working. It was the next version after I reported having this issue .
90485
Did you change the timeout to be longer or shorter? If you decreased the timeout, it is it possible that the status request always fails. I have no idea why the ping would take so long either. Everything else is immediate (including telnet and mcstatus from my workstation to the minecraft server). Is there a possibility that the hass-os installation is unhealthy or has a long network queue because of something else going on? I don't see any other traces of unhealthiness or slowdowns but maybe these requests go in a different queue than the ones I can notice.
Timeouts should be longer now.
Sorry for the long delay. I just asked for support in the Discord server. Hopefully someone is willing to help. I'm unfortunately at the end of my debugging capabilities here. Don't know much about the network layer in HA core.
let us first collect some more details about the environment of the users - so @all please provide following details
SERVERIP
and PORT
with the ipP and the port of your minecraft server
nc -v -z SERVERIP PORT
- Was it working an an earlier version of HA core?
Yes, I had the integration setup initially to announce to my kids when their cousins joined our server. It setup initially and ran for quite a while without any issues. Eventually the integration failed ever see the server and the entities were always unavailable. I deleted the integration and it will no longer setup and fails as I've described above.
- Please provide the full system information from "Settings > System > Repairs > 3-dot-menu on top right corner > System information" click on copy and paste it "as is" here in a comment
I will paste this in the next comment.
- If you're on HA-OS or supervised, please open the terminal add-on and provide output of the following command: replace
SERVERIP
andPORT
with the ipP and the port of your minecraft servernc -v -z SERVERIP PORT
version | core-2024.5.0 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.12.2 |
os_name | Linux |
os_version | 6.6.25-haos |
arch | x86_64 |
timezone | America/Denver |
config_dir | /config |
this indicates, that the HA-OS can reach and connect to the minecraft server on port 63001 - means on network layer the connection (more precisely the tcp connection) works properly. So the issue might be on protocol level - maybe changes in the api of the minecraft server (did you update it lately?)
next would be enabling debug logging for minecraft_server
and it's dependencies ... to do so add the following to your configuration.yaml
:
logger:
default: info
logs:
homeassistant.components.minecraft_server: debug
dnspython: debug
mcstatus: debug
afterwards reload the integration, wait until the error happens, than download and provide the full home-assistant.log
Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.
I updated HA (Release 2024.5.5) last night and restarted both HA and Minecraft and it is now working.
next would be enabling debug logging for
minecraft_server
and it's dependencies ... to do so add the following to yourconfiguration.yaml
:logger: default: info logs: homeassistant.components.minecraft_server: debug dnspython: debug mcstatus: debug
afterwards reload the integration, wait until the error happens, than download and provide the full home-assistant.log
Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.
that didn't seem to add anything additional that we weren't already seeing to my logs. do i have to do more than restart? home-assistant.log
@elmurato is it common that the it first tries the Bedrock Edition
and than the Java Edition
? if both cases the initialization seems to be successful, but fetching data runs into timeout - this looks like an application layer issue
logfile from above as reference:
2024-06-03 20:40:41.124 DEBUG (MainThread) [homeassistant.components.minecraft_server.api] Initialized Bedrock Edition server instance with address '10.10.10.5:63001'
2024-06-03 20:41:11.132 DEBUG (MainThread) [homeassistant.components.minecraft_server.api] Connection check of Bedrock Edition server failed: Status request to '10.10.10.5:63001' failed: TimeoutError()
2024-06-03 20:41:11.132 DEBUG (MainThread) [homeassistant.components.minecraft_server.api] Initialized Java Edition server instance with address '10.10.10.5:63001'
2024-06-03 20:41:41.140 DEBUG (MainThread) [homeassistant.components.minecraft_server.api] Connection check of Java Edition server failed: Status request to '10.10.10.5:63001' failed: TimeoutError()
@mib1185 Yes, the integration first tries to connect to a Bedrock server and if that fails tries again to connect to a Java server. Reason is that some Bedrock servers mimic a Java server.
maybe adding some further debug logging to mcstatus
may help to find the root cause, but also checking the server side logs (I'm not familiar with minecraft servers, so unfortunately I can't support with it)
may help to find the root cause, but also checking the server side logs (I'm not familiar with minecraft servers, so unfortunately I can't support with it)
this part might be tricky. i see nothing in the server logs or console when any other library successfully pulls a status or fails to pull a status. i'm not sure if the minecraft side will be very helpful in that regard. maybe somebody can tell me if there's a way to crank up verbosity in some way to see query requests in the log. i couldn't find a way to do it with some preliminary googling.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I'm not sure which update to the Minecraft Server broke connectivity. What I know:
Additional information:
What version of Home Assistant Core has the issue?
core-2023.12.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Minecraft Server
Link to integration documentation on our website
https://www.home-assistant.io/integrations/minecraft_server
Diagnostics information
Because it's not establishing the integration I don't know how to get integration specific logs. However, if I create an integration to another server and then try to add another server I can at least put the integration in debug log mode. This is what it says when I do that and try to create an integration to the server that always fails.
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response