# Secrets not updated by \`flyctl secrets set\`

**URL:** <https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755>\
**Category:** Build debugging\
**Created:** [June 23, 2022, 6:22pm UTC](https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755 "2022-06-23T18:22:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![brody-next-tms](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@brody-next-tms](https://community.fly.io/u/brody-next-tms)\
**Post date:** [June 23, 2022, 6:22pm UTC](https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755/1 "2022-06-23T18:22:23Z")

</div>

I’m having trouble with setting secrets:

```bash
fly secrets set API_KEY='some_production_api_key'

Release v77 created
Monitoring Deployment

3 desired, 3 placed, 3 healthy, 0 unhealthy [health checks: 1 total, 1 passing]
--> v77 deployed successfully

```

When I go into my Rails application and check `ENV['API_KEY']` I’m still getting the old value even after waiting until v77 is deployed but the strange part is that when running `env` I see the correct (updated) value.

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [June 25, 2022, 8:31pm UTC](https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755/2 "2022-06-25T20:31:23Z")

</div>

You see the right value when you run `fly ssh console` and then running `env`?

That’s weird. If `env` is correct our environment is doing what it’s supposed to. Is it possible you have two environment variables with different cases like `API_KEY` and `api_key`?

---

<div class="post-metadata">

**Author:** ![brody-next-tms](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@brody-next-tms](https://community.fly.io/u/brody-next-tms)\
**Post date:** [July 18, 2022, 10:27pm UTC](https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755/3 "2022-07-18T22:27:17Z")

</div>

Sorry for the very late response! I thought I had resolved and updated this thread, but I do see this coming back up in one of my environments.

```auto
% fly ssh console
Connecting to top1.nearest.of.[REDACTED].internal... complete
# launcher rails c
Loading production environment (Rails 7.0.3.1)
irb(main):001:0> ENV['WEB_CONCURRENCY']
=> "28"
irb(main):002:0> exit
# env | grep WEB_CONCURRENCY
WEB_CONCURRENCY=2 

```

---

<div class="post-metadata">

**Author:** ![brody-next-tms](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@brody-next-tms](https://community.fly.io/u/brody-next-tms)\
**Post date:** [July 19, 2022, 4:27pm UTC](https://community.fly.io/t/secrets-not-updated-by-flyctl-secrets-set/5755/4 "2022-07-19T16:27:44Z")

</div>

Doing more research I’ve discovered some Heroku buildpacks override `WEB_CONCURRENCY` so I’ve simply switched my application to use `FLY_VCPU_COUNT` instead.
