w

    wet-noon-14291

    4 months ago
    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

    4 months ago
    Which automation SDK (go, node, etc)?
    w

    wet-noon-14291

    4 months ago
    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

    4 months ago
    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

    4 months ago
    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

    4 months ago
    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

    4 months ago
    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

    4 months ago
    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

    4 months ago
    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

    4 months ago
    Just to check this is with the nodejs automation api and using inline programs?
    w

    wet-noon-14291

    4 months ago
    yes, it is with an inline program using the nodejs api
    e

    echoing-dinner-19531

    4 months ago
    hmm odd, I’ll see if we can repro it
    w

    wet-noon-14291

    4 months ago
    I can check if I can make a smaller repro as well.