# Environment variable updates

**URL:** <https://forums.balena.io/t/environment-variable-updates/367931>\
**Category:** openBalena\
**Created:** [May 15, 2023, 12:42pm UTC](https://forums.balena.io/t/environment-variable-updates/367931 "2023-05-15T12:42:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danclimasevschi](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@danclimasevschi](https://forums.balena.io/u/danclimasevschi)\
**Post date:** [May 15, 2023, 12:42pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/1 "2023-05-15T12:42:36Z")

</div>

Hi!  
First and foremost, thank you for the awesome `openbalena` project 🙂  
I was trying to figure out one feature, but this seems to be part of the `balenaCloud` stack.

1. Running a self-hosted `openbalena`
2. I have a fleet and one device running
3. I am updating an environment variable

In `balenacloud` all services on the affected device are automatically restarted and the new environment variables are fetched after step 3 is performed. On openbalena however, nothing happens, I would have to reboot the device for that to happen.

Some extra infos:  
After modifying or updating or deleting any environment variable, I see the devices’ supervisor successfully talking to the openbalena stack:

```auto
...
GET /v1/device 200 - 91.723 ms
[api] GET /v2/applications/1/state 200 - 63.692 ms
...

```

What would be the best way to achieve this, or more generally, when changing any metadata about a given device?  
For now, I saw that issuing an update request does the trick [Interacting with the balena Supervisor - Balena Documentation](https://docs.balena.io/reference/supervisor/supervisor-api/#post-v1update)

Thanks,  
Dan

---

<div class="post-metadata">

**Author:** ![fisehara](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/fisehara/32/6290_2.png) [@fisehara](https://forums.balena.io/u/fisehara)\
**Post date:** [May 17, 2023, 12:13pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/3 "2023-05-17T12:13:36Z")

</div>

Hello,

can you please share the balenaOS version and supervisor version that you are running?  
It seems to be pretty old, as it calls for /v1/device and `/v2/applications/1/state`

Best Regards  
Harald

---

<div class="post-metadata">

**Author:** ![danclimasevschi](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@danclimasevschi](https://forums.balena.io/u/danclimasevschi)\
**Post date:** [May 17, 2023, 12:52pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/4 "2023-05-17T12:52:24Z")

</div>

Hi,  
running on 2.113.18

BR,  
Dan

---

<div class="post-metadata">

**Author:** ![fisehara](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/fisehara/32/6290_2.png) [@fisehara](https://forums.balena.io/u/fisehara)\
**Post date:** [May 17, 2023, 1:04pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/5 "2023-05-17T13:04:38Z")

</div>

Hello,

can you also please specify the balena-supervisor version running on the device?

Best Regards  
Harald

---

<div class="post-metadata">

**Author:** ![danclimasevschi](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@danclimasevschi](https://forums.balena.io/u/danclimasevschi)\
**Post date:** [May 17, 2023, 1:09pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/6 "2023-05-17T13:09:04Z")

</div>

Hi,  
also rather new: 14.9.4

BR,  
Dan

---

<div class="post-metadata">

**Author:** ![fisehara](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/fisehara/32/6290_2.png) [@fisehara](https://forums.balena.io/u/fisehara)\
**Post date:** [May 17, 2023, 1:24pm UTC](https://forums.balena.io/t/environment-variable-updates/367931/7 "2023-05-17T13:24:57Z")

</div>

Hello,

thanks for providing these information.  
I was confused by the log that you’ve shared:

```auto
GET /v1/device 200 - 91.723 ms
[api] GET /v2/applications/1/state 200 - 63.692 ms

```

These log lines are showing that some service on the device is calling the supervisor API: [Interacting with the balena Supervisor - Balena Documentation](https://docs.balena.io/reference/supervisor/supervisor-api/#get-v1device) and [Interacting with the balena Supervisor - Balena Documentation](https://docs.balena.io/reference/supervisor/supervisor-api/#get-v2applicationsappidstate)

Please share more loglines for the supervisor service with: ` journalctl -f -u balena-supervisor -n 200`

In addition, how do you inspect that the environment variable has not updated? Did you perform an `printenv` inside a container to verify it’s not updated or set?

Best Regards  
Harald
