Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Services do not work #85

Open
Stuke00 opened this issue Dec 30, 2021 · 3 comments
Open

Services do not work #85

Stuke00 opened this issue Dec 30, 2021 · 3 comments

Comments

@Stuke00
Copy link

Stuke00 commented Dec 30, 2021

I get this error

Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/truenas/init.py:253
Integration: TrueNAS (documentation)
First occurred: 10:21:08 AM (1 occurrences)
Last logged: 10:21:08 AM

websocket_api script: Error executing script. Unexpected error for call_service at pos 1:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 381, in _async_step
await getattr(self, handler)()
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 584, in _async_call_service_step
await service_task
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/core.py", line 1495, in async_call
task.result()
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/core.py", line 1530, in _execute_service
await handler.job.target(service_call)
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 691, in handle_service
await service.entity_service_call(
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/service.py", line 663, in entity_service_call
future.result() # pop exception if have
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 896, in async_request_call
await coro
File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/service.py", line 700, in _handle_entity_call
await result
File "/home/homeassistant/.homeassistant/custom_components/truenas/init.py", line 253, in stop
await self._jail.stop(force=force)
File "/srv/homeassistant/lib/python3.9/site-packages/aiotruenas_client/websockets/jail.py", line 21, in stop
return await self._fetcher._stop_jail(self, force)
File "/srv/homeassistant/lib/python3.9/site-packages/aiotruenas_client/websockets/jail.py", line 90, in _stop_jail
job_id = await self._parent._invoke_method("jail.stop", [jail.name, force])
File "/srv/homeassistant/lib/python3.9/site-packages/aiotruenas_client/websockets/machine.py", line 183, in _invoke_method
assert not self.closed
AssertionError

@sdwilsh
Copy link
Owner

sdwilsh commented Dec 31, 2021

The stacktrace implies that the connection to the server is closed. Are the entities showing up as unavailable as well?

@Stuke00
Copy link
Author

Stuke00 commented Dec 31, 2021

Hmm the entities show "on" but it doesn't look like they're updating tho.

sdwilsh added a commit that referenced this issue Dec 31, 2021
This will pick up some core library updates as well as some additional
logging to help debug #85 and #75.
sdwilsh added a commit that referenced this issue Dec 31, 2021
This will pick up some core library updates as well as some additional
logging to help debug #85 and #75.
sdwilsh added a commit that referenced this issue Dec 31, 2021
This will pick up some core library updates as well as some additional
logging to help debug #85 and #75.
@sdwilsh
Copy link
Owner

sdwilsh commented Dec 31, 2021

v0.3.0 of this custom integration has some additional logging code which might help us figure out what is going on here. To do this, you'll want to update the logger integration with the following lines:

  logs:
    aiotruenas_client: debug
    custom_components.truenas: debug

Mine looks like this:

logger:
  default: info
  logs:
    aiotruenas_client: debug
    custom_components.truenas: debug

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