Patch of host-config for proxy not working

I’m currently trying to patch the supervisor api /v1/device/host-config and it doesn’t seem like the change is taking effect.

I sent a patch request including all the proxy details I wanted the host to use and the supervisor api responded with a [200] OK message. Then I got back the host-config and nothing had changed. I got the host config… then changed host_config[“network”][“proxy”] = {“ip”: “xxx.xxx…” …} sent that as a patch to the supervisor api and then even issued a reboot api call (reboot worked) but when the device came online again I got the host-config nothing ever seemed to change. I’m at a loss for how to troubleshoot this since the api keeps giving me OK responses. Please can anyone help me out here??

I have an update on this… So I’ve gone ahead and updated both the Host OS Version and the Supervisor API Version.

Balena OS Version: balenaOS 2.107.8+rev1
Supervisor: 14.4.4

Now when I do a get on host config I get this response from the server:

Command failed: fatrw read /mnt/root/mnt/boot/system-proxy/redsocks.conf
Error: Failed to read target file /mnt/root/mnt/boot/system-proxy/redsocks.conf

Caused by:
No such file or directory (os error 2)

When I try to patch the host-config I still get an [200] okay with nothing happening and on the host there is no /mnt/boot/system-proxy/redsocks.conf which I assume the patch would make.

Also It seems like it could be a bug that the proxy config file has to exist before the host-config can be gotten. Or perhaps that file is supposed to exist by default in the boot mount and my boot config is messed up.

Last update here. Seems there was a bug with the get of host-config failing if red-socks config file didn’t exist or the no_proxy file not existing after supervisor version 14.4.0… This is tracked in this issue GET /v1/device/host-config will return 503 if proxy files do not exist · Issue #2071 · balena-os/balena-supervisor · GitHub . The patch issue I had was because I was incorrectly encoded the http body as json and the api was silently failing. That issue is tracked here PATCH /v1/device/host-config doesn’t properly validate JSON input · Issue #2072 · balena-os/balena-supervisor · GitHub . I’ve now been able to resolve this issue and got the device to connect using the socks5 proxy I have.

Hi @jonmont,

Thanks for updating! Indeed, the first few patch versions of Supervisor 14.4.x had that bug, and it should be fixed with v14.4.6. Let us know if there are any further issues with host config!

Regards,
Christina