blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
19.28k stars 1.76k forks source link

[Support]: Frigate Failing to start after update #9581

Closed awwbaker closed 8 months ago

awwbaker commented 9 months ago

Describe the problem you are having

Frigate had been fine for weeks. Yesterday I was prompted to up date. Failed to restart with error in log file: 2024-02-01 19:20:26.697704083 [2024-02-01 14:20:26] peewee_migrate.logs INFO : add_column ('event', 'score', ) 2024-02-01 19:20:26.699379855 duplicate column name: score 2024-02-01 19:20:26.699698105 [2024-02-01 14:20:26] peewee_migrate.logs ERROR : Migration failed: 014_event_updates_for_fp 2024-02-01 19:20:26.699701220 Traceback (most recent call last): 2024-02-01 19:20:26.699706212 File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3252, in execute_sql 2024-02-01 19:20:26.699708476 cursor.execute(sql, params or ()) 2024-02-01 19:20:26.699710353 sqlite3.OperationalError: duplicate column name: score 2024-02-01 19:20:26.699712254
2024-02-01 19:20:26.699713858 During handling of the above exception, another exception occurred: 2024-02-01 19:20:26.699737284

Version

0.13.1

Frigate config file

mqtt:
  host: 192.168.4.23
  user: mqtt_user
  password: mqtt_user

detectors:
  coral:
    type: edgetpu
    device: usb

go2rtc:
  streams:
    garage:
    - rtsp://192.168.4.23:8554/garage
    breezeway:
    - rtsp://192.168.4.23:8554/breezeway
    front_door_main:
    - rtsp://admin:Stella62@192.168.4.158:554/h264Preview_01_main
    front_door_sub:
    - rtsp://admin:Stella62@192.168.4.158:554/h264Preview_01_sub
#    - ffmpeg:rtsp://admin:Stella62@192.168.4.117:554/h264Preview_01_sub#audio=pcm#audio=volume
## THIS PREVENTS THE AUDIO COMING OUT FROM THE DOORBELL SOUNDING MUFFLED
#  ffmpeg:
#    bin: ffmpeg
#    volume: "-af \"volume=30dB\""

snapshots:
  enabled: True
  clean_copy: True
  timestamp: True
  # Optional: draw bounding box on the snapshots (default: shown below)
  bounding_box: True
  retain:
    # Required: Default retention days (default: shown below)
    default: 10
    # Optional: Per object retention days
    objects:
      person: 15
detect:
  enabled: True
  width: 1280
  height: 720
  fps: 5
ffmpeg:
  hwaccel_args: preset-vaapi
#  hwaccel_args: -hwaccel_output_format qsv -c:v h264_qsv
#    output_args: 
#      preset-record-generic-audio-copy
#  record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy # -an
record:
 enabled: True
 retain:
   days: 7
   mode: motion
 events:
   retain:
     default: 14
     mode: active_objects
cameras:
 front_door_main: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_main
          roles:
            - record
            - rtmp
 front_door_sub: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_door_sub
          roles:
            - detect
    objects:
      track:
        - person
        - dog
    zones:
      alienzone:
        coordinates: 462,720,972,720,738,535,455,552
 breezeway: 
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/breezeway
          roles:
            - record
            - rtmp
            - detect
    objects:
      track:
        - person
        - dog
    zones:
      deerzone:
        coordinates: 407,720,0,720,0,468,412,193,476,191
 garage: 
  ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/garage
          roles:
            - record
            - rtmp
            - detect

Relevant log output

