balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 63 forks source link

Infinite loop attempting to apply configuration variable with invalid value #1915

Open pdcastro opened 2 years ago

pdcastro commented 2 years ago

If the RESIN_HOST_ODMDATA_configuration configuration variable is set to value 0 through the web dashboard, the supervisor gets in a loop logging:

05.04.22 14:22:05 (+0200) Applied boot config: {"configuration":"0"}
05.04.22 14:22:05 (+0200) Applying boot config: {}
05.04.22 14:22:05 (+0200) Applied boot config: {}
05.04.22 14:22:05 (+0200) Applying boot config: {"configuration":"0"}
05.04.22 14:22:05 (+0200) Applied boot config: {"configuration":"0"}
05.04.22 14:22:05 (+0200) Applying boot config: {}
05.04.22 14:22:06 (+0200) Applied boot config: {}
05.04.22 14:22:06 (+0200) Applying boot config: {"configuration":"0"}
05.04.22 14:22:06 (+0200) Applied boot config: {"configuration":"0"}
05.04.22 14:22:06 (+0200) Applying boot config: {}
05.04.22 14:22:06 (+0200) Applied boot config: {}
05.04.22 14:22:06 (+0200) Applying boot config: {"configuration":"0"}
05.04.22 14:22:06 (+0200) Applied boot config: {"configuration":"0"}
05.04.22 14:22:06 (+0200) Applying boot config: {}
05.04.22 14:22:07 (+0200) Applied boot config: {}
05.04.22 14:22:07 (+0200) Applying boot config: {"configuration":"0"}

JF Pattern RESIN_HOST_ODMDATA_configuration var on TX2 devices states:

Setting RESIN_HOST_ODMDATA_configuration = 0 on a TX2 device causes it to spam the log that it's applying new boot configs, but they are all empty. It is not clear that the available config options are from 1 to 6.

Indeed, the valid values for RESIN_HOST_ODMDATA_configuration appear to be 1 to 6, as defined at: https://github.com/balena-io/open-balena-api/blob/v0.203.0/src/features/vars-schema/env-vars.ts#L230-L239

If it is a case that the supervisor attempts value validation and fails (I do not know that it is the case, though), then it should perhaps remember this and not keep trying again.

A closely related issue seems to be #1743.

jellyfish-bot commented 2 years ago

[pdcastro] This issue has attached support thread https://jel.ly.fish/62d1dd5d-cad0-49a5-918e-851a795045fc