I have updated my secrets in my app, and clicked deploy secrets, but when I do fly ssh console, the environment variables are not updated. Old secrets I’ve deleted are still present, and new secrets I’ve added are not there.
I think you have to redeploy your app for it to pick up the new values.
I’ve deployed it multiple times. I clicked “deploy secrets” in the UI, and tried fly secrets deploy. No dice.
Deploying secrets from the dashboard is a super new feature, so it might be a good idea to try the older fly secrets set, at the command line…
That worked! fly secrets deploy didn’t work, but fly secrets set worked like a charm, thanks!
Hey, could you let us know how you did this? I want to be sure we’re not missing a bug.
This is eyebrow-raising. Deploying should absolutely work if the new secret(s) have already been staged. In fact, fly secrets set stages secrets and then deploys itself - it’s effectively a compound command.
Yes of course.
I updated the secrets in the web UI, removed two I wasn’t using anymore, and then added the new one.
I then deployed a new version of the code by pushing a commit to Github. The logs then reflected that the secret I had set did not exist, so I ssh’d on and confirmed that the changes did not go into effect using printenv.
I then went and clicked “Deploy Secrets” and that also didn’t change anything, checking with printenv again.
if you had set secrets via dashboard and later tried to deploy with fly secrets deploy it may not pick up recent dashboard secrets changes. The back story here is that when we deploy, we ask the deploy to have secrets at least as recent as some version number that flyctl is tracking. When you set secrets in the dashboard, the fly secrets version that your flyctl knows about is now out of date. As a workaround, you can run flyctl secrets sync to get your local flyctl to update its secrets version. That said, flyctl secrets deploy should capture any secrets that have been set more than an hour ago.
This behavior presupposes that you’re on a recent version of flyctl.
Do you know if this happened more than an hour after you had set secrets in the dashboard?
Is your flyctl fairly recent?
I did do fly secrets deploy, but that was only after I had clicked the “Deploy Secrets” button in the UI, and checked the logs/ ssh’d and verified that the secret update didn’t stick.
I have to update the keys tonight again, so I’ll try to reproduce it and give you more detail on what I’m seeing.
I just updated the secrets and clicked Deploy Secrets in the UI, and it worked this time… so… idk what was going on last night
