Automation to create snapshot and errors

I have an automation that creates a snapshot every night and I generates errors every night. Trying to figure out why… it does make the snapshot. The daily uploader is working well and the snapshot completes in time. The 4 AM stuff is something else, not sure what.

I should add that Hassio is running on 66.1 and this has been happening for the last few version, or since I actually created the action.

Any ideas what is causing this set of errors?

Automations:

- alias: Daily snapshot at 3 AM
  hide_entity: True
  trigger:
    platform: time
    at: '3:00:00'
  action:
  - service: hassio.snapshot_full
    data_template:
      name: automated backup {{ now().strftime('%Y-%m-%d') }}


- alias: Daily upload to dropbox at 3:30 AM
  hide_entity: True
  trigger:
    platform: time
    at: '3:30:00'
  action:
  - service: hassio.addon_stdin
    data_template:
      addon: "7be23ff5_dropbox_sync"
      input: {"command":"upload"}

Errors:

2018-04-04 03:05:01 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /snapshots/new/full request
2018-04-04 03:05:01 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall hassio.snapshot_full: name=automated backup 2018-04-04>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1002, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/hassio/__init__.py", line 189, in async_service_handler
    _LOGGER.error("Error on Hass.io API: %s", ret['message'])
TypeError: 'NoneType' object is not subscriptable
2018-04-04 03:08:55 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-04 04:04:56 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-04 04:24:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

this doesn’t look right. In fact, i’m not sure why you are using a data_template there at all.

  action:
  - service: hassio.addon_stdin
    data:
      addon: "7be23ff5_dropbox_sync"
      input: 
        command: "upload"

I’m not sure that will do anything because your errors are related to http issues. It looks like this section of the code is working fine.

About the http, you have a snapshots folder inside hassio/ correct?

I am using the code that is expected by the addon… My snapshots end up in the /backup directory like they normally would if performed standalone from the Hassio interface.

That you are, but you’re placing it into a data_template and you don’t need to do that. Also, you decide to use a dictionary to specify the YAML. This code is functionally the same, but not running extra code to search for Jinja (which is the whole point of data_templates).

  action:
  - service: hassio.addon_stdin
    data: #<---------------- you don't need a template because you aren't using it.
      addon: "7be23ff5_dropbox_sync"
      input: #<--- now without the dictionary, but functionally idential and follows yaml.
        command: "upload"

As for http issue, it appears home assistant is failing the snapshot mid way through. You may only be getting partial snapshots. If you take the snapshot manually, do you get the error? The root cause of the error stack appears to be TypeError: 'NoneType' object is not subscriptable .

The other errors beyond 3:05 could be caused by this NoneType error you are getting, but it’s unclear where the error is occurring. It’s occurring when attempting to communicate across HTTP, which could be internal or external communication. These errors could be completely unrelated to the NoneType Error.

I have made the suggested changes…

Old version still has the following error:

2018-04-09 03:05:00 ERROR (MainThread) [homeassistant.components.hassio.handler] Timeout on /snapshots/new/full request
2018-04-09 03:05:00 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall hassio.snapshot_full: name=automated backup 2018-04-09>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1002, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/hassio/__init__.py", line 189, in async_service_handler
    _LOGGER.error("Error on Hass.io API: %s", ret['message'])
TypeError: 'NoneType' object is not subscriptable

I will see if this changes after the run tonight.

My log file is full of this, and I am really not sure where it is coming from. I suspect it is from Weather Underground data gathering…

2018-04-08 03:57:00 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-08 04:11:38 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-08 04:57:23 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-08 04:57:23 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-08 06:07:03 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method
2018-04-08 06:26:44 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/aiohttp/web_protocol.py", line 231, in data_received
    messages, upgraded, tail = self._request_parser.feed_data(data)
  File "aiohttp\_http_parser.pyx", line 295, in aiohttp._http_parser.HttpParser.feed_data
aiohttp.http_exceptions.BadStatusLine: invalid HTTP method

I have my .yaml files all broken out… Is there a way to pull them as a complete file like HA would read them?

sorry, i was on vaca last week. You can make packages for HA:

It will take quite a bit to reorganize though.

Have you tried changing your logger to debug? We are only seeing the error, it would be nice to find out what component is actually causing your error.

I have set up the input_select to let me change log levels, I have activated the problem automations and I am waiting for things to go south. I am currently set to debug level.

Matt