Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASUSWRT Component: The command was not found or was not executable: ssh. #13405

Closed
kukudemajia opened this issue Mar 23, 2018 · 5 comments
Closed

Comments

@kukudemajia
Copy link

kukudemajia commented Mar 23, 2018

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.65.6

Python release (python3 --version):
3.6.3

Component/platform:
ASUSWRT

Description of problem:

Error setting up platform asuswrt
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 181, in async_setup_platform
    platform.get_scanner, hass, {DOMAIN: p_config})
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 82, in get_scanner
    scanner = AsusWrtDeviceScanner(config[DOMAIN])
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 130, in __init__
    data = self.get_asuswrt_data()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 167, in get_asuswrt_data
    devices.update(self._get_wl())
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 180, in _get_wl
    lines = self.connection.run_command(_WL_CMD)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 280, in run_command
    self.connect()
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/homeassistant/components/device_tracker/asuswrt.py", line 308, in connect
    password=self._password, port=self._port)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/pexpect/pxssh.py", line 279, in login
    spawn._spawn(self, cmd)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/pexpect/pty_spawn.py", line 267, in _spawn
    'executable: %s.' % self.command)
pexpect.exceptions.ExceptionPexpect: The command was not found or was not executable: ssh.

Expected:

Problem-relevant configuration.yaml entries and steps to reproduce:

device_tracker:
  - platform: asuswrt
    host: 192.168.0.4
    username: !secret asuswrt_username
    password: !secret asuswrt_password
    mode: ap
    protocol: ssh
    port: 22
    track_new_devices: yes
    interval_seconds: 20
    consider_home: 40

**Traceback (if applicable):**
```bash

Additional info:
(homeassistant_venv) homeassistant@ubuntu:/srv/homeassistant/homeassistant_venv/bin$ which ssh
/usr/bin/ssh
(homeassistant_venv) homeassistant@ubuntu:/srv/homeassistant/homeassistant_venv/bin$ ssh -V
OpenSSH_7.5p1 Ubuntu-10ubuntu0.1, OpenSSL 1.0.2g 1 Mar 2016

@metbril
Copy link

metbril commented Mar 23, 2018

Are you sure you need to use port 23? The default is 22.

@kukudemajia
Copy link
Author

Haha this is a stupid mistake. I later found this problem, but I have already found the real problem.

@metbril
Copy link

metbril commented Mar 23, 2018

Perhaps you should add the solution here, and close the issue?

@kukudemajia
Copy link
Author

Ok,just doing!

@kukudemajia
Copy link
Author

My solution:
Edit /srv/homeassistant/homeassistant_venv/lib/python3.6/site-packages/pexpect/pty_spawn.py
About 264 lines:
command_with_path = which(self.command)
Change to:
if self.command == 'ssh':
command_with_path = '/usr/bin/ssh'
else:
command_with_path = which(self.command)
It is not the best solution, but it work.
I don't know why which('ssh') return the value of none when it run in the HASS.
If I run which('ssh') in python console,it will return the correct value: /usr/bin/ssh.

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants