Secrets not updated by `flyctl secrets set`

I’m having trouble with setting secrets:

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.

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?

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.

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

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.