lizzy icon indicating copy to clipboard operation
lizzy copied to clipboard

Create multiple stacks with different names for same applicaiton

Open mohamedazouz opened this issue 7 years ago • 3 comments

  • 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"


mohamedazouz avatar Jul 25 '17 13:07 mohamedazouz

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?

SergKam avatar Feb 20 '18 18:02 SergKam

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 avatar Jul 04 '18 11:07 boure

In the case where the StackName contains a parameter (e.g. appname-{{Arguments.Stage}}), the failing line seems to be https://github.com/zalando-stups/lizzy/blob/0d3b1a97a20e1d8b4b9e703a2af5ea319bc8f172/lizzy/api.py#L136 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.

boure avatar Jul 04 '18 12:07 boure