Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Create multiple stacks with different names for same applicaiton #216

Open
mohamedazouz opened this issue Jul 25, 2017 · 3 comments
Open

Comments

@mohamedazouz
Copy link

mohamedazouz commented Jul 25, 2017

  • I'm trying to create multiple stacks with different name for same application using parameter files
    i'm passing stack as following:
     StackName: "{{Arguments.StackName}}"
    

It gives me this error [AGENT] Stack not found: {{Arguments.StackName}}-20170718V379

When I tried to pass it sing command line it gives me with parameter file the following error:

[AGENT] Error: Parameter specified multiple times: "StackName"


@SergKam
Copy link

SergKam commented Feb 20, 2018

Problem is clearly here https://github.com/zalando-stups/lizzy/blob/master/lizzy/api.py#L109
Can we just try to replace the {{Arguments.any}} with one from provided parameters?

@boure
Copy link

boure commented Jul 4, 2018

I get other issues depending on the StackName:

  • for StackName: {{Arguments.StackName}} :
Traceback (most recent call last):
   File "/lizzy_edge_env/bin/lizzy", line 11, in <module>
     sys.exit(main_with_metrics())
   File "/lizzy_edge_env/lib/python3.5/site-packages/lizzy_client/cli.py", line 75, in main_with_metrics
     main()
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 722, in __call__
     return self.main(*args, **kwargs)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 697, in main
     rv = self.invoke(ctx)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1064, in invoke
     sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 621, in make_context
     self.parse_args(ctx, args)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 880, in parse_args
     value, args = param.handle_parse_result(ctx, opts, args)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1396, in handle_parse_result
     value = self.full_process_value(ctx, value)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1365, in full_process_value
     value = self.process_value(ctx, value)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1355, in process_value
     return self.type_cast_value(ctx, value)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1344, in type_cast_value
     return _convert(value, (self.nargs != 1) + bool(self.multiple))
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/core.py", line 1342, in _convert
     return self.type(value, self, ctx)
   File "/lizzy_edge_env/lib/python3.5/site-packages/click/types.py", line 38, in __call__
     return self.convert(value, param, ctx)
   File "/lizzy_edge_env/lib/python3.5/site-packages/lizzy_client/arguments.py", line 27, in convert
     data = yaml.safe_load(response.read())
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/__init__.py", line 94, in safe_load
     return load(stream, SafeLoader)
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/__init__.py", line 72, in load
     return loader.get_single_data()
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/constructor.py", line 37, in get_single_data
     return self.construct_document(node)
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/constructor.py", line 46, in construct_document
     for dummy in generator:
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
     value = self.construct_mapping(node)
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/constructor.py", line 204, in construct_mapping
     return super().construct_mapping(node, deep=deep)
   File "/lizzy_edge_env/lib/python3.5/site-packages/yaml/constructor.py", line 128, in construct_mapping
     "found unhashable key", key_node.start_mark)
 yaml.constructor.ConstructorError: while constructing a mapping
   in "<byte string>", line 2, column 14:
       StackName: {{Arguments.StackName}}
                  ^
 found unhashable key
   in "<byte string>", line 2, column 15:
       StackName: {{Arguments.StackName}}
  • for StackName: appname-{{Arguments.StackName}}, I get an error in the agent:
    [AGENT] Stack not found: appname-{{Arguments.Stage}}

@boure
Copy link

boure commented Jul 4, 2018

In the case where the StackName contains a parameter (e.g. appname-{{Arguments.Stage}}), the failing line seems to be

stack_dict = (Stack.get(stack_name, stack_version, region=region)
when lizzy tries to get the stack it just created.

In this case, Lizzy has logged Stack created and the stack can be found on AWS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants