Failed to parse headers camera platform: mjpeg

Everything works fine, but I get this error:

Failed to parse headers (url=http://192.168.xxx.xxx/): [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/connectionpool.py", line 399, in _make_request
    assert_header_parsing(httplib_response.msg)
  File "/srv/homeassistant/lib/python3.5/site-packages/urllib3/util/response.py", line 66, in assert_header_parsing
    raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
urllib3.exceptions.HeaderParsingError: [StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()], unparsed data: ''

here are my settings:
configuration.yaml

camera:
  - platform: mjpeg
    mjpeg_url: http://192.168.xxx.xxx
    name: Stairs
    username: auser
    password: !secret camera
  - platform: mjpeg
    mjpeg_url: http://192.168.xxx.xxx
    name: Office
    username: auser
    password: !secret camera
  - platform: mjpeg
    mjpeg_url: http://192.168.xxx.xxx
    name: Entrance
    username: auser
    password: !secret camera

groups.yaml

CCTV_view:
 view: yes
 icon: mdi:cctv
 entities:
   - group.cctvgroup1
   - group.cctvgroup2


cctvgroup1:
  control: hidden
  entities:
    - camera.stairs
    - camera.entrance
cctvgroup2:
  control: hidden
  entities:
    - camera.office

The groups are setup like this because I wanted the windows stacked according to this post:

So, what do I do? Is this error going to cause any trouble? Is it safe to ignore it? It is kinda annoying to be honest. It happens every time I open the CCTV view.

I just realized it DOES create a problem… I forgot the CCTV tab open all night after I made this post and this morning there was no camera feed. I had to restart Homeassistant to make it work… So if I want to have a 24/7 view of the cameras, I cant… I have to fix that. Any ideas?

1 Like

In other threads it’s been mentioned that you can safely ignore them. I’m not sure why your feed is disappearing but it sounds like that’s another problem, since I have these errors but can leave my feed up 24+ hours no problem.

My problem is that it renders my log useless when it appears that the ability to set certain logging levels for things like urllib has been removed in the latest versions of HA. At least for me, the following does not work:

logger:
default: warning
logs:
urllib3.connectionpool: critical

I’m looking into using custom components to fix it, I’ll post back if I figure out a way, cause right now my log is useless for anything else when multiple instances of this warning pop up literally every minute.

1 Like

This is true. My problem was nmap. It was just crashing the camera after some hours of scanning. Still the thing with the error is indeed frustrating and renders the logs useless. If you can find a way to stop this, me and a lot of others would be grateful!
cheers