Coder Social home page Coder Social logo

Error while executing automation automation.daily_snapshot_clean_up. Unknown error for call_service at pos 1: about clean_up_snapshots HOT 15 CLOSED

quantummobile avatar quantummobile commented on July 2, 2024
Error while executing automation automation.daily_snapshot_clean_up. Unknown error for call_service at pos 1:

from clean_up_snapshots.

Comments (15)

tmonck avatar tmonck commented on July 2, 2024

Thanks I will look into this.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

@quantummobile there should be another log above that one that is tells you the snapshots it found (It should start with "Snapshots:"). Are there any snapshots in that log statement or does it say None? I am putting in a fix for the exception you are having but want to make sure that the problem isn't when trying to get your snapshots causing the list to be None.

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

@tmonck is this the one?

'NoneType' object is not iterable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 130, in handle_call_service connection.context(msg), File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call await asyncio.shield(self._execute_service(handler, service_call)) File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service await handler.func(service_call) File "/config/custom_components/clean_up_snapshots_service/__init__.py", line 105, in async_handle_clean_up for snapshot in snapshots: TypeError: 'NoneType' object is not iterable

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

It would be above that. I am going to merge in my change and release a new version. I'll keep this open to make sure it resolves the exception that's being thrown, but if your snapshots don't get cleaned up then you will need to let me know so we can work through why the api call isn't returning any snapshots.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

@quantummobile the error you pasted should not happen again. Please let me know if the snapshots do not clean up. We will work through the api not returning you any snapshots.

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

Failed config
General Errors:
- Component error: clean_up_snapshots_service - No module named 'dateutil'

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

Now I'm getting this error:

Client error on calling get snapshots Traceback (most recent call last): File "/config/custom_components/clean_up_snapshots_service/__init__.py", line 44, in async_get_snapshots resp = await session.get(hassio_url + 'snapshots', headers=headers, ssl=not isgoodipv4(urlparse(hassio_url).netloc)) File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 466, in _request ssl=ssl, proxy_headers=proxy_headers, traces=traces) File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 286, in __init__ self.update_host(url) File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 340, in update_host raise InvalidURL(url) aiohttp.client_exceptions.InvalidURL: 192.168.xxx.xxx/api/hassio/snapshots

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

So can you try adding "http://" infront of your url that you have in the configuration.yaml for "host"
ex: "http://192.168.xxx.xxx"

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

Did that, got these errors:

`Client error on calling get snapshots
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 924, in _wrap_create_connection
await self._loop.create_connection(*args, **kwargs))
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 954, in create_connection
raise exceptions[0]
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 941, in create_connection
await self.sock_connect(sock, address)
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 464, in sock_connect
return await fut
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 494, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('192.168.xxx.xxx', 80)

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

Traceback (most recent call last):
File "/config/custom_components/clean_up_snapshots_service/init.py", line 44, in async_get_snapshots
resp = await session.get(hassio_url + 'snapshots', headers=headers, ssl=not isgoodipv4(urlparse(hassio_url).netloc))
File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 476, in _request
timeout=real_timeout
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 522, in connect
proto = await self._create_connection(req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 854, in _create_connection
req, traces, timeout)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 992, in _create_direct_connection
raise last_exc
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 974, in _create_direct_connection
req=req, client_error=client_error)
File "/usr/local/lib/python3.7/site-packages/aiohttp/connector.py", line 931, in _wrap_create_connection
raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.xxx.xxx:80 ssl:False [Connect call failed ('192.168.xxx.xxx', 80)]`

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

Looks like it's trying to connect to Port 80. You would need the Port of hassio. This defaults to 8123. I don't add the Port for hassio by default.

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

OK, I added port number to the host address. Now I get these:

Client error on calling get snapshots Traceback (most recent call last): File "/config/custom_components/clean_up_snapshots_service/__init__.py", line 44, in async_get_snapshots resp = await session.get(hassio_url + 'snapshots', headers=headers, ssl=not isgoodipv4(urlparse(hassio_url).netloc)) File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request await resp.start(conn) File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start message, payload = await self._protocol.read() # type: ignore # noqa File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read await self._waiter aiohttp.client_exceptions.ServerDisconnectedError: None

from clean_up_snapshots.

grahamw72 avatar grahamw72 commented on July 2, 2024

Was having similar issue. Found that if you set the following, things will work with v0.2

host: http://xx.xx.xx.xx:8123
token: abcdefghi......

Please note: no “ “ around the token data.
Also supports !secret ... if you are so inclined.

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

Was having similar issue. Found that if you set the following, things will work with v0.2

host: http://xx.xx.xx.xx:8123
token: abcdefghi......

Please note: no “ “ around the token data.
Also supports !secret ... if you are so inclined.

Everything is set exactly the same on my side, but the issue remains.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

If you put the url you are using in the config into a browser are you taken to the login screen? If you have postman you try to make the api call? To make the api call you would put token in the authorization header like so "Authorization Bearer {token}" the request is a GET and the url would be http://xxx.xx.xx.xx:8123/api/hassio/snapshots.

What version of Hassio are you running?
How are you running Hassio? (Pi, docker on windows, etc)

from clean_up_snapshots.

quantummobile avatar quantummobile commented on July 2, 2024

Solved. It should have been https instead http.
Thanks.

from clean_up_snapshots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.