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

[BUG]error occurs when request to router set mac filter #109

Closed
songjingcn opened this issue Dec 31, 2022 · 1 comment
Closed

[BUG]error occurs when request to router set mac filter #109

songjingcn opened this issue Dec 31, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@songjingcn
Copy link

Describe the bug
When I enable/disablethe the net access of some devices, this error will occur.But after this error , I can finish the task when I do the job again . (Send request to router : xqsystem/set_mac_filter)

  • service: miwifi.request
    data:
    uri: xqsystem/set_mac_filter
    body:
    mac: 8D:EF:4B:6C:49:94
    wan: 1
    target:
    device_id: debeecbec6a***0aab9c734695cd2da
    • service: input_boolean.turn_on
      data: {}
      target:
      entity_id: input_boolean.pcnet

Please complete the following information:

  • HASS version: [ 2022.12.6]
  • Component version [2.9.0]
  • Router model [AX6000]
  • Router firmware version [1.0.95 CN]

Logger: homeassistant
Source: custom_components/miwifi/luci.py:181
Integration: MiWiFi (documentation, issues)
First occurred: 2022.12.30 20:28:02 (5 occurrences)
Last logged: 14:32:50

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 10, in map_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 188, in _receive_event
event = self._h11_state.next_event()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 487, in next_event
exc._reraise_as_remote_protocol_error()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_util.py", line 77, in _reraise_as_remote_protocol_error
raise self
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 469, in next_event
event = self._extract_next_receive_event()
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_connection.py", line 411, in _extract_next_receive_event
event = self._reader(self._receive_buffer)
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_readers.py", line 114, in maybe_read_from_SEND_RESPONSE_server
headers=list(_decode_header_lines(lines[1:])),
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_readers.py", line 68, in _decode_header_lines
matches = validate(header_field_re, line, "illegal header line: {!r}", line)
File "/srv/homeassistant/lib/python3.10/site-packages/h11/_util.py", line 91, in validate
raise LocalProtocolError(msg)
h11._util.RemoteProtocolError: illegal header line: bytearray(b'set mac: 8D:EF:4B:6C:49:94 wan:no succeeded!')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
yield
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
resp = await self._pool.handle_async_request(req)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
response = await connection.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
return await self._connection.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 112, in handle_async_request
raise exc
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 91, in handle_async_request
) = await self._receive_response_headers(**kwargs)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 155, in _receive_response_headers
event = await self._receive_event(timeout=timeout)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_async/http11.py", line 187, in _receive_event
with map_exceptions({h11.RemoteProtocolError: RemoteProtocolError}):
File "/usr/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
raise to_exc(exc)
httpcore.RemoteProtocolError: illegal header line: bytearray(b'set mac: 8D:EF:4B:6C:49:94 wan:no succeeded!')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/custom_components/miwifi/luci.py", line 166, in get
response: Response = await client.get(_url, timeout=self._timeout)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1757, in get
return await self.request(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
return await self.send(request, auth=auth, follow_redirects=follow_redirects)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
response = await self._send_handling_auth(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
response = await self._send_handling_redirects(
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
response = await self._send_single_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
response = await transport.handle_async_request(request)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
with map_httpcore_exceptions():
File "/usr/lib/python3.10/contextlib.py", line 153, in exit
self.gen.throw(typ, value, traceback)
File "/srv/homeassistant/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.RemoteProtocolError: illegal header line: bytearray(b'set mac: 8D:EF:4B:6C:49:94 wan:no succeeded!')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/automation/init.py", line 551, in async_trigger
await self.action_script.async_run(
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 687, in _async_call_service_step
await self._async_run_long_action(service_task)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 648, in _async_run_long_action
long_task.result()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1745, in async_call
task.result()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1782, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/script/init.py", line 495, in _service_handler
await self.async_turn_on(variables=service.data, context=service.context)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/script/init.py", line 454, in async_turn_on
await coro
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/components/script/init.py", line 484, in _async_run
return await self.script.async_run(script_vars, context)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 1524, in async_run
await asyncio.shield(run.async_run())
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 409, in async_run
await self._async_step(log_exceptions=False)
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 451, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/script.py", line 684, in _async_call_service_step
await service_task
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1745, in async_call
task.result()
File "/srv/homeassistant/lib/python3.10/site-packages/homeassistant/core.py", line 1782, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/home/homeassistant/.homeassistant/custom_components/miwifi/services.py", line 135, in async_call_service
response: dict = await updater.luci.get(
File "/home/homeassistant/.homeassistant/custom_components/miwifi/luci.py", line 181, in get
raise LuciConnectionError("Connection error") from _e
custom_components.miwifi.exceptions.LuciConnectionError: Connection error

@songjingcn songjingcn added the bug Something isn't working label Dec 31, 2022
@dmamontov
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants