* Duplicate Media Plugin Error

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Duplicate Media Plugin Error

Post by johnmorrisoniom »

I have tried twice to run this plugin today but keep getting an error message.
In between runs I ran :
Check & repair media links
then
Check for unlinked media.
I corrected a my file, then closed and reopened FH before running Check for duplicates the second time.
Plugin Error.JPG
Plugin Error.JPG (23.88 KiB) Viewed 9739 times
Any suggestions as to what is causing this?

John
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

It appears to be a problem within the LuaSQL library module, because the Plugin itself does not have a line 719.
Try deleting the Check for Possible Duplicate Media.dat file within Plugin Data folder within the Project's .fh_data folder, so it can start with a fresh SQL database.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

Deleted the .dat file (was 1333kb) and tried again. Excact same error message but now the .dat file is only 299Kb.
Have deleted the file again, and will try on my other computer tomorrow
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

Tried on other computer this morning, and it ran OK.
So will create a fake duplicate media and try again on the laptop tonight.
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

I assume the Media files on the two PC are different.

So I suspect there is a file on the laptop that upsets the SQL processing.
Therefore what is needed is a diagnostic list of processed files and the last one prior to the error should be the culprit.
I will take a look at the Plugin and see if such a diagnostic list can be added.

Presumably you get the Cached Records count and request to use or clear them?
Then there is a progress bar displaying each Media record, but that gets destroyed when Plugin crashes.

The attached Plugin must be run in debug mode so that the lower left pane lists Media records prior to the error message.
The last Media record will link to the culprit file.
To run in debug mode use Tools > Plugins > Check for Possible Duplicate Media > Edit
Then in the Plugin script debug window click Go top left.
It will run slower than normal listing each Media record title at the bottom.
Last edited by tatewise on 24 Nov 2023 17:17, edited 1 time in total.
Reason: Attachments deleted as not required.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

Thanks Mike, I will try that later.
My project is on dropbox, so the media "Should" be the same.
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

Just run on the laptop.
The last visible lines before the error are:

Code: Select all

Census UK 1911 RG14PN11791 RG78PN651 RD240 SD2 ED25 SN361
Census IOM 1901 RG13 piece 5300 folio 013 page 01
Census IOM 1911 RG14PN34728 RD635 SD2 ED15/2 SN71
Census 1891 IOM Michael - RG12 piece 4683 folio 117 page 06
Census IOM 1851 HO107 piece 2524 folio 4 page 1
An error has occurred - plugin failed to complete
[string "C:\Users\John\AppData\Local\Temp\~fh294C.tm..."]:723: LuaSQL: SQL logic error or missing database
No changes have been made to data records.
The last image listed (1851 census) has been in my project since 2012
the 1891 census image before it has been in my project since 2015
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

If you repeat the test, does it always fail on the same file?

Or is it random, in which case it is probably some kind of interaction with Dropbox and the SQL .dat file that perhaps temporarily inhibits access and makes it appear to be a missing database.

I think this is one for Jane to investigate further.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

2nd run, with no changes to the file completed succesfully
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

I'm guessing, but sounds more and more like some interaction with Dropbox as the SQL .dat file is updated rapidly, that upsets access and makes the Lua SQL think the file has gone missing.

Also, once an SQL database entry has been created for a Media file it does not need to modify the database.
Only new Media files require SQL database updates.

So if your 2nd run was on a partially created database, the updates will be fewer.
Also the Plugin debug mode runs slower, and so the rate of update is slower.
All these will help reduce interaction issues.

For the test runs to be equivalent, they need to start with an empty SQL database each time.
i.e. When initially prompted about Cached Records, decline to use them, so the database is cleared.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

That's what I had done Mike, as that is what I had done when the error occurred.
I have done some very extensive renaming of media files, and cleared the cache on purpose.
I did a 3rd run, clearing the cache again, overnight. Again completed successfully..
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

OK, it seems to be one of those annoying intermittent interaction snags.
Presumably, once established, the SQL .dat file is the same file shared by both PC via Dropbox?
Alternatively, I wonder if it could be an over zealous anti-virus check that has now learnt that file is safe?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
User avatar
johnmorrisoniom
Megastar
Posts: 904
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Duplicate Media Plugin Error

Post by johnmorrisoniom »

I have been using the plugin on a regular basis since it's release, and have had my Project on dropbox for over a year, with never a problem.
i will keep an eye on what happens.
User avatar
tatewise
Megastar
Posts: 28434
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Duplicate Media Plugin Error

Post by tatewise »

The thing is that utilities such as Dropbox and Anti-virus products change over time as features are added or altered, so the fact that it has worked for a while proves little.

If the problem had been more repeatable, and not caused by a particular file, then I would have suggested re-installing the Lua SQL library, which involves more than just re-installing the Plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Post Reply