# Set starting date of balena

**URL:** <https://forums.balena.io/t/set-starting-date-of-balena/165322>\
**Category:** balenaOS\
**Created:** [July 29, 2020, 9:23am UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322 "2020-07-29T09:23:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 9:23am UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/1 "2020-07-29T09:23:42Z")

</div>

Hello

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

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [July 29, 2020, 12:00pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/4 "2020-07-29T12:00:43Z")

</div>

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](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](https://www.balena.io/docs/reference/OS/configuration/#sample-configjson)

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 12:07pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/6 "2020-07-29T12:07:25Z")

</div>

Hello

I don’t really know what is a problem here,

Time is just not synced

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

chronyc sources  
root@2ce005f:~# chronyc sources  
210 Number of sources = 4  
MS Name/IP address Stratum Poll Reach LastRx Last sample  
===============================================================================  
^? ntp2.tktelekom.pl 0 14 100 - +0ns[+0ns] +/- 0ns  
^? [time.cloudflare.com](http://time.cloudflare.com) 0 14 100 - +0ns[+0ns] +/- 0ns  
^? dc1-recdns02.bellmtsdata\> 0 14 100 - +0ns[+0ns] +/- 0ns  
^? news-archive.icm.edu.pl 0 14 100 - +0ns[+0ns] +/- 0ns

chronyc makestep  
200 OK

I really don’t know what can be an issue here  
Local server also doesn’t work

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [July 29, 2020, 12:37pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/7 "2020-07-29T12:37:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 12:44pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/8 "2020-07-29T12:44:32Z")

</div>

> [@mtoman](#):
>
> ntp2.tktelekom.pl

Hi i just reflashed devices

new sources:

===============================================================================  
^? ip-159-253-242-123.rev.s\> 0 14 40 - +0ns[+0ns] +/- 0ns  
^? 46.175.224.7.maxnet.net.\> 0 14 40 - +0ns[+0ns] +/- 0ns  
^? ntp2.tktelekom.pl 0 14 40 - +0ns[+0ns] +/- 0ns  
^? 96-7.cpe.smnt.pl 0 14 40 - +0ns[+0ns] +/- 0ns

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

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [July 29, 2020, 1:30pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/9 "2020-07-29T13:30:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 1:33pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/11 "2020-07-29T13:33:01Z")

</div>

You can try installing `ntpdate` in a container and run `ntpdate ntp2.tktelekom.pl` (or any other ntp server) and see if it works.

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 1:47pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/12 "2020-07-29T13:47:21Z")

</div>

It works in this case  
apt install -y ntpdate

* * *

root@889e29ff8df0:/app# ntpdate ntp2.tktelekom.pl  
29 Jul 13:46:14 ntpdate[18]: step time server 213.199.225.40 offset 15139717.831731 sec  
root@889e29ff8df0:/app# date  
Wed Jul 29 13:46:16 UTC 2020

Very strange

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 2:04pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/13 "2020-07-29T14:04:06Z")

</div>

Can you check `chronyd` logs with `journalctl -u chronyd` ?

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 2:07pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/14 "2020-07-29T14:07:52Z")

</div>

Yes

– Logs begin at Fri 2020-01-31 09:20:37 UTC, end at Wed 2020-07-29 14:07:21 UTC. –  
Feb 05 08:16:55 localhost chronyd[687]: 2020-02-05T08:16:55Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
Jul 29 13:46:40 3772483 chronyd[687]: 2020-07-29T13:46:40Z Forward time jump detected!

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 2:19pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/15 "2020-07-29T14:19:18Z")

</div>

It looks like it works fine according to these logs.  
Is the output of `date` correct ?  
Is `chronyc tracking` still saying that it is not synchronized ?

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 2:25pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/16 "2020-07-29T14:25:37Z")

</div>

Hi, date is correct, chronyc tracking not

root@3772483:~# chronyc tracking  
Reference 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

date:

root@3772483:~# date  
Wed Jul 29 14:25:28 UTC 2020

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 2:35pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/17 "2020-07-29T14:35:00Z")

</div>

I guess the time is correct only because you set it manually then.  
Can you try the following:

