Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Duplicate SQL entries for every event (David Powell)


----------------------------------------------------------------------

Message: 1
Date: Thu, 29 Jul 2021 05:58:21 -0500
From: David Powell <da...@depowell.com>
To: Motion discussion list <Motion-user@lists.sourceforge.net>
Subject: [Motion-user] Duplicate SQL entries for every event
Message-ID: <51dd839f-805c-96e4-e6a9-de21aed77...@depowell.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

My /Motion/ setup inserts a row for each event (with the /sql_query/ 
config parameter) into a MySQL database.

I recently upgraded my Motion server from a RPi 3B+ to a RPi 4B, along 
with the latest versions of Motion, MySQL, and Ubuntu.? Now I get an 
error entry in my Motion log for every Motion event. This is a sample entry:

*[1:ml1:patio] [ERR] [DBL] [Jul 29 05:27:40] dbse_exec_mysql: MySQL 
query failed Duplicate entry '1-1-737-2021-07-29 02:57:41' for key 
'events.PRIMARY' error code 1062: No such file or directory*

The primary key for the /events/ table is 
/server_number,event_number,event_date/, and /camera_number/.

The SQL statement in motion.conf is
INSERT INTO events 
(server_number,camera_number,event_number,event_date,video_length,filename) 
VALUES (1,%t,%v,{ts '%C'},null,'%f');

The records /are/ there in the database, and I run a custom program to 
extract them for displaying the snapshots and movies in a web page. All 
seems well, except I sometimes get a Motion-generated snapshot that 
doesn't match the Motion-generated movie, and sometimes I get a movie 
from which I can't extract the length.? These are fairly rare and may or 
may not be related to this error.? The log entry, however, appears on 
each event.

I'm not really a database kind of guy.? Anyone else have a similar 
problem? Would this be caused by Motion, MySQL, or something else?

Thanks, David

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 181, Issue 10
********************************************

Reply via email to