# .env not working? Bug?

**URL:** <https://community.convox.com/t/env-not-working-bug/416>\
**Category:** Rack (Version 2)\
**Created:** [February 25, 2019, 11:15am UTC](https://community.convox.com/t/env-not-working-bug/416 "2019-02-25T11:15:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alon](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/alon/32/49_2.png) [@alon](https://community.convox.com/u/alon)\
**Post date:** [February 25, 2019, 11:15am UTC](https://community.convox.com/t/env-not-working-bug/416/1 "2019-02-25T11:15:13Z")

</div>

We’re seeing that env vars are not set when running in a local rack.  
e.g. we have a .env with MYSQL\_PASSWORD set, yet the docker run generated includes `docker run -i ... -e MYSQL_PASSWORD ... -e MYSQL_PASSWORD= -e ...` instead of having the actual value set in the second key-value pair.  
If we set a default directly in the Docker Compose file, it works.

Has anything changed as far as .env files go?

---

<div class="post-metadata">

**Author:** ![robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@robert](https://community.convox.com/u/robert)\
**Post date:** [March 19, 2019, 10:40am UTC](https://community.convox.com/t/env-not-working-bug/416/2 "2019-03-19T10:40:16Z")

</div>

If you’re using “gen 2” (that is, a convox.yml file instead of docker-compose.yml, which has been the default now for quite a while) the .env file is not used at all. Instead the env is handled locally the same way as on aws using the `convox env`-commands.

The migration path is pretty simple by using `convox env set < .env`.

---

<div class="post-metadata">

**Author:** ![alon](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.convox.com/alon/32/49_2.png) [@alon](https://community.convox.com/u/alon)\
**Post date:** [March 19, 2019, 10:53am UTC](https://community.convox.com/t/env-not-working-bug/416/3 "2019-03-19T10:53:34Z")

</div>

I see. Kinda hard to figure out what follow breaking changes in Convox - that one, I missed.  
21 days later, and I find my answer. Thanks 🙂
