Cannot sync environment variable in local mode

I’m trying to work in local mode but I can’t figure out how to set environment variables.

I know they can be added manually to .resin-sync.yml but I can’t find any documentation about the correct format to use.

I’ve tried to add using resin-cli but I can’t seem to sync it to the device. I added the env with:

sudo resin env add URL 'http://myhost.home/' --device <my-uuid>

And I can see it:

$ sudo resin envs --device <my-uuid>
ID    NAME VALUE
45995 URL  http://myhost.home/

But when I try to sync I get an error:

$ sudo resin sync --device <my-uuid>
Getting information for device: <my-uuid>
Got application container info.
resin sync failed. ResinRequestError: Request error: App not found
ResinRequestError: Request error: App not found

If you need help, don't hesitate in contacting us at:

  GitHub: https://github.com/resin-io/resin-cli/issues/new
  Forums: https://forums.balena.io

I’m in the local application folder with the .resin-sync.yml file.

Am I doing something wrong or is there a problem with my configuration?

I managed to get this working by guessing the correct format for the environment variable in .resin-sync.yml (it’s just yaml at the end of the day)

Example in case anyone else finds this, since it isn’t in the docs:

  environment:
    - 'URL=http://myhost.home/'

Then I did a resin local push to get it onto the actual device.

3 Likes