Sceptre: Fix sceptre_user_data with !stack_output

Created on 17 Dec 2018  路  3Comments  路  Source: Sceptre/sceptre

In v2.0 When referencing sceptre_user_data with a stack_output resolver an error occurs where the resolvable property is read Sceptre enters into a recursion and eventually returns a RecursionError: maximum recursion depth exceeded.

important bug

Most helpful comment

I would echo @ryanpagel 's comment - this is blocking our upgrade to v2 sceptre, and given the timelines on end-of-support for v1 I'd ideally like to start our upgrade sooner than the 2.1.1 milestone is currently scheduled (end of April). If this was to be released sooner I would be very happy!

All 3 comments

An easy way to reproduce:

template.yaml
just a simple NOOP template that creates no resources

---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Master stack: PathToMasterStackFile'

Conditions:
  HasNot: !Equals [ 'true', 'false' ]

Resources:
  NullResource:
    Type: 'Custom::NullResource'
    Condition: HasNot

Outputs:
  TestOutput:
    Value: !Ref 'AWS::StackName'

config.yaml
just general testing config

project_code: testing
region: ap-southeast-2

stack1.yaml

template_path: template.yaml

stack2.yaml
stack2 depends on stack1 directly or indirectly

template_path: template.yaml
sceptre_user_data:
  # both test & test2 will cause RecursionError. uncomment one or the other to test
  #test: !stack_output stack1.yaml::TestOutput
  #test2: !stack_output_external testing-stack1::TestOutput

to execute:

$ sceptre create stack2.yaml --yes

The root issue (as correctly pointed by @pha6d in #550) seem to be the call to fetch connection manager in line 65 of stack_output.py:

connection_manager = self.stack.template.connection_manager

I've tried to go through the recursion, but I'm still unable to grasp the concepts behind Resolver and ResolvableProperty classes. I suspect that what happens is the stack_output resolver keeps attempting to resolve itself.

Issue can be fixed by getting connection manager from the stack itself:

connection_manager = self.stack.connection_manager

However, given that connection_manager is created under template property, it makes me wonder if it will work in all the cases. (tests pass)

Any idea when this might get released? We make heave use of stack_output_external so this issue is preventing us from upgrading to sceptre 2.x.

I would echo @ryanpagel 's comment - this is blocking our upgrade to v2 sceptre, and given the timelines on end-of-support for v1 I'd ideally like to start our upgrade sooner than the 2.1.1 milestone is currently scheduled (end of April). If this was to be released sooner I would be very happy!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabiodouek picture fabiodouek  路  5Comments

theseanything picture theseanything  路  4Comments

heikkima picture heikkima  路  6Comments

medbensalem picture medbensalem  路  7Comments

nikolay picture nikolay  路  8Comments