CPG Upload issue: File can't be added due to Database CPG Upload issue: File can't be added due to Database
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CPG Upload issue: File can't be added due to Database

Started by Manutjee, February 25, 2014, 04:29:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Manutjee

Hi!

I have been trying to upload this album for a few minutes now.
The album directory (CPG) is empty. Coppermine, or better, my Database registers the photos as already being added; they are duplicates according to my Database.
How can I solve this?

I have tried:
- Deleting the uploaded folder
- Re-creating the folder
- Check if the photos are placed elsewere

Attachments below.

gmc

You answered the problem here:
Quotethey are duplicates according to my Database.

If your intention is starting over with an empty gallery - you need to empty the cpg_pictures table as well as the folder...
phpMyAdmin typically has a button to do so under the Operations tab for a given table...
Or the SQL would be TRUNCATE TABLE cpg_pictures; using your appropriate cpg prefix of course...

This cannot be undone - so insure you really want to empty...

All albums and categories will remain - but they will have no pictures.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

Quote from: gmc on February 25, 2014, 08:58:05 PM
You answered the problem here:
If your intention is starting over with an empty gallery - you need to empty the cpg_pictures table as well as the folder...
phpMyAdmin typically has a button to do so under the Operations tab for a given table...
Or the SQL would be TRUNCATE TABLE cpg_pictures; using your appropriate cpg prefix of course...

This cannot be undone - so insure you really want to empty...

All albums and categories will remain - but they will have no pictures.

No, I do not want to start over with an empty gallery.
I need/needed those photos that I uploaded to be added to the CPG folder in Coppermine itself, but I ran into that problem.
The files were uploaded in a folder called '3x17_Silverfinger', but CPG recognized the files somehow - even though, in my memory, I cannot remember adding them.
I "solved" the issue by creating a new folder in 'uploads' called '3x17'. I wonder why I could not batch-add them earlier, in the directory '3x17_Silverfinger'.
Hope you understand what I mean. Am I able to fix the issue without deleting stuff or anything? Am I able to upload and batch-add them in the correct FTP folder?

gmc

Can you post a link to your gallery so I can see what CPG 'thinks' is in the gallery today??

You say the CPG albums folder is empty, but CPG thinks photos exist...
That would mean files were deleted outside of Coppermine. A quick view of the gallery would confirm.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

I also think the files were deleted outside of Coppermine.
Feel free to take a look, 'cause I am kind of lost here, haha!
Link: http://teenwolfonline.org/photos
If you want to have logins, feel free to PM me.

gmc

OK... there are 19,000+ pics...
So the issue is with one folder you are trying to add.

Take the folder path you are trying to add from, and using phpMyAdmin or similar - let's see what Coppermine thinks is there...
If your folderpath is:  {cpg_directory}/albums/folder1/folder2/  and your coppermine table prefix is 'cpg_'
Then the SQL would be: SELECT * FROM cpg_pictures WHERE filepath = 'folder1/folder2/'
Note I did not include the 'albums/' folder as that is a CONFIG variable and not stored with each picture. Adjust the table prefix and folder names to match your install.

The resulting list will give you what photos Coppermine knows about that it already expects are in that folder... including a timestamp we can see when they were added.
See how that compares to what you are adding.
If that particular folder is actually empty - we can easily delete just those entries from Coppermine...
If some exist and some don't - it gets a little harder...

Post a few of the entries - and what SHOULD be in that folder now (if anything)...

Greg
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

Quote from: gmc on February 27, 2014, 02:41:02 PM
OK... there are 19,000+ pics...
So the issue is with one folder you are trying to add.

Take the folder path you are trying to add from, and using phpMyAdmin or similar - let's see what Coppermine thinks is there...
If your folderpath is:  {cpg_directory}/albums/folder1/folder2/  and your coppermine table prefix is 'cpg_'
Then the SQL would be: SELECT * FROM cpg_pictures WHERE filepath = 'folder1/folder2/'
Note I did not include the 'albums/' folder as that is a CONFIG variable and not stored with each picture. Adjust the table prefix and folder names to match your install.

The resulting list will give you what photos Coppermine knows about that it already expects are in that folder... including a timestamp we can see when they were added.
See how that compares to what you are adding.
If that particular folder is actually empty - we can easily delete just those entries from Coppermine...
If some exist and some don't - it gets a little harder...

Post a few of the entries - and what SHOULD be in that folder now (if anything)...

Greg

Will try tomorrow.
I hope I won't be doing anything wrong... I do know some stuff, but this is something I have never done before, so I hope everything goes well, and that I understood it correctly. Thanks for the help so far! I appreciate it, and will try tomorrow. Just wanted to leave a reply so that you know I've read it.

gmc

No problem... Just post when you have the results...
'SELECT' is safe - we aren't changing anything at this point - just looking.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

Hope I did it right... English isn't my native language... LOL

QuoteSELECT *
FROM cpg15x_pictures
WHERE filepath =  'Teen_Wolf/Season_3/Episode_Stills/3x17_Silverfinger'
LIMIT 0 , 30

I just went to my PHPAdmin, selected the Pictures table, went to SQL and typed in what you quoted above, and clicked on start.

QuoteSELECT * FROM cpg15x_pictures WHERE filepath = 'Teen_Wolf/Season_3/Episode_Stills/3x17_Silverfinger'

I think I'm doing something wrong, or that I don't understand something for some reason....

Manutjee

Since I cannot edit my post:

I solved the issue! The files were stored in the Coppermine folder Screencaps > 3x17 Silverfinger instead of the Episode Stills.
I scrolled through the gallery, and I came across some trashcans, haha!

Thanks for all the help!

gmc

Glad you found it,.. And thank you for marking 'solved'
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

ΑndrĂ©

Quote from: Manutjee on February 28, 2014, 11:13:01 AM
I think I'm doing something wrong

Just for the record, phpMyAdmin haven't found any rows as you forgot to add the trailing slash.