I have a problem with NTP and chrony time sync in my environment, so device can’t properly register to openbalena (cause of certificate is not yet valid)
Is there an option to set the starting date of balena os?
So device will start with 29 JUL instead of 5 FEB at first startup
Without this my devices can’t log in into balena, and i can’t login to vpn for example
Hi,
unfortunately at this moment it is only possible to do this manually on development images accessing the device via ssh on port 22222 or the console. We are working on an alternative for environments where NTP is not available but it is not ready yet: https://github.com/balena-os/meta-balena/issues/1337
When you say problem with NTP and chrony - is this because you are not able to access any NTP server or is this only the default ones? If you have some reachable NTP server on the local network you could specify it in config.json and the device would prefer it over the default ones. https://www.balena.io/docs/reference/OS/configuration/#sample-configjson
I tried a lot of commands
chronyc tracking
Ref erence ID : 00000000 ()
Stratum : 0
Ref time (UTC) : Thu Jan 01 00:00:00 1970
System time : 0.000000000 seconds fast of NTP time
Last offset : +0.000000000 seconds
RMS offset : 0.000000000 seconds
Frequency : 0.000 ppm slow
Residual freq : +0.000 ppm
Skew : 0.000 ppm
Root delay : 1.000000000 seconds
Root dispersion : 1.000000000 seconds
Update interval : 0.0 seconds
Leap status : Not synchronised
Hi,
thanks for coming back. So looking at the logs it really looks like the device can not access the NTP servers. Taking one step back - can you please confirm that your device has a working internet connection and working DNS? Are you able to ping any of the listed time servers - ntp2.tktelekom.pl, time.cloudflare.com, news-archive.icm.edu.pl (I assume the truncated one is dc1-recdns02.bellmtsdatacenters.com but let’s not rely on that one)?
Thanks
pings:
root@3772483:~# ping 96-7.cpe.smnt.pl
PING 96-7.cpe.smnt.pl (94.154.96.7): 56 data bytes
64 bytes from 94.154.96.7: seq=0 ttl=55 time=13.468 ms
64 bytes from 94.154.96.7: seq=1 ttl=55 time=14.099 ms
root@3772483:~# ping 46.175.224.7.maxnet.net.pl
PING 46.175.224.7.maxnet.net.pl (46.175.224.7): 56 data bytes
64 bytes from 46.175.224.7: seq=0 ttl=55 time=15.634 ms
64 bytes from 46.175.224.7: seq=1 ttl=55 time=14.917 ms
root@3772483:~# ping ip-159-253-242-123.rev.snt.net.pl
PING ip-159-253-242-123.rev.snt.net.pl (159.253.242.123): 56 data bytes
64 bytes from 159.253.242.123: seq=0 ttl=58 time=8.092 ms
64 bytes from 159.253.242.123: seq=1 ttl=58 time=7.983 ms
tktelekom has timed out
root@3772483:~# ping ntp2.tktelekom.pl
PING ntp2.tktelekom.pl (213.199.225.40): 56 data bytes
^C
— ntp2.tktelekom.pl ping statistics —
2 packets transmitted, 0 packets received, 100% packet loss
Hi,
thanks, so it really looks like NTP access is blocked, in that case unfortunately there is no better solution than manually setting up the time or trying local NTP servers in config.json if you are able to get some from your connection provider or network administrator. As I said - this is a known issue and we are actively working on it.
This is quite strange: ntpdate ntp2.tktelekom.pl works but chronyd -q "server ntp2.tktelekom.pl iburst" doesn’t.
Can you try passing -4 or -6 to the chronyd command ?
I guess the next step would be to install chrony and tcpdump in the same container as ntpdate and run tcpdump -i <interface name> udp port 123 -vv -X while trying to sync date with both commands and compare the output.