Deployed Marimo Failed to Instantiate Errors
Welp, hopefully this one is an actual issue, not just a typo 😅
Running my docker container on Fly.io and getting some pretty frequent failures to load the app/notebook.
Poking through source on github that the stack trace pointed to, and it looks like it's expecting there to be no session, but there is one
Interestingly, one way this manifests is the browser gets stuck, never loads the app, and spams the /ws endpoint (see screenshot)
I've seen other instances where it pops up saying "failed to instantiate"
8 Replies
Here's the screenshot:
Getting a 401 when it shows up with the Failed to instantiate error
You likely have 2 instances on fly running at the same time. marimo doesn't support multi-instance out of the box (since it hold state and need a bit more complicated infra there).
If you drop your instance count to 1, it should fix the issue
Multi instance meaning: two Marimo kernels running within the same origin (scheme+host+port)? OR are you talking about multiple Marimo kernels running in one fly.io VM?? (I don't have my head wrapped around fly.io's like-Docker-but-not-Docker container runtime model)
The former. Fly will launch two instances by default and route randomly to one of them. Should be viewable in the fly dashboard
Ah, gotcha. That's almost certainly it. Thank you for the response.
Might i suggest adding a quick callout to the docker deployment page in the docs to use a single instance?
Also, definitely no need for this for now, but I imagine that sticky sessions on the proxy/load balancer might mitigate this if I understand the limitation correctly? If that's true, I guess it might be worth mentioning that in the docs too, though I don't expect many people are sending enough traffic to Marimo to really justify horizontal scaling. I just imagine it would be useful for availability/failure recovery
Yea both good suggestions to add. We can add that