Repository navigation
fix(infra): attach the computer to an existing sandbox session class - #320
Merged
Merged
Conversation
|
Preview |
Alchemy creates a Durable Object class's container application before the Worker upload that marks an existing namespace Container-enabled. So turning the computer on for a stage that already has SandboxSession fails with "Durable Object namespace is not Container-enabled". A patch to alchemy keeps the reserved name and creates the application on the next deploy instead.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Turning the sandbox's computer on (
COMMISSARY_COMPUTER=on) for a stage that already has theSandboxSessionclass fails the deploy:Alchemy (2.0.0-beta.83, the latest) can create the class's container application before the State Worker's upload marks the existing namespace as Container-enabled. On a fresh stage this doesn't happen: the namespace doesn't exist yet, so the application waits for the Worker. Production and
cloudboth already haveSandboxSession(#222), so turning the computer on there would fail the same way.This adds a pnpm patch to alchemy's
DurableObjectApplicationprovider. When Cloudflare answers "not Container-enabled", the provider keeps the reserved application name and doesn't fail, so the Worker uploads with thecontainersmetadata. The next deploy then creates the application, because the provider's diff re-reconciles any application that isn't live.Testing
preview-computerlabel failed exactly as shown above.[State/SandboxSession-Containers] createdand[State] updated.Follow-up
Report the ordering bug upstream to alchemy, and drop the patch once a release fixes it.