Skip to content
← Back to activity

Immutable solution version

Deno Deploy: "Queues not available on preview environment" error in production right after deploy

Version 1

Complete solution

How to fix: Deno Deploy: "Queues not available on preview environment" error in production right after deploy. This was a platform-side race in how Deno Deploy classified a fresh deployment's environment. Right after a production deploy, the new isolate could briefly be treated as a preview environment, so Deno Queues refused to run and in some cases the queued message was dropped.

The problem

The reporter deployed a Deno Deploy app to production via GitHub Actions (deployctl from the main branch, no preview promotion). Immediately after a deployment, the app threw "Queues not available on preview environment" even though it was running in production. It only happened when the service was hit right after a deploy; an automated smoke test that fired requests as soon as the deploy finished would see initial requests pass (old environment) and then fail (new environment not yet recognized as production). Waiting 5-8 minutes after deploy made it go away.

What fixed it

This was a platform-side race in how Deno Deploy classified a fresh deployment's environment. Right after a production deploy, the new isolate could briefly be treated as a preview environment, so Deno Queues refused to run and in some cases the queued message was dropped. Maintainer igorzi investigated and a fix was rolled out in late October 2023; the reporter confirmed multiple clean deployments afterward and closed the issue. If you hit this on an older deployment, the practical workaround is to wait a few minutes after deploying before running smoke tests or health checks that enqueue queue messages, and re-running the deploy job also clears the state.

Evidence

A user asked: The reporter deployed a Deno Deploy app to production via GitHub Actions (deployctl from the main branch, no preview promotion). Immediately after a deployment, the app threw "Queues not available on preview environment" even though it was running in production. It only happened when the service was hit right after a deploy; an automated smoke test that fired requests as soon as the deploy finished would see initial requests pass (old environment) and then fail (new environment not yet recognized as production). Waiting 5-8 minutes after deploy made it go away. The verified answer: This was a platform-side race in how Deno Deploy classified a fresh deployment's environment. Right after a production deploy, the new isolate could briefly be treated as a preview environment, so Deno Queues refused to run and in some cases the queued message was dropped. Maintainer igorzi investigated and a fix was rolled out in late October 2023; the reporter confirmed multiple clean deployments afterward and closed the issue. If you hit this on an older deployment, the practical workaround is to wait a few minutes after deploying before running smoke tests or health checks that enqueue queue messages, and re-running the deploy job also clears the state. Thread: https://vectle.com/threads/thr_UtLlhvO49feKRopVlj6ovQ

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_-bf8Nbi9349ehAB-O50_JQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Deno Deploy: &quot;Queues not available on preview environment&quot; error in production right after deploy <span>— Vectle</span></a>

Deno Deploy: "Queues not available on preview environment" error in production right after deploy | Vectle