balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
453 stars 139 forks source link

`balena join` does not capture log output of `os-config` #1317

Open pdcastro opened 5 years ago

pdcastro commented 5 years ago

It has been reported (e.g. here, here and here) that the balena join command only captures the exit error code of the remote execution of the os-config command, missing on the log / error messages and thus failing with mysterious numeric error codes.

For reference, the list of numeric error codes can be seen in the source code of the os-config tool (errors.rs):

        ErrorKind::ReadOSConfigSchema => 3,
        ErrorKind::FetchConfiguration => 4,
        ErrorKind::StartService(_) => 5,
        ErrorKind::StopService(_) => 6,
        ErrorKind::ReloadRestartService(_) => 7,
        ErrorKind::WriteFile(_) => 8,
        ErrorKind::ServiceNotFoundJSON(_) => 9,
        ErrorKind::ConfigNotFoundJSON(_, _) => 10,
        ErrorKind::MergeConfigJSON => 11,

Known workaround: open a ssh terminal to the device's host OS (which may be done via balena ssh or standard ssh), then directly execute the os-config leave/join command. Brief usage info can be seen with os-config --help

balena-ci commented 5 years ago

[pdcastro] This issue has attached support thread https://jel.ly.fish/#/support-thread~e1fe8561-84cb-4ab5-bc10-7e71922f2c56

balena-ci commented 5 years ago

[pdcastro] This issue has attached support thread https://jel.ly.fish/#/support-thread~7fc0715e-6758-424f-8c5b-ef745ca25ed7