zalando-stups / senza

Deploy immutable application stacks and create and execute AWS CloudFormation templates in a sane way

Home Page:https://pypi.python.org/pypi/stups-senza

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

senza commands throw an exception

elgris opened this issue · comments

After update to version 2.1.64 I got errors while trying to issue senza commands. For instance, senza traffic or senza inst. Exception is thrown only when service with specific name is used.

$ senza traf [here_goes_specific_name]
Unknown Error: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte.
Please create an issue with the content of /var/folders/t4/ynldbzh97tzd8fhdppg9g30d8ltpdn/T/senza-traceback-nbr82_4z

Exception details:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/senza/error_handling.py", line 105, in __call__
    self.function(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.5/site-packages/senza/cli.py", line 1160, in traffic
    stack_refs = get_stack_refs([stack_name, stack_version])
  File "/usr/local/lib/python3.5/site-packages/senza/cli.py", line 364, in get_stack_refs
    data = yaml.safe_load(fd)
  File "/usr/local/lib/python3.5/site-packages/yaml/__init__.py", line 94, in safe_load
    return load(stream, SafeLoader)
  File "/usr/local/lib/python3.5/site-packages/yaml/__init__.py", line 70, in load
    loader = Loader(stream)
  File "/usr/local/lib/python3.5/site-packages/yaml/loader.py", line 24, in __init__
    Reader.__init__(self, stream)
  File "/usr/local/lib/python3.5/site-packages/yaml/reader.py", line 85, in __init__
    self.determine_encoding()
  File "/usr/local/lib/python3.5/site-packages/yaml/reader.py", line 124, in determine_encoding
    self.update_raw()
  File "/usr/local/lib/python3.5/site-packages/yaml/reader.py", line 178, in update_raw
    data = self.stream.read(size)
  File "/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte

OS: MacOS

senza version: 2.1.64

Could you please give an example of stack reference that you are using? Which characters are used?

It seems that you have a file or directory with the same name as your service, so senza tries to load it as an yaml. Please run senza from another folder.

thanks @jmcs, that was exactly the case.