Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Connection already opened #920

Closed
thundergreen opened this issue Mar 19, 2021 · 8 comments · Fixed by #825
Closed

[BUG] Connection already opened #920

thundergreen opened this issue Mar 19, 2021 · 8 comments · Fixed by #825
Labels
Milestone

Comments

@thundergreen
Copy link

Describe the bug
A clear and concise description of what your issue is.
After a while / restart or Home-Assistant I get a connection error. Does this mean it did not close the connection when restarting HASS?
Version of frigate
1.13
Config file
Include your full config file wrapped in triple back ticks.

not related```

**Frigate container logs**

https://pastebin.ddns.me/hoviyalasa.rb```

Frigate stats

Internal Server Error```

**FFprobe from your camera**

Run the following command and paste output below

ffprobe <stream_url>


**Screenshots**
If applicable, add screenshots to help explain your problem.

**Computer Hardware**
 - OS:  Ubuntu, 
 - Install method: Addon

 - Coral Version: PCIe
 - Network Setup: WiFi]



@fl42
Copy link

fl42 commented Mar 19, 2021

Same problem for me with Frigate 0.8.4-5043040

2021-03-19T21:44:03Z {'REMOTE_ADDR': '127.0.0.1', 'REMOTE_PORT': '39814', 'HTTP_HOST': 'frigate', (hidden keys: 23)} failed with OperationalError

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 40, in __call__
    handler, values = adapter.match()
  File "/usr/local/lib/python3.8/dist-packages/werkzeug/routing.py", line 1945, in match
    raise NotFound()
werkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 999, in handle_one_response
    self.run_application()
  File "/usr/local/lib/python3.8/dist-packages/geventwebsocket/handler.py", line 87, in run_application
    return super(WebSocketHandler, self).run_application()
  File "/usr/local/lib/python3.8/dist-packages/gevent/pywsgi.py", line 945, in run_application
    self.result = self.application(self.environ, self.start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask_sockets.py", line 48, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.8/dist-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 2242, in preprocess_request
    rv = func()
  File "/opt/frigate/frigate/http.py", line 89, in _db_connect
    database.connect()
  File "/usr/local/lib/python3.8/dist-packages/peewee.py", line 3061, in connect
    raise OperationalError('Connection already opened.')
peewee.OperationalError: Connection already opened.

The issue seems to arise randomly after some time.
When the issue occurs, the API returns HTTP 500.

MQTT status topic stays on "online". Could be a good improvement to catch the exception and set the topic to offline (or failure?)
A container restart solves the issue. So as a workaround it makes sense to exit for this kind of issue, then the container will be restarted by Docker (considered restart is not no) and the issue solved. What is your opinion on that?

@edge360
Copy link

edge360 commented Mar 20, 2021

Seeing same here as well. Running docker - blakeblackshear/frigate:0.8.4-amd64
Restart does the trick, but it seems to pop up again within a few hours.

@Minglarn
Copy link

Seems that this is the same as: #853

@erikarenhill
Copy link

I also started experiencing this, frigate stops working about once a day

@thundergreen
Copy link
Author

I removed double take and no errors for 24 hours.well. must be related to either frigate or double take .

Another thing ..if frigate would support face recognition I wouldn't be needed to use double take ..well... We will see

@edge360
Copy link

edge360 commented Mar 26, 2021

I removed my automation that requests an the image via ha integration API and it slowed down the frequency of the crashes. I'll try and expose the images another way maybe. It It was recommended on #853 to downgrade, but I believe you'll have to downgrade both frigate and the ha add-on, which I didn't really want to do. Does anyone have a good method to catch the this particular crash and reboot via docker?

@Morphy99
Copy link

Morphy99 commented Apr 4, 2021

getting this too on docker amd64 stable. Tried downgrading to 0.8.1 but my config isn't valid:
Error parsing config: extra keys not allowed @ data['cameras']['front']['ffmpeg']['input_args']

@stale
Copy link

stale bot commented May 4, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants