# Cannot sync environment variable in local mode

**URL:** <https://forums.balena.io/t/cannot-sync-environment-variable-in-local-mode/3235>\
**Category:** Product support\
**Tags:** support, local-mode, resin-cli\
**Created:** [May 29, 2018, 3:45pm UTC](https://forums.balena.io/t/cannot-sync-environment-variable-in-local-mode/3235 "2018-05-29T15:45:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![molusc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/molusc/32/970_2.png) [@molusc](https://forums.balena.io/u/molusc)\
**Post date:** [May 29, 2018, 3:45pm UTC](https://forums.balena.io/t/cannot-sync-environment-variable-in-local-mode/3235/1 "2018-05-29T15:45:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![molusc](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/molusc/32/970_2.png) [@molusc](https://forums.balena.io/u/molusc)\
**Post date:** [May 31, 2018, 8:30am UTC](https://forums.balena.io/t/cannot-sync-environment-variable-in-local-mode/3235/4 "2018-05-31T08:30:19Z")

</div>

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.
