https://pulumi.com logo
#general
Title
# general
w

wet-noon-14291

05/02/2022, 11:20 AM
Hello. I have an automation app that some times ends up in a weird state and wonder if anyone might know what happens? If our automation project fails once to update a stack all the updates to the same stack after that will end with
"One or more errors occurred"
Even though everything has succeeded. If I restart the application it works just fine and the message disappear, which I find pretty strange.
e

echoing-dinner-19531

05/02/2022, 11:26 AM
Which automation SDK (go, node, etc)?
w

wet-noon-14291

05/02/2022, 11:27 AM
node
I think it might be related to us not waiting for a promise to finish or something somewhere in the code. But that shouldn't impact two different runs as I see it. Ideally the pulumi client should be "stateless", so it failing once shouldn't impact the next call which seems to be happening now.
e

echoing-dinner-19531

05/02/2022, 11:32 AM
Ideally the pulumi client should be "stateless",
Ah it's not. If your using inline stacks there is global state inside the pulumi node sdk so you can't run operations in parallel.
w

wet-noon-14291

05/02/2022, 11:41 AM
ok, so that explains the first part of why I can experience what I see, that is, if it fails one time the next can also fail... but it doesn't explain why I do get the error even though everything has succeeded.
And I thought/question. Does that state need to be in the SDK? Shouldn't in that case be a call against the API to verify if something is running or not? I mean, if you create an web api using automation there might other nodes trying to run operations at the same time.
e

echoing-dinner-19531

05/02/2022, 12:57 PM
Not having the state as a global in the SDK would require a large api change to pass the deployment context through everywhere (because node doesn't have async locals). The go SDK is written like this, maybe 4.0 we could revisit it.
w

wet-noon-14291

05/03/2022, 11:53 AM
That's fine, but I still don't understand why I get an "One or more errors occurred" even though all the resources have been provisioned, and that it only happens after on deploy has failed first.
e

echoing-dinner-19531

05/03/2022, 12:21 PM
My guess is that the async tracking the engine does is picking up some left over asyncs from the first update and thinking their part of the other updates. Do you get any more logs than just "One or more errors occurred"?
w

wet-noon-14291

05/03/2022, 7:07 PM
That is the only log I get, so it is quite hard to debug. I do think I am awaiting all async, but must be missing something.
e

echoing-dinner-19531

05/03/2022, 8:22 PM
Just to check this is with the nodejs automation api and using inline programs?
w

wet-noon-14291

05/04/2022, 1:28 PM
yes, it is with an inline program using the nodejs api
e

echoing-dinner-19531

05/04/2022, 1:31 PM
hmm odd, I’ll see if we can repro it
w

wet-noon-14291

05/04/2022, 3:33 PM
I can check if I can make a smaller repro as well.
3 Views