hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
5.37k stars 1.28k forks source link

installation failure in docker #828

Closed fenio closed 4 years ago

fenio commented 4 years ago

Hey folks,

I'm having issue trying to install the newest (0.17.4) HACS on the newest (0.102.2) HA. I'm able to see HACS among other integrations but when I'm trying to add it all I got is spinning circle and then HA goes back to the list of integrations.

I tried to enable additional debug as stated in https://hacs.xyz/docs/basic/logs but I think it doesn't matter at this point.

I tried to google solution myself but whenever I saw similar issue it was all about DNS / network issues. I don't have such issues in my case. My docker container is able to resolve whatever domain name I try without issue using host or dig command.

To be honest I'm not sure what else can I try. My internet connection isn't super fast (up3Mbps/down16Mbps) but I think if it is enough to watch Netflix it should be enough to install HACS right? ;) I'm using pihole in my setup but for testing I tried to add integration with pihole disabled. I also tried to change my resolver to 8.8.8.8 or 1.1.1.1. It fails all the time with the same output.

The traceback from HA isn't very useful. Maybe some additional error handling should be introduced here but this is different topic.

Any hints are greatly appreciated.

Below is traceback and my configuration.yaml.

Thu Nov 28 2019 07:23:07 GMT+0100 (Central European Standard Time)
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 40, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 136, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 122, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 48, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 60, in post
    handler, context={"source": config_entries.SOURCE_USER}
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 66, in async_init
    flow = await self._async_create_flow(handler, context=context, data=data)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 638, in _async_create_flow
    await async_process_deps_reqs(self.hass, self._hass_config, integration)
  File "/usr/src/homeassistant/homeassistant/setup.py", line 292, in async_process_deps_reqs
    hass, integration.domain, integration.requirements
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 77, in async_process_requirements
    if pkg_util.is_installed(req):
  File "/usr/src/homeassistant/homeassistant/util/package.py", line 45, in is_installed
    return version(req.project_name) in req
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3137, in __contains__
    return self.specifier.contains(item, prereleases=True)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 703, in contains
    item = parse(item)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 31, in parse
    return Version(version)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 200, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
homeassistant:
  customize: !include customize.yaml

default_config:

frontend:
  javascript_version: latest

sun:
map:
person:

#custom_updater:
#  track:
#    - cards
#    - components
#  card_urls:
#    - https://raw.githubusercontent.com/custom-cards/information/master/repos.json
#    - https://raw.githubusercontent.com/kalkih/mini-media-player/master/tracker.json
#    - https://raw.githubusercontent.com/iammexx/home-assistant-config/master/ui/darksky/version.json
#    - https://raw.githubusercontent.com/kalkih/mini-graph-card/master/tracker.json
#    - https://raw.githubusercontent.com/MizterB/lovelace-secondaryinfo-entity-row/master/custom_cards.json
#  component_urls:
#    - https://raw.githubusercontent.com/custom-components/information/master/repos.json
#    - https://raw.githubusercontent.com/pnbruckner/homeassistant-config/master/custom_components.json

vacuum:
  - platform: xiaomi_miio
    host: 192.168.0.211
    token: !secret xiaomi_vacuum

http:
  base_url: !secret baseurl
  trusted_proxies: !secret trusted
  use_x_forwarded_for: true

google_assistant:
  project_id: !secret project
  api_key: !secret google

upnp:
  sensors: true
  local_ip: 192.168.0.201

cast:
  media_player:
    - host: 192.168.0.205
    - host: 192.168.0.207

fan:
  - platform: xiaomi_miio
    host: 192.168.0.210
    token: !secret xiaomi_fan

switch:
  - platform: broadlink
    host: 192.168.0.209
    mac: 'C8:F7:42:48:61:76'
    switches:
      tv:
        friendly_name: TV
        command_on: 'JgBYAAABKpITExITExMSExQSEhMTEhQTEjcTOBM3FDcTNxM3FDcTExI1FxISOBMTEjgTExITExMSExM3ExMSOBQSEjgUNxM3EwAFSQABKUoTAAxsAAEpShIADQU='
        command_off: 'JgBYAAABKpITExITExMSExQSEhMTEhQTEjcTOBM3FDcTNxM3FDcTExI1FxISOBMTEjgTExITExMSExM3ExMSOBQSEjgUNxM3EwAFSQABKUoTAAxsAAEpShIADQU='
      radio:
        friendly_name: Radio
        command_on: 'JgBwAFIPKhAXEBcQFxAXECoQFxAXEBcQFxAXECoAA0ZSDyoQFxAXEBcQFxAqEBcQFxAXEBcQFxAqAANGUg8qEBcQFxAXEBcQKhAXEBcQFxAXEBcQKgADRlIPKhAXEBcQFxAXECoQFxAXEBcQFxAXECoAA0YNBQAAAAAAAA=='
        command_off: 'JgBwAFIPKhAXECoQFxAqEBcQFxAXEBcQFxAXECoAA0ZSDyoQFxAqEBcQKhAXEBcQFxAXEBcQFxAqAANGUg8qEBcQKhAXECoQFxAXEBcQFxAXEBcQKgADRlIPKhAXECoQFxAqEBcQFxAXEBcQFxAXECoAA0YNBQAAAAAAAA=='
      tuner:
        friendly_name: Tuner
        command_on: 'JgBwAFIPFxAqEBcQKhAXECoQKhAXEBcQFxAXECoAA0ZSDxcQKhAXECoQFxAqECoQFxAXEBcQFxAqAANGUg8XECoQFxAqEBcQKhAqEBcQFxAXEBcQKgADRlIPFxAqEBcQKhAXECoQKhAXEBcQFxAXECoAA0YNBQAAAAAAAA=='
        command_off: 'JgBwAFIPKhAXECoQFxAqEBcQFxAXEBcQFxAXECoAA0ZSDyoQFxAqEBcQKhAXEBcQFxAXEBcQFxAqAANGUg8qEBcQKhAXECoQFxAXEBcQFxAXEBcQKgADRlIPKhAXECoQFxAqEBcQFxAXEBcQFxAXECoAA0YNBQAAAAAAAA=='

plex:
  host: 192.168.0.200
  token: !secret plex2

media_player:
  - platform: kodi
    host: 192.168.0.201

camera:
   - platform: generic
     name: Camera
     still_image_url: "http://192.168.0.204/cgi-bin/snapshot.cgi"
     stream_source: !secret dahua_url
     username: admin
     password: !secret dahua

ffmpeg:

stream:

discovery:

sensor:
  - platform: uptime
    name: Time Online
    unit_of_measurement: hours
  - platform: synologydsm
    host: 192.168.0.200
    username: fenio
    password: !secret synology
    monitored_conditions:
      - cpu_other_load
      - cpu_user_load
      - cpu_system_load
      - cpu_total_load
      - cpu_1min_load
      - cpu_5min_load
      - cpu_15min_load
      - memory_real_usage
      - memory_size
      - memory_cached
      - memory_available_swap
      - memory_available_real
      - memory_total_swap
      - memory_total_real
      - network_up
      - network_down
      - disk_name
      - disk_device
      - disk_smart_status
      - disk_status
      - disk_exceed_bad_sector_thr
      - disk_below_remain_life_thr
      - disk_temp
      - volume_status
      - volume_device_type
      - volume_size_total
      - volume_size_used
      - volume_percentage_used
      - volume_disk_temp_avg
      - volume_disk_temp_max
  - platform: rest
    name: smogtok
    json_attributes:
      - REGS
    value_template: 'OK'
    resource: https://smogtok.com/apprest/probedata/2899
  - platform: template
    sensors: 
      smogtok_temp: 
        friendly_name: Outside temperature
        value_template: '{{ states.sensor.smogtok.attributes["REGS"][0]["VALUE"] }}'
        device_class: temperature
      smogtok_pm25:
        friendly_name: Outside PM2,5
        value_template: '{{ states.sensor.smogtok.attributes["REGS"][1]["VALUE"] }}'
      smogtok_pm10:
        friendly_name: Outside PM10
        value_template: '{{ states.sensor.smogtok.attributes["REGS"][2]["VALUE"] }}'
      smogtok_humidity:                                                                 
        friendly_name: Outside humidity                                                        
        value_template: '{{ states.sensor.smogtok.attributes["REGS"][3]["VALUE"] }}'
        device_class: humidity
  - platform: template
    sensors:
      purifier_fan_speed:
        friendly_name: Fan speed
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.speed }}" 
      purifier_temperature:
        friendly_name: Inside temperature
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.temperature }}"
        device_class: temperature
      purifier_humidity:
        friendly_name: Inside humidity
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.humidity }}"
      purifier_aqi:
        friendly_name: Inside AQI
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.aqi }}"  
      purifier_favspeed:
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.favorite_level }}" 
      purifier_motorspeed:
        value_template: "{{ states.fan.xiaomi_miio_device.attributes.motor_speed }}" 
  - platform: darksky
    api_key: !secret darksky
    scan_interval:
      minutes: 5
    language: 'en'
    forecast:
      - 1
      - 2
      - 3
      - 4
      - 5
    monitored_conditions:
      - icon
      - summary
      - temperature_high
      - temperature_low
      - temperature
      - apparent_temperature
      - wind_speed
      - wind_bearing
      - precip_probability
      - daily_summary
      - visibility
      - pressure
      - humidity
  - platform: snmp
    host: 192.168.0.201
    baseoid: 1.3.6.1.4.1.2021.10.1.3.1
    community: libreelec
    version: 2c

