Failed to connect to supervisor-api

Hello,
Sometimes when i run a api command in Host Os i take the response :
curl: (7) Failed to connect to 127.0.0.1 port 48484: Connection refused

This doesnt happens all the time. Sometimes i receive the correct response of a Api command (e.g. curl “$BALENA_SUPERVISOR_ADDRESS/v2/applications/$BALENA_APP_ID/state?apikey=$BALENA_SUPERVISOR_API_KEY”)
So does anybody knows why happens that?
I run this command in local mode.

Thanks
Sakis

Hi @xamsak

It sounds like either the Supervisor is not running when you try to connect to it, or that maybe the container does not have access to it. Just to ensure this is the case, is the service trying to connect to the Supervisor a single or multicontainer application? If a multicontainer application, you’ll need to include the following lines in your docker-compose.yml for the appropriate service:

        labels:
            io.balena.features.supervisor-api: '1'

If you are (or it’s a single service application), then it sounds like something else may be going on. If so, let us know and if you can provide us with a dashboard URL of the device in question and grant support access, we could look into this for you. Additionally, if you could tell us the type of device you’re using and the version of balenaOS you’re running on it, this would be extremely useful.

Best regards, Heds

Hello Heds,

The problem solved and i think the problem was that the Supervisor was not running when i try it. I just dont know why the Supervisor container was exited. But now everything is ok.
Thank you very much for your response.

Sakis

Hi @xamsak , the supervisor should be running unless it was killed manually or there are serious problems. If you notice the supervisor stopped again please reach out to us and we can have a look at the device.