pulumi
pulumi copied to clipboard
Pulumi import with file errors out with 503 service unavailable
Hello!
- Vote on this issue by adding a 👍 reaction
- To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already)
Issue details
I use pulumi cloud. The stack got into a bad state, I tried to remove the pending_operations from the stack.json and import with pulumi stack import. However, the CLI hangs for a while and returns a 503. I am unable to proceed.
How large is your state file? (pulumi stack export > stack.json)
and import with
pulumi import
Just to make sure - do you mean pulumi stack import?
the CLI hangs for a while and returns a 503
This is typically because your client machine was unable to upload the state file to the service within the limit the API expects (I believe 1 minute). Hence why I asked about the size of the state file. We may need to revisit this limit to allow for larger state file uploads on lower bandwidth internet connections.
Hey @lukehoban, yes I meant pulumi stack import. The stack.json file is 13.1MB over 110,000 lines.
@lukehoban What do we recommend for folks who find themselves in this situation? I believe @praveenperera got entirely stuck here because he couldn't clear out pending_operations from his stack.
For what it's worth, I could repro this with a slow network link (1mbps) and a large checkpoint file (5mb) generated from creating a few hundred Kubernetes resources. It's also likely geography plays a role due to latency.

$ time pulumi stack import < chk.json
error: could not import deployment: [503]
real 1m13.472s
user 0m0.373s
sys 0m0.085s
Not a surprise, it's simple math in terms of how much we can upload within the given time, so if there really is a 1 minute limit, there's always going to be a way to hit that.
The example 5mb checkpoint gzips down to less than 140kb, by the way. I thought we gzipped checkpoints during uploads? Should we be doing that for imports over a certain size?