Home-assistant.log and container log explode sometimes (Mikrotik device tracker errors)

Hi!

I’ve got an issue that every once in a while at random times my log files start to explode in size, I have about 20GBs free on Hass drive and it gets filled in an hour.

What’s the best strategy to combat this? I know that best way to do this it to read logs and figure out what’s wrong (in my case it’s Mikrotik’s integration, not sure whats up with it yet), but that still means that there’s a chance it will basically break the system.

I do have sensors that watch filesizes of log files. Could not make CLI commands to remove them to work from hass though. But even if I SSH and delete files manually they still are held by some processes and space wont be freed until a reboot.

So the question is what can\should I do about it to prevent log files eating all space if some error occurs?

Here are my scripts

shell_command:
    remove_home_assistant_log: "rm -f /usr/share/hassio/homeassistant/home-assistant.log"
    remove_docker_container_log: "rm -f /var/lib/docker/containers/*/*.log"

I’m running Hass Supervised on Debian.

Best solution for me would be to turn on log rotation based on file size.

And while we’re at it, here’s whats going on in the log file:

    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()

 <REPEAT: over9000>

async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update

More meaningful parts:



Logger: homeassistant.helpers.entity
Source: components/mikrotik/hub.py:260
First occurred: 11:25:50 AM (635 occurrences)
Last logged: 11:30:06 AM

    Update for device_tracker.hf_lpb100 fails
    Update for device_tracker.hs100_3 fails
    Update for device_tracker.04_cf_8c_9b_1a_3e fails
    Update for device_tracker.04_cf_8c_9b_3b_05 fails
    Update for device_tracker.honor_10_c6f901ebc871e2fc_2 fails

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 251, in command
    response = list(self.api(cmd=cmd, **params))
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 28, in __call__
    yield from self.readResponse()
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 60, in readResponse
    reply_word, words = self.readSentence()
  File "/usr/local/lib/python3.8/site-packages/librouteros/api.py", line 46, in readSentence
    reply_word, words = self.protocol.readSentence()
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 189, in readSentence
    sentence = tuple(word for word in iter(self.readWord, ''))
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 189, in <genexpr>
    sentence = tuple(word for word in iter(self.readWord, ''))
  File "/usr/local/lib/python3.8/site-packages/librouteros/protocol.py", line 198, in readWord
    byte = self.transport.read(1)
  File "/usr/local/lib/python3.8/site-packages/librouteros/connections.py", line 25, in read
    data += self.sock.recv((length - len(data)))
socket.timeout: timed out

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update

  <RIDICULOUSLY LONG >
   
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    await self.async_update()  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/device_tracker.py", line 137, in async_update
    await self.hub.request_update()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 355, in request_update
    await self.progress
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 469, in async_device_update
    awa
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 278, in update
    self.update_devices()
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 217, in update_devices
    active = self.do_arp_ping(
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 233, in do_arp_ping
    data = self.command(cmd, params)
  File "/usr/src/homeassistant/homeassistant/components/mikrotik/hub.py", line 260, in command
    raise CannotConnect from api_error
homeassistant.components.mikrotik.errors.CannotConnect