home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
74.21k stars 31.16k forks source link

credstash fails to run on (at least) 0.80.3 and higher #18073

Closed maxandersen closed 6 years ago

maxandersen commented 6 years ago

Home Assistant release with the issue:

0.80.3

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.):

OSX

Component/platform:

https://www.home-assistant.io/docs/tools/credstash/

Description of problem:

running hass --script credstash help results in this error/output:

hass --script credstash help                                                                                                                                                                                    ⏎
INFO:homeassistant.util.package:Attempting install of credstash==1.14.0
INFO:homeassistant.util.package:Attempting install of botocore==1.7.34
Traceback (most recent call last):
  File "/usr/local/bin/hass", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/homeassistant/__main__.py", line 375, in main
    return scripts.run(args.script)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/scripts/__init__.py", line 57, in run
    return script.run(args[1:])  # type: ignore
  File "/usr/local/lib/python3.7/site-packages/homeassistant/scripts/credstash.py", line 28, in run
    import credstash
  File "/Users/max/.homeassistant/deps/lib/python/site-packages/credstash.py", line 55, in <module>
    'RIPEMD': hashes.RIPEMD160,
AttributeError: module 'cryptography.hazmat.primitives.hashes' has no attribute 'RIPEMD160'
flamechair commented 6 years ago

Looks like we need to bump credstash from 1.14 to 1.15: https://github.com/home-assistant/home-assistant/blob/master/homeassistant/scripts/credstash.py#L7

Fixed in this PR: https://github.com/fugue/credstash/pull/178#issuecomment-404829089

PR merged with this release: https://github.com/fugue/credstash/releases/tag/v1.15.0

flamechair commented 6 years ago

TL;DR

cryptography, a credstash dependency removed the RIPEMD160 hash and broke credstash:1.14, so credstash:1.15 was released which removed the unsupported hashes.

flamechair commented 6 years ago
(homeassistant) homeassistant@tyr:/home/tyler$ hass --script credstash help
INFO:homeassistant.util.package:Attempting install of credstash==1.15.0
INFO:homeassistant.util.package:Attempting install of botocore==1.7.34
usage: hass [-h] [--script {credstash}] {get,put,del,list} [name] [value]
hass: error: argument action: invalid choice: 'help' (choose from 'get', 'put', 'del', 'list')