Correct way to set up custom NTP servers

I changed the ntp servers to defaults and ran the configizer.

NTPSERVERS="0.resinio.pool.ntp.org 1.resinio.pool.ntp.org 2.resinio.pool.ntp.org "

14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 :     Welcome to balenaOS
14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 : Inserting ntpServers values
14bf78f383234e273d4dd0860268f3a9 : Inserting sshKeys values
14bf78f383234e273d4dd0860268f3a9 : Keyindex: 0
14bf78f383234e273d4dd0860268f3a9 : Stopping supervisor before updating the original config.json
14bf78f383234e273d4dd0860268f3a9 : Running ntpServers post insert tasks
14bf78f383234e273d4dd0860268f3a9 : resin-ntp-config: Found config.json in /mnt/boot/config.json .
14bf78f383234e273d4dd0860268f3a9 : 200 OK
14bf78f383234e273d4dd0860268f3a9 : 503 No such source
14bf78f383234e273d4dd0860268f3a9 : 200 OK
14bf78f383234e273d4dd0860268f3a9 : 503 No such source
14bf78f383234e273d4dd0860268f3a9 : 200 OK
14bf78f383234e273d4dd0860268f3a9 : 503 No such source
14bf78f383234e273d4dd0860268f3a9 : Running sshKeys post insert tasks
14bf78f383234e273d4dd0860268f3a9 : Restarting supervisor.
14bf78f383234e273d4dd0860268f3a9 : DONE

I don’t understand what the 503s are referring to, but there are 3 for the 3 NTP servers I set up. I then limited it to a single value resinio.pool.ntp.org and it ran w/o errors.

14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 :     Welcome to balenaOS
14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 : Inserting ntpServers values
14bf78f383234e273d4dd0860268f3a9 : Inserting sshKeys values
14bf78f383234e273d4dd0860268f3a9 : Keyindex: 0
14bf78f383234e273d4dd0860268f3a9 : Stopping supervisor before updating the original config.json
14bf78f383234e273d4dd0860268f3a9 : Running ntpServers post insert tasks
14bf78f383234e273d4dd0860268f3a9 : resin-ntp-config: Found config.json in /mnt/boot/config.json .
14bf78f383234e273d4dd0860268f3a9 : Running sshKeys post insert tasks
14bf78f383234e273d4dd0860268f3a9 : Restarting supervisor.
14bf78f383234e273d4dd0860268f3a9 : DONE

Setting it to 1.resinio.pool.ntp.org does result in the same 503 error + a supervisor error to boot:

configizer> ./run.sh
14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 :     Welcome to balenaOS
14bf78f383234e273d4dd0860268f3a9 : =============================================================
14bf78f383234e273d4dd0860268f3a9 : Inserting ntpServers values
14bf78f383234e273d4dd0860268f3a9 : Inserting sshKeys values
14bf78f383234e273d4dd0860268f3a9 : Keyindex: 0
14bf78f383234e273d4dd0860268f3a9 : Stopping supervisor before updating the original config.json
14bf78f383234e273d4dd0860268f3a9 : Running ntpServers post insert tasks
14bf78f383234e273d4dd0860268f3a9 : resin-ntp-config: Found config.json in /mnt/boot/config.json .
14bf78f383234e273d4dd0860268f3a9 : 200 OK
14bf78f383234e273d4dd0860268f3a9 : 503 No such source
14bf78f383234e273d4dd0860268f3a9 : Running sshKeys post insert tasks
14bf78f383234e273d4dd0860268f3a9 : Restarting supervisor.
14bf78f383234e273d4dd0860268f3a9 : FAIL: Supervisor not restarted properly after while.

So it seems that for some reason specifying the keys in the expanded format such as 1.resinio.pool.ntp.org results in the 503 errors.

  • The documentation example specifically indicates setting
    "ntpServers": "0.resinio.pool.ntp.org 1.resinio.pool.ntp.org"
    but in my case at least it seems to result in 503 errors

A few other observations:

  • The values in the SSHKEYS array specified in config.sh are added to the list in /mt/boot/config.json, even if it’s the same key. So running run.sh 4 times will result in 4 copies of the same key in the sshKeys array. Not operationally a problem perhaps, but not clean.
  • After reboot, my device never came back. I had to power cycle it, and then it came back. The only relevant log error seems to be May 19 23:36:58 14bf78f openvpn[908]: Tue May 19 23:36:58 2020 ERROR: Linux route add command failed: external program exited with error status: 2.
  • Post power cycle, the file /etc/chrony.conf is unchanged. Shouldn’t the specified NTP values in the config file be written here to be used by chrony?