s6-rc: info: service nginx-log: starting
s6-rc: info: service go2rtc-log: starting
s6-rc: info: service frigate-log: starting
s6-rc: info: service nginx-log successfully started
s6-rc: info: service frigate-log successfully started
s6-rc: info: service go2rtc-log successfully started
s6-rc: info: service go2rtc: starting
s6-rc: info: service go2rtc successfully started
s6-rc: info: service go2rtc-healthcheck: starting
s6-rc: info: service frigate: starting
s6-rc: info: service go2rtc-healthcheck successfully started
s6-rc: info: service frigate successfully started
s6-rc: info: service nginx: starting
s6-rc: info: service nginx successfully started
s6-rc: info: service legacy-services: starting
2024-02-01 19:22:13.636531409  [INFO] Preparing new go2rtc config...
2024-02-01 19:22:13.638096899  [INFO] Preparing Frigate...
2024-02-01 19:22:13.639315628  [INFO] Starting NGINX...
s6-rc: info: service legacy-services successfully started
2024-02-01 19:22:13.658010454  [INFO] Starting Frigate...
2024-02-01 19:22:13.693068765  [INFO] Got IP address from supervisor: 192.168.4.23
2024-02-01 19:22:13.735697394  [INFO] Got WebRTC port from supervisor: 8555
2024-02-01 19:22:14.058916040  [INFO] Starting go2rtc...
2024-02-01 19:22:14.156844575  14:22:14.156 INF go2rtc version 1.8.4 linux/amd64
2024-02-01 19:22:14.157424850  14:22:14.157 INF [api] listen addr=:1984
2024-02-01 19:22:14.157683066  14:22:14.157 INF [rtsp] listen addr=:8554
2024-02-01 19:22:14.157686094  14:22:14.157 INF [webrtc] listen addr=:8555
2024-02-01 19:22:15.230712799  [2024-02-01 14:22:15] frigate.app                    INFO    : Starting Frigate (0.13.1-34fb1c2)
2024-02-01 19:22:15.230837086  [2024-02-01 14:22:15] frigate.app                    INFO    : Creating directory: /tmp/cache
2024-02-01 19:22:15.288512625  [2024-02-01 14:22:15] peewee_migrate.logs            INFO    : Starting migrations
2024-02-01 19:22:15.305994125  [2024-02-01 14:22:15] peewee_migrate.logs            INFO    : Migrate "014_event_updates_for_fp"
2024-02-01 19:22:15.306112266  [2024-02-01 14:22:15] peewee_migrate.logs            INFO    : add_column ('event', 'score', <FloatField: Event.score>)
2024-02-01 19:22:15.307898659  duplicate column name: score
2024-02-01 19:22:15.308192030  [2024-02-01 14:22:15] peewee_migrate.logs            ERROR   : Migration failed: 014_event_updates_for_fp
2024-02-01 19:22:15.308195650  Traceback (most recent call last):
2024-02-01 19:22:15.308200914    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3252, in execute_sql
2024-02-01 19:22:15.308203237      cursor.execute(sql, params or ())
2024-02-01 19:22:15.308205080  sqlite3.OperationalError: duplicate column name: score
2024-02-01 19:22:15.308207106  
2024-02-01 19:22:15.308208740  During handling of the above exception, another exception occurred:
2024-02-01 19:22:15.308235849  
2024-02-01 19:22:15.308237345  Traceback (most recent call last):
2024-02-01 19:22:15.308239215    File "/usr/local/lib/python3.9/dist-packages/peewee_migrate/router.py", line 200, in run_one
2024-02-01 19:22:15.308250609      migrator()
2024-02-01 19:22:15.308252457    File "/usr/local/lib/python3.9/dist-packages/peewee_migrate/migrator.py", line 76, in __call__
2024-02-01 19:22:15.308281234      op.run()
2024-02-01 19:22:15.308283150    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 162, in run
2024-02-01 19:22:15.308285268      self._handle_result(method(*self.args, **kwargs))
2024-02-01 19:22:15.308287375    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 156, in _handle_result
2024-02-01 19:22:15.308303783      self._handle_result(item)
2024-02-01 19:22:15.308305745    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 153, in _handle_result
2024-02-01 19:22:15.308307218      result.run()
2024-02-01 19:22:15.308309031    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 162, in run
2024-02-01 19:22:15.308310531      self._handle_result(method(*self.args, **kwargs))
2024-02-01 19:22:15.308324008    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 151, in _handle_result
2024-02-01 19:22:15.308325399      self.execute(result)
2024-02-01 19:22:15.308327206    File "/usr/local/lib/python3.9/dist-packages/playhouse/migrate.py", line 147, in execute
2024-02-01 19:22:15.308328763      self.migrator.database.execute(node)
2024-02-01 19:22:15.308330476    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3260, in execute
2024-02-01 19:22:15.308331851      return self.execute_sql(sql, params)
2024-02-01 19:22:15.308333541    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3252, in execute_sql
2024-02-01 19:22:15.308351443      cursor.execute(sql, params or ())
2024-02-01 19:22:15.308353225    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3020, in __exit__
2024-02-01 19:22:15.308354803      reraise(new_type, new_type(exc_value, *exc_args), traceback)
2024-02-01 19:22:15.308356473    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 192, in reraise
2024-02-01 19:22:15.308358059      raise value.with_traceback(tb)
2024-02-01 19:22:15.308359825    File "/usr/local/lib/python3.9/dist-packages/peewee.py", line 3252, in execute_sql
2024-02-01 19:22:15.308361252      cursor.execute(sql, params or ())
2024-02-01 19:22:15.308362750  peewee.OperationalError: duplicate column name: score
2024-02-01 19:22:16.605992221  [INFO] Service Frigate exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service nginx: stopping
s6-rc: info: service go2rtc-healthcheck: stopping
2024-02-01 19:22:16.618194478  [INFO] The go2rtc-healthcheck service exited with code 256 (by signal 15)
s6-rc: info: service go2rtc-healthcheck successfully stopped
2024-02-01 19:22:16.641702453  [INFO] Service NGINX exited with code 0 (by signal 0)
s6-rc: info: service nginx successfully stopped
s6-rc: info: service nginx-log: stopping
s6-rc: info: service frigate: stopping
s6-rc: info: service frigate successfully stopped
s6-rc: info: service go2rtc: stopping
s6-rc: info: service frigate-log: stopping
s6-rc: info: service nginx-log successfully stopped
2024-02-01 19:22:16.645034354  exit with signal: terminated
s6-rc: info: service frigate-log successfully stopped
2024-02-01 19:22:16.649572326  [INFO] The go2rtc service exited with code 0 (by signal 0)
s6-rc: info: service go2rtc successfully stopped
s6-rc: info: service go2rtc-log: stopping
s6-rc: info: service go2rtc-log successfully stopped
s6-rc: info: service log-prepare: stopping
s6-rc: info: service s6rc-fdholder: stopping
s6-rc: info: service log-prepare successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service s6rc-fdholder successfully stopped
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

FFprobe output from your camera

Don't know how to complete

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Wyze, Reolink

Any other information that may be helpful

Just updated as prompted is all

NickM-27 commented 9 months ago

this happens when 0.13 was previously run and then downgraded or frigate was restarted while it was in the middle of a migration after updating to 0.13

awwbaker commented 9 months ago

If so, it was unintentional....is there a way to recover...please excuse my ignorance.

NickM-27 commented 9 months ago

if you have a backup to restore from that would be easiest. otherwise, could try manually running sql commands to delete the field or just delete the existing db and recordings and start fresh

github-actions[bot] commented 8 months ago

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.