Skip to main content

A failure in a parent stack blocks permanently children stacks that refer to an output

Given a dependency between a parent stack and a group of children stacks:

  1. The parent stack run fails (it becomes the last one in the stack runs)

  2. All children stacks with dependency references to any parent output get blocked with the following message:
    job assignment failed: the following inputs are missing: <parent_stack>:<output> => <child_input>

However, you can clearly see the output value in the parent stack.

The issue is that the child stack is not able to get the output value when the latest run has failed.

  • Why the output is not available in the parent stack when it fails.

  • Why the outputs don't match with the state at any time? It will be in the state anyway.

Real example:

  1. We are creating a bucket in a parent stack.

  2. The bucket is recreated from another account so we have to wait until AWS drops the name reservation.

  3. In the meantime though, we can't use any child stack that depends on any output from the parent stack (regardless if the output is related to the bucket issue or not).

This is at all not how Spacelift should behave from my understanding. No child stack should be blocked if the parent stack contains the output in the terraform state, regardless of the parent’s last stack run status.

Otherwise, a single change in one stack (a simple failure), will always block other children stacks for no reason.


More context in here (internal link): https://app.clickup.com/t/8695ecwy4

Workaround
Problem
Status: ✅ Completed3 comments

Log in to comment and vote

Comments3

  • Natalia Gazda

    Team•

    Sep 10, 2024

    Hey @Álvaro Torres Cogollo, we actually made a change last week to the way output upload works, so that we shouldn't upload the outputs if the apply isn't successful. So in theory it's always safe to use the outputs if they exist.

    Caveat: it won’t use the outputs of the failed run, it’ll use the previous successful run.

    Do you think that would solve your issue, or is there anything else? :)

    • Cyan Toaster

      •

      Sep 10, 2024

      So just to understand it. If a parent stack fails, will children stacks get the output from the latest parent stack run that worked?

      If so, that solves this issue. The issue was that I got completely blocked in any children stack until the parent worked. So as long as I can run the children, I’m fine.

      Thanks

      • Natalia Gazda

        Team•

        Sep 10, 2024

        @Álvaro Torres Cogollo yes, exactly :) Great, then I’m marking that as completed :)