core icon indicating copy to clipboard operation
core copied to clipboard

Minecraft Server Integration No Longer Works to Server On Local Network After Update

Open codahq opened this issue 1 year ago • 49 comments
trafficstars

The problem

I'm not sure which update to the Minecraft Server broke connectivity. What I know:

  • I had the integration working and it was fine.
  • Eventually the server started showing offline periodically but services like uptime checkers and players did not experience connectivity issues so these periodic offline reports were false
  • Eventually one of the updates completely broke connectivity. I opened a bug and the fix was supposed to be included a couple of months ago.
  • I try to reconfigure the integration today and connectivity is still 100% broken

Additional information:

  • I have tried the vanilla minecraft server as well as paper/forge and none work
  • I can setup the integration to servers like play.zeldacraft.com, hypixel.net, etc.
  • The server that won't connect is on the local network and running on a custom port

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.

image

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

codahq avatar Dec 29 '23 07:12 codahq

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!

Code owner commands

Code owners of minecraft_server can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign minecraft_server Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


minecraft_server documentation minecraft_server source (message by IssueLinks)

home-assistant[bot] avatar Dec 29 '23 07:12 home-assistant[bot]

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.

elmurato avatar Jan 03 '24 17:01 elmurato

I'm not very familiar but I'll figure it out for this and report back soon.

codahq avatar Jan 05 '24 08:01 codahq

Can you also please check if the setting enable-status is set to true in your server.properties on the server side?

elmurato avatar Jan 08 '24 10:01 elmurato

@home-assistant add-label needs-more-information

elmurato avatar Jan 08 '24 12:01 elmurato

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?

elmurato avatar Jan 08 '24 15:01 elmurato

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

slaygirlz avatar Jan 25 '24 08:01 slaygirlz

@progamer562 Since you're also affected, could you give me the information I am awaiting from @codahq? Thanks.

elmurato avatar Jan 26 '24 09:01 elmurato

oh yes sure what you would need. to fix this

slaygirlz avatar Jan 26 '24 11:01 slaygirlz

Great, thanks. Basically all questions I asked above.

elmurato avatar Jan 26 '24 12:01 elmurato

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)

image image

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?

codahq avatar Jan 30 '24 06:01 codahq

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

elmurato avatar Jan 30 '24 07:01 elmurato

after i posted i immediately realized you would ask that. i updated my last post probably while you were typing your reply

codahq avatar Jan 30 '24 07:01 codahq

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.

elmurato avatar Jan 30 '24 07:01 elmurato

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.

image

codahq avatar Jan 30 '24 07:01 codahq

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.

elmurato avatar Jan 30 '24 09:01 elmurato

my server is open to the world wide web

slaygirlz avatar Jan 30 '24 12:01 slaygirlz

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.

codahq avatar Jan 30 '24 18:01 codahq

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!

elmurato avatar Feb 09 '24 14:02 elmurato

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.

image

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.

  • This worked previously. It stopped working via an update. I wish I knew which one. I wasn't paying attention to it close enough to know which one.
  • mcstatus can read the minecraft server
  • Other external server status libraries can read the minecraft server
  • Home Assistant can ping the minecraft server via the Ping (ICMP) integration

Does HA treat 192.168.x.y differently than other local IP address ranges like 10.10.x.y?

codahq avatar Feb 09 '24 17:02 codahq

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.

elmurato avatar Feb 11 '24 13:02 elmurato

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.

codahq avatar Feb 13 '24 03:02 codahq

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.

codahq avatar Feb 13 '24 04:02 codahq

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

slaygirlz avatar Feb 28 '24 11:02 slaygirlz

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.

bwente avatar Mar 16 '24 12:03 bwente

@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.

codahq avatar Mar 26 '24 04:03 codahq

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.

Tonguc-Endem avatar Apr 03 '24 15:04 Tonguc-Endem