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

LuciRpcMethodNotFoundError in Home Assistant luci integration #52

Open
fangly opened this issue Apr 2, 2022 · 6 comments
Open

LuciRpcMethodNotFoundError in Home Assistant luci integration #52

fangly opened this issue Apr 2, 2022 · 6 comments

Comments

@fangly
Copy link

fangly commented Apr 2, 2022

  • openwrt-luci-rpc version: git-22.052.50988-1b6c126-1
  • Python version: 3.7.12
  • Operating System: Linux turris 4.14.269 #0 SMP Mon Mar 7 07:26:07 2022 armv7l GNU/Linux
# cat /etc/os-release 
NAME="TurrisOS"
VERSION="5.3.6"
ID="turrisos"
ID_LIKE="lede openwrt"
PRETTY_NAME="TurrisOS 5.3.6"
VERSION_ID="5.3.6"
HOME_URL="https://www.turris.cz/"
BUG_URL="https://gitlab.nic.cz/groups/turris/-/issues/"
SUPPORT_URL="https://www.turris.cz/support/"
BUILD_ID="r11413+89-9ced994057"
OPENWRT_BOARD="mvebu/cortexa9"
OPENWRT_ARCH="arm_cortex-a9_vfpv3-d16"
OPENWRT_TAINTS="busybox"
OPENWRT_DEVICE_MANUFACTURER="CZ.NIC"
OPENWRT_DEVICE_MANUFACTURER_URL="https://www.turris.cz/"
OPENWRT_DEVICE_PRODUCT="Turris Omnia"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="TurrisOS 5.3.6 9ced994057ae8243445d3f22aa981753de4f7d34"

Description

I have freshly installed luci-mod-rpc on my Turris Omnia router to enable presence detection in Home Assistant via its luci integration.

What I Did

After setting up the luci integration and restarting Home Assistant, the Home Assistant log shows:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 353, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/legacy.py", line 827, in async_scan_devices
    return await self.hass.async_add_executor_job(self.scan_devices)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/luci/device_tracker.py", line 67, in scan_devices
    self._update_info()
  File "/usr/src/homeassistant/homeassistant/components/luci/device_tracker.py", line 95, in _update_info
    result = self.router.get_all_connected_devices(only_reachable=True)
  File "/usr/local/lib/python3.9/site-packages/openwrt_luci_rpc/__init__.py", line 42, in get_all_connected_devices
    return self.router.get_all_connected_devices(
  File "/usr/local/lib/python3.9/site-packages/openwrt_luci_rpc/openwrt_luci_rpc.py", line 161, in get_all_connected_devices
    arp_result = self._call_json_rpc(*self.arp_call)
  File "/usr/local/lib/python3.9/site-packages/openwrt_luci_rpc/openwrt_luci_rpc.py", line 229, in _call_json_rpc
    raise LuciRpcMethodNotFoundError(
openwrt_luci_rpc.exceptions.LuciRpcMethodNotFoundError: ("method: '%s' returned an error '%s' (code: '%s).", 'net.arptable', 'Method not found.', -32601)

I am not familiar enough with the software to determine if the issue resides in the luci integration or openwrt-luci-rpc...

@fangly
Copy link
Author

fangly commented Apr 2, 2022

I did more reading and it seems like my issue is a duplicate of #30 (closed).

@fangly fangly closed this as completed Apr 2, 2022
@fangly fangly reopened this Apr 2, 2022
@fangly
Copy link
Author

fangly commented Apr 2, 2022

Turris OS 5.3 is based on top of OpenWrt 19.07

Accordingly, the VERSION_ID is "5.3.6". In this case, this represents the Turris OS version, not that of the underlying OpenWrt.

This suggests that checking /etc/os-release is not a safe way to determine if a legacy version of OpenWrt is running. Probably a better way would be to try running a non-legacy method and determine if this works or not.

@motolav
Copy link

motolav commented Jun 5, 2022

Since OpenWrt 19.07 is EOL it'd probably be easier just to deprecate the legacy method if the backwards compatibility isn't required as there's no legacy required version that'd get software updates outside of third party repos and forks

@r4ym0n
Copy link

r4ym0n commented Jul 23, 2022

Just try to modify /etc/os-release. set the VERSION_ID to 18.06

VERSION_ID="18.06"

it works for me. XD

@alfureu
Copy link

alfureu commented Sep 21, 2022

any news on this?

@Poci
Copy link

Poci commented Mar 2, 2023

Any news? Still waiting for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants