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
73.39k stars 30.65k forks source link

Telegram not working in 0.74.2 #15908

Closed webtome closed 6 years ago

webtome commented 6 years ago

Home Assistant release with the issue:

Home Assistant: 0.74.2 Python: 3.5.3

Last working Home Assistant release (if known): Not any. This is first try.

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

Raspberry Pi 3+ running Raspbian installed from here: https://www.raspberrypi.org/downloads/raspbian/

Component/platform:

https://www.home-assistant.io/components/telegram_bot.polling/

Description of problem: I get error when I'm trying to use Telegram. Unable to install package python-telegram-bot.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 0
  longitude: 0
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: UTC
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

# Weather prediction
#sensor:
#  - platform: yr

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

# 1-Wire
sensor:
  - platform: onewire
    names:
      28.46CDC3030000: "Annexet"
    mount_dir: "/mnt/1wire"

#Notifieringar
#notify: !include notify.yaml
notify:
  - platform: pushbullet
    api_key: "o.24e5et5b3mumhtzAlvQJ6806eoEnmCSO"
    name: pushbullet

#  - platform: telegram
#    name: notify
#    chat_id: 484711

telegram_bot:
  - platform: polling
    api_key: "69XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXYk"
    allowed_chat_ids:
      - 611111111

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

Traceback (if applicable):

2018-08-09 19:57:47 ERROR (Thread-9) [homeassistant.util.package] Unable to install package python-telegram-bot==10.1.0: Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 360, in run
    prefix=options.prefix_path,
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Åtkomst nekas: '/srv/homeassistant/lib/python3.5/site-packages/python_telegram_bot-10.1.0.dist-info'
2018-08-09 19:57:47 ERROR (MainThread) [homeassistant.requirements] Not initializing telegram_bot because could not install requirement python-telegram-bot==10.1.0
2018-08-09 19:57:47 ERROR (MainThread) [homeassistant.setup] Setup failed for telegram_bot: Could not install all requirements.
2018-08-09 19:57:47 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_call_id=1976367824-3, domain=persistent_notification, service_data=notification_id=invalid_config, title=Invalid config, message=The following components and platforms could not be set up:

 - [telegram-bot](https://home-assistant.io/components/telegram_bot/)

Please check your config., service=create>
2018-08-09 19:57:47 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=None, entity_id=persistent_notification.invalid_config, new_state=<state persistent_notification.invalid_config=notifying; title=Invalid config, message=The following components and platforms could not be set up:

 - [telegram-bot](https://home-assistant.io/components/telegram_bot/)

Please check your config. @ 2018-08-09T17:57:47.813749+00:00>>

Additional information:

awarecan commented 6 years ago

user and/or path permission issue cause pip install python-telegram-bot==10.1.0 failed. This is not a bug, please ask for help in our community forum or discord chat channel

webtome commented 6 years ago

Alright! I see. That's sounds quite good. Thanks for your quick answer! Much appreciated. I've already asked for help in that community forum and also in discord chat channel. But no comments or solutions so far :(

webtome commented 6 years ago

I got a tip in Discord: $ find /srv/homeassistant ! -user homeassistant -print But my result was empty. And that should be correct I was told. "That's good, but odd."

So, still I have this error. Anyone?