core
core copied to clipboard
Needs to manually start each setup for the Minecraft integration
The problem
Hi! As mentioned in the title I have to manually start every configuration. If I don't, every configurated server won't start. Based on the logs, I think that the integration tries to connect almost immediately on boot which makes it fail because nothing else is loaded yet. Here us my output from the logs
Logger: homeassistant.config_entries
Source: config_entries.py:444
First occurred: 04:30:45 (19 occurrences)
Last logged: 04:32:20
Error setting up entry sentiacraft.com for minecraft_server: Server address in configuration entry is invalid: Lookup of 'sentiacraft.com' failed: The resolution lifetime expired after 17.616 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
Error setting up entry sentiacraft.com for minecraft_server: Server address in configuration entry is invalid: Lookup of 'sentiacraft.com' failed: The resolution lifetime expired after 6.282 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.360 seconds
Error setting up entry MuCraft for minecraft_server: Server address in configuration entry is invalid: Lookup of 'spela.mucraft.se' failed: The resolution lifetime expired after 5.311 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
Error setting up entry Ekstammen for minecraft_server: Server address in configuration entry is invalid: Lookup of 'mc.ekstammen.nu' failed: The resolution lifetime expired after 5.332 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
Error setting up entry 90gQopen for minecraft_server: Server address in configuration entry is invalid: Lookup of 'open.90gq.se' failed: The resolution lifetime expired after 3.929 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/minecraft_server/api.py", line 79, in async_initialize
self._server = await JavaServer.async_lookup(self._address)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/mcstatus/server.py", line 83, in async_lookup
addr = await async_minecraft_srv_address_lookup(address, default_port=cls.DEFAULT_PORT, lifetime=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/mcstatus/address.py", line 247, in async_minecraft_srv_address_lookup
host, port = await mcstatus.dns.async_resolve_mc_srv(host, lifetime=lifetime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/mcstatus/dns.py", line 94, in async_resolve_mc_srv
return await async_resolve_srv_record("_minecraft._tcp." + hostname, lifetime=lifetime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/mcstatus/dns.py", line 67, in async_resolve_srv_record
answers = await dns.asyncresolver.resolve(query_name, RdataType.SRV, lifetime=lifetime)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dns/asyncresolver.py", line 303, in resolve
return await get_default_resolver().resolve(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dns/asyncresolver.py", line 89, in resolve
timeout = self._compute_timeout(start, lifetime, resolution.errors)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/dns/resolver.py", line 1075, in _compute_timeout
raise LifetimeTimeout(timeout=duration, errors=errors)
dns.resolver.LifetimeTimeout: The resolution lifetime expired after 17.381 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/minecraft_server/__init__.py", line 42, in async_setup_entry
await api.async_initialize()
File "/usr/src/homeassistant/homeassistant/components/minecraft_server/api.py", line 85, in async_initialize
raise MinecraftServerAddressError(
homeassistant.components.minecraft_server.api.MinecraftServerAddressError: Lookup of 'kottcraft.se' failed: The resolution lifetime expired after 17.381 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 444, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/minecraft_server/__init__.py", line 44, in async_setup_entry
raise ConfigEntryError(
homeassistant.exceptions.ConfigEntryError: Server address in configuration entry is invalid: Lookup of 'kottcraft.se' failed: The resolution lifetime expired after 17.381 seconds: Server Do53:172.30.32.3@53 answered The DNS operation timed out after 0.000 seconds
What version of Home Assistant Core has the issue?
core-2024.2.1
What was the last working version of Home Assistant Core?
core-2024.1
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
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
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)
Hi @el97 and thanks for your report.
I just tried to add all servers mentioned in your log and I see no problems on my side. After adding them they showed up just fine. And even after some restart the servers were immediately available.
What do you mean exactly with
As mentioned in the title I have to manually start every configuration. If I don't, every configurated server won't start.
?
Based on the error messages (dns.resolver.LifetimeTimeout) in your logs I would assume that there are problems with your internet connection or with your DNS server specifically.
What I mean is that I don't get any data and I get the "Failed to set up" for each server. If I press reload, it works as intended and I get data from the servers as supposed. So the issue for me is that it fails to set up automatically upon a restart of Home Assistant.
I see, thanks for the fast response 👍
I think I understand the issue now, but I need to check a few things. I'll come back to you once I am confident about the cause of the problem or if I need more information from you.
I experience the same behaviour as @el97
After every HA restart I have to manually reload the Minecraft integration ... EVERY TIME Core 2024.2.3
Exactly the same issue here, Core 2024.2.3
Thanks for the reports everyone 👍
In my DEV setup I still don't see any problems. But in my productive system I have the same problem as you, if I add a server with a SRV address (like hypixel.net).
I don't know why this started happening lately (maybe an underlying OS update?). But it doesn't matter, because you pointed me to a design flaw in the entry setup. In case of temporary DNS issues (as you had), the integration would inform Home Assistant (HA) that the entry failed. In that case HA would not automatically retry the setup. With the fix I linked here the integration will inform HA that the integration is not ready yet, so that HA can re-trigger it automatically after some time.
This should hopefully fix your problems 🤞