How to synchronize time of my HA device?

Hi everyone,
Everything on my device was well-configured and worked fine until I had to manually move it to another place, unplugging it.
After the restart of my Home Assistant, I realized that the time of the device (through “date” command inside the terminal) was some minutes back in time. For example, if I run the command at 3:01PM, it responds with the time 2:48PM.

This causes various problems since I need real-time data to be coherent in terms of time.

Anyone knows how to solve this problem and re-synchronize the device? I already did various attempts, unsuccessfully: tried using “ntpd -p pool.ntp.org”, and other similar solutions, but (even if I am interacting as root) the response I get is something like:
adcjtimex failed: Operation not permitted

Thanks in advance.

I do not know what platform or install method you used for Home Assistant but there may be clues or solutions for you in this thread: Set or customize NTP source - #31 by davewestofuk.

1 Like

I tried following the procedure posted in that thread but unfortunately the HA does not allow me to do any change in the system configuration (“operation not permitted”, or “can’t open /dev/misc/rtc: no such file or directory”).
It’s been two days since I started trying to fix this, and still unable to make a move.
Meanwhile, this is what I came across in terms of system configuration:

Finally, I noticed there are updates for HomeAssistant Supervisor, OS and Core but I am unable to install the new version of Supervisor because it gives me this error:

Error updating Home Assistant Supervisor: Internal Server Error ( lookup ghcr.io: no such host).

This sounds like there is an issue with the DNS settings.
That would also account for the ntp not working at its cannot resolve pool.ntp.org

How do you know it was 3:01PM?
What is your host computer?
How is Home Assistant installed?

I can successfully ping pool.ntp.org, so I would likely exclude this option.
I am still stuck with this problem though.

The example time that I used is the one that I can find in my host computer and my AWS account.
The problem comes when a HA automation tries to invoke an AWS lambda which refuses the call because the source device has an unsynchronized clock:

An error occurred (InvalidSignatureException) when calling the Invoke operation: Signature expired: 20250116T080900Z is now earlier than 20250116T081841Z (20250116T082341Z - 5 min.)

Can you post the output of this cli command:

ha network info

Moreover, when I try to run the Supervisor update and it fails, this is the Supervisor log:

# These are the logs for (I suppose) an automatic update attempt:

2025-01-16 11:29:59.362 ERROR (MainThread) [supervisor.supervisor] Can't fetch AppArmor profile https://version.home-assistant.io/apparmor_stable.txt: Cannot connect to host version.home-assistant.io:443 ssl:default [Could not contact DNS servers]
2025-01-16 11:29:59.363 CRITICAL (MainThread) [supervisor.supervisor] Abort update because of an issue with AppArmor: Can't fetch AppArmor profile https://version.home-assistant.io/apparmor_stable.txt: Cannot connect to host version.home-assistant.io:443 ssl:default [Could not contact DNS servers]
2025-01-16 11:29:59.363 CRITICAL (MainThread) [supervisor.core] Can't update Supervisor! This will break some Add-ons or affect future versions of Home Assistant!

# This, instead, is when I try to launch the installation manually from the HA interface:

2025-01-16 11:35:51.807 INFO (MainThread) [supervisor.supervisor] Fetching AppArmor profile https://version.home-assistant.io/apparmor_stable.txt
2025-01-16 11:35:51.826 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: hassio-supervisor
2025-01-16 11:35:51.992 INFO (MainThread) [supervisor.supervisor] Update Supervisor to version 2024.12.3
2025-01-16 11:35:51.993 INFO (MainThread) [supervisor.docker.interface] Downloading docker image ghcr.io/home-assistant/aarch64-hassio-supervisor with tag 2024.12.3.
2025-01-16 11:35:52.036 ERROR (MainThread) [supervisor.docker.interface] Can't install ghcr.io/home-assistant/aarch64-hassio-supervisor:2024.12.3: 500 Server Error for http+docker://localhost/v1.47/images/create?tag=2024.12.3&fromImage=ghcr.io%2Fhome-assistant%2Faarch64-hassio-supervisor&platform=linux%2Farm64: Internal Server Error ("Get "https://ghcr.io/v2/": dial tcp: lookup ghcr.io: no such host")
2025-01-16 11:35:52.036 ERROR (MainThread) [supervisor.supervisor] Update of Supervisor failed: Can't install ghcr.io/home-assistant/aarch64-hassio-supervisor:2024.12.3: 500 Server Error for http+docker://localhost/v1.47/images/create?tag=2024.12.3&fromImage=ghcr.io%2Fhome-assistant%2Faarch64-hassio-supervisor&platform=linux%2Farm64: Internal Server Error ("Get "https://ghcr.io/v2/": dial tcp: lookup ghcr.io: no such host")

Try changing the DNS entry to 1.1.1.1 or 8.8.8.8

Settings → System → Network

1 Like

Setting the DNS server address to 1.1.1.1 solved my issue. Thank you very much!

1 Like

You might still want to look at the presented DNS server, maybe something in it setup incorrectly. Or you’ll have the same problem on that network with other devices you add.

1 Like