Failed to connect to Balena Supervisor using 127.0.0.1

image

root@f453f0e:/usr/src/app# curl -v 127.0.0.1:48485
* Rebuilt URL to: 127.0.0.1:48485/
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* connect to 127.0.0.1 port 48485 failed: Connection refused
* Failed to connect to 127.0.0.1 port 48485: Connection refused
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 48485: Connection refused

Python code:

rebooturl = str(os.environ.get('BALENA_SUPERVISOR_ADDRESS')) + '/v1/reboot?apikey=' + str(os.environ.get('BALENA_SUPERVISOR_API_KEY'))
os.system('curl -X POST --header "Content-Type:application/json" "' + rebooturl + '"')

Has anyone seen this behaviour before?

Hey there,

I think this problem is related to the other one you opened here: https://forums.balena.io/t/17499. If the supervisor is not running for any reason, then you will not be able to connect to it.

Lets try to debug it in the other thread and then check if its fixed here!

Wait, I think I parsed the title of the other thread incorrectly. Is the supervisor not running, or just failing to run the service?

What happens if you run systemctl status balena-supervisor in the host OS?