```auto
systemctl stop chronyd
chronyd -q 'server pool.ntp.org iburst'

```

(or any other ntp server than [pool.ntp.org](http://pool.ntp.org))

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 2:39pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/18 "2020-07-29T14:39:03Z")

</div>

root@3772483:~# chronyd -q “server [pool.ntp.org](http://pool.ntp.org) iburst”  
2020-07-29T14:36:26Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:36:38Z No suitable source for synchronisation  
2020-07-29T14:36:38Z chronyd exiting

root@3772483:~# chronyd -q “server [0.resinio.pool.ntp.org](http://0.resinio.pool.ntp.org) iburst”  
2020-07-29T14:37:22Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:37:49Z No suitable source for synchronisation  
2020-07-29T14:37:49Z chronyd exiting

root@3772483:~# chronyd -q “server [pl.pool.ntp.org](http://pl.pool.ntp.org) iburst”  
2020-07-29T14:38:13Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:38:26Z No suitable source for synchronisation  
2020-07-29T14:38:26Z chronyd exiting

root@3772483:~# chronyd -q “server ntp2.tktelekom.pl iburst”  
2020-07-29T14:38:45Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:38:56Z No suitable source for synchronisation  
2020-07-29T14:38:56Z chronyd exiting

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 2:50pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/19 "2020-07-29T14:50:33Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 2:55pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/20 "2020-07-29T14:55:54Z")

</div>

Yes it’s strange

root@3772483:~# chronyd -4 -q “server ntp2.tktelekom.pl iburst”  
2020-07-29T14:49:15Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:49:25Z No suitable source for synchronisation  
2020-07-29T14:49:25Z chronyd exiting

root@3772483:~# chronyd -6 -q “server ntp2.tktelekom.pl iburst”  
2020-07-29T14:49:40Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:49:50Z No suitable source for synchronisation  
2020-07-29T14:49:50Z chronyd exiting

root@3772483:~# chronyd -6 -4 -q “server ntp2.tktelekom.pl iburst”  
2020-07-29T14:50:04Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:50:14Z No suitable source for synchronisation  
2020-07-29T14:50:14Z chronyd exiting

root@3772483:~# chronyd -6 -4 -q “server [pool.ntp.org](http://pool.ntp.org) iburst”  
2020-07-29T14:55:17Z chronyd version 3.4 starting (+CMDMON +NTP +REFCLOCK +RTC -PRIVDROP -SCFILTER -SIGND +ASYNCDNS -SECHASH +IPV6 -DEBUG)  
2020-07-29T14:55:27Z No suitable source for synchronisation  
2020-07-29T14:55:27Z chronyd exiting

ntpdate still works  
root@889e29ff8df0:/app# ntpdate [pool.ntp.org](http://pool.ntp.org)  
29 Jul 14:54:56 ntpdate[17]: step time server 34.194.39.113 offset 230.527345 sec  
root@889e29ff8df0:/app# ntpdate [pool.ntp.org](http://pool.ntp.org)  
29 Jul 14:55:07 ntpdate[18]: adjust time server 34.194.39.113 offset -0.000257 sec  
root@889e29ff8df0:/app# exit

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 3:07pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/22 "2020-07-29T15:07:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 3:21pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/23 "2020-07-29T15:21:33Z")

</div>

chronyd

> **[iburst.txt](https://drive.google.com/file/d/1NuEn3fEw7FK9QXTwVc3gzbbNAsfjxb9R/view?usp=sharing)**
>
> Google Drive file.

ntpdate

> **[ntpdate.txt](https://drive.google.com/file/d/1AjhYn_oY7dDxEQ3Gv_NtFSDXMKtMUnc3/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [July 29, 2020, 3:22pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/24 "2020-07-29T15:22:41Z")

</div>

I get a 404 for both urls

---

<div class="post-metadata">

**Author:** ![Razikus](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@Razikus](https://forums.balena.io/u/Razikus)\
**Post date:** [July 29, 2020, 3:24pm UTC](https://forums.balena.io/t/set-starting-date-of-balena/165322/25 "2020-07-29T15:24:12Z")

</div>

I just edited the links

[Next page](https://forums.balena.io/t/set-starting-date-of-balena/165322.md?page=2)