android_ip_webcam:
  - host: 192.168.0.213 
    sensors:
      - sound
      - motion

pi_hole:
  host: '192.168.0.200:8080'
  ssl: false
  verify_ssl: false

tts:
  - platform: google_translate

group: !include groups.yaml
#automation: !include automations.yaml
script: !include scripts.yaml

twilio:
  account_sid: !secret twiliosid
  auth_token: !secret twiliotoken

logger:
  default: info
  logs:
    hacs: debug

input_select:
  purifier_fan:
    icon: mdi:fan
    name: Purifier Favorite Mode Fan Speed
    options:
        - 0
        - 2
        - 4
        - 6
        - 8
        - 10
        - 12
        - 14

automation:
  - alias: Set Purifier Fan Speed
    id: 'purifier_set_fan_speed'
    trigger:
    - platform: state
      entity_id: input_select.purifier_fan
    action:
    - service: fan.xiaomi_miio_set_favorite_level
      data_template:
        entity_id: fan.xiaomi_miio_device
        level: "{{ states('input_select.purifier_fan') }}"
hacs-bot[bot] commented 4 years ago

Make sure you have read the issue guidelines and that you filled out the entire template.

ludeeus commented 4 years ago

Then you can help each other 👌

fenio commented 4 years ago

I've just tried to add it in a legacy way. Running config check prior to reboot showed

bash-5.0# ./check 
Testing configuration at /config
INFO:homeassistant.util.package:Attempting install of attrs==19.2.0
ERROR:homeassistant.scripts.check_config:BURB
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/scripts/check_config.py", line 206, in check
    async_check_ha_config_file(hass)
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete
    return future.result()
  File "/usr/src/homeassistant/homeassistant/helpers/check_config.py", line 107, in async_check_ha_config_file
    integration = await async_get_integration_with_requirements(hass, domain)
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 48, in async_get_integration_with_requirements
    hass, integration.domain, integration.requirements
  File "/usr/src/homeassistant/homeassistant/requirements.py", line 77, in async_process_requirements
    if pkg_util.is_installed(req):
  File "/usr/src/homeassistant/homeassistant/util/package.py", line 45, in is_installed
    return version(req.project_name) in req
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3137, in __contains__
    return self.specifier.contains(item, prereleases=True)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 703, in contains
    item = parse(item)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 31, in parse
    return Version(version)
  File "/usr/local/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 200, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
Fatal error while loading config: expected string or bytes-like object
Failed config
  General Errors: 
    - expected string or bytes-like object

Successful config (partial)

So something weird is happening around attrs==19.2.0 its config version.

DeviousPenguin commented 4 years ago

So something weird is happening around attrs==19.2.0 its config version.

Since HA v0.102.2 the requirements are now for the attrs module to be v19.3.0, which is why you are getting these errors as your system will now have v19.3.0 if you are on the latest version of HA.

I'm getting the same error, even when just trying the HA 'config check' feature.

By the looks of it the next release of HACS should fix this 'attrs==19.2.0' error as it looks like the requirements file updated to fix this here:

https://github.com/hacs/integration/blob/master/custom_components/hacs/manifest.json

If you think the 'attrs==19.2.0' error could be causing you issues, you can try rolling back to HA v0.102.1 or HA HA v0.102.0 to test.