stacklio / stackl

An open source, end-to-end application orchestration platform.
https://stackl.io
GNU General Public License v3.0
5 stars 4 forks source link

(0.3.4.dev0) stackl_client.exceptions.ApiTypeError: Invalid type for variable '0'. Required value type is StackStage and passed type was dict at ['stages'][0] #251

Closed mieel closed 3 years ago

mieel commented 3 years ago

Stack config:

---
stack_infrastructure_template: acc_azure_sit
stack_application_template: nginx_postgres_app
stages:
- name: data
  services:
  - postgres_vm
- name: app
  services:
  - backend

params:
  # Common
  app_name: ticketing
  vnet_name: default-vnet
  vnet_subnet_name: default
  delete_os_disk_on_termination: true
  # ansible_host: "{{ azure_vm_public_name }}" USE STACKLHOSTS
  ansible_user: azureadmin
  ansible_ssh_pass: "ComplxP@ssw0rd!"
  ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
  ansible_become: yes
  # app scraper
  SCRAPE_DATABASEIP: "10.0.1.4"
  SCRAPE_DBNAME: reddit
  SCRAPE_SUBNAMES: "stocks:investing:wallstreetbets"
service_secrets:
  postgres_vm:
    backend_secret_path: secret/data/collaboration/acceptance/s3-backend/ticketing-db
  backend:
    backend_secret_path: secret/data/collaboration/acceptance/s3-backend/ticketing-back

When performing a stackl apply, you get an Internal Server Error, querying the stacks-core logs will lead to this

Traceback (most recent call last):
  File "/usr/local/bin/stackl", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/commands/apply.py", line 34, in apply
    apply_stack_instance(config_file, params, tags, secrets,
  File "/usr/local/lib/python3.9/site-packages/commands/apply.py", line 78, in apply_stack_instance
    invocation = stackl_client.models.StackInstanceInvocation(
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 1566, in wrapped_init
    return fn(self, *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model/stack_instance_invocation.py", line 204, in __init__
    setattr(self, var_name, var_value)
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 167, in __setattr__
    self[attr] = value
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 352, in __setitem__
    self.set_attribute(name, value)
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 139, in set_attribute
    value = validate_and_convert_types(
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 1444, in validate_and_convert_types
    input_value[index] = validate_and_convert_types(
  File "/usr/local/lib/python3.9/site-packages/stackl_client/model_utils.py", line 1406, in validate_and_convert_types
    raise get_type_error(input_value, path_to_item, valid_classes,
stackl_client.exceptions.ApiTypeError: Invalid type for variable '0'. Required value type is StackStage and passed type was dict at ['stages'][0]