You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: varlock-wrangler deploy does not remove secrets that are missing from the schema, contrary to the Cloudflare docs #1212
varlock-wrangler deploy replaces all Cloudflare vars and secrets with the ones defined in your .env.schema. Any vars or secrets set manually via the Cloudflare dashboard or wrangler secret put that aren't in your schema will be removed on the next deploy.
The "Vars or secrets missing after deploy" troubleshooting section says the same: "Manually added dashboard secrets not in your schema are removed".
What is actually happening?
The extra secret survives the deploy. Step 3 prints:
This appears to be Wrangler's documented behaviour, not a bug in how varlock-wrangler builds the upload. varlock-wrangler deploy passes secrets with --secrets-file, and wrangler deploy --help (4.149.0) says of that flag:
Applies additively with secrets from previous deployments - omitted secrets will not be deleted.
So the docs promise something the deploy doesn't do for secrets.
I only tested secrets, not vars. The --keep-vars=false that varlock-wrangler adds to a plain deploy suggests the docs are accurate for vars.
This matters for anyone who relies on the docs to clean up. For example, if you delete a key from your vault expecting the next deploy to remove it from the Worker, the old secret actually stays live until you run wrangler secret delete.
Either of these would resolve it:
Change the docs (both the integration section and the troubleshooting note) to say that secrets are added or updated but never removed, and that removing a secret needs wrangler secret delete.
Or make varlock-wrangler deploy delete secrets that are not in the schema, for example by listing them with wrangler secret list --format json and deleting the ones the schema doesn't own, while leaving __VARLOCK_ENV* alone. Deleting secrets is destructive, so it probably belongs behind a flag.
Found while checking the integration for a multi-provider Workers project. Thanks for Varlock; the rest of the integration worked exactly as documented.
I actually discovered this recently, but did not realize the docs were misleading.
At the moment I believe it is a limitation of cloudflare and not something we can fix, but I will be pushing them to get a new flag into wrangler/cf so we can opt into "this tool completely manages env vars" behaviour.
Thanks for the report - will update the docs in the meantime!
Activity
pullfrog commentedon Oct 13, 2026
theoephraim commentedon Oct 13, 2026
See cloudflare/workers-sdk#15343
I actually discovered this recently, but did not realize the docs were misleading.
At the moment I believe it is a limitation of cloudflare and not something we can fix, but I will be pushing them to get a new flag into wrangler/cf so we can opt into "this tool completely manages env vars" behaviour.
Thanks for the report - will update the docs in the meantime!