Zenphoto DB duplicate data

I have been noticing this a lot recently and I would like to know if anyone had encountered this. In the albums table, I am seeing duplicate albums created for no reason with a lot of columns NULLed (the title and folder column are identical to one of the existing album, that's how I know it's a duplicate).

To make matter worse, a lot of images are also duplicated with the duplicate album as their parent. I've done several cleanups and they keep coming back. Any idea why this is happening? I am on version 1.1.5. I uploaded the images via FTP if that helps.

Thanks!

Comments

  • acrylian Administrator, Developer
    Well, since the current version of Zenphoto is 1.2.1 (1.2.2 coming soon) the only advise we can give is to upgrade. We can't support that old versions anymore.
  • Sorry to bring up old topic. I upgraded my Zenphoto to 1.2.2 and I still notice this happening. Duplicate albums are created in DB (although the album name is not exactly the same string, they have slash in front of them). It's as if Zenphoto thinks the album doesn't exist and recreate it. I also see a bunch of images with these duplicate albums as parent. Anyone else seeing this?
  • Sigh. If you are going to upgrade, you ought to get the current version. Right now you should be using 1.2.5 RC2.

    I have not heard of any other similar reports, though. Have you considered clearing out your database and starting fresh? Perhaps there is some problem with the old inherited tablse.

    Otherwise, please give us details of your configuration: PHP version, etc.
  • Sigh. Give my intelligence some credit :) I upgraded months ago when the latest version was 1.2.2. Now that I think abt it, I wiped the DB so it was actually a clean-install, not an upgrade.

    My latest investigation points to some custom rewrite rule that I added. I'll update again if I find anything more tangible.
  • Sigh, if you don't give us complete information how do you expect to get complete support? There is no indication in your post that you have been running for months on the version you installed. The implication of your message is that the upgrade was recent.
  • flu Member
    Hi Stephen,
    I get exactly the same issue : duplicate content, for example using the search page, or counting images. The only difference between the duplicate images is that there is another slash before the album name for one of them.

    Zenphoto version : 1.4.5.5
    PHP : 5.3.22
    MySQLi : 5.1.67
    theme used : lightly customed skeleton (but I get the same thing with the default theme)

    I've already refresh the metadatas and clean the html cache.
    Maybe it happened moving ZP from the root to a subdirectory (yeah, another great post of mine, probably my masterpiece) and lauching the setup again.

    The only error I get in my debug logs is that :
    `
    {8114:Thu, 31 Oct 2013 22:36:17 GMT}

    WARNING: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/xxx/zp-core/lib-GD.php:114) in /home/xxx/public_html/xxx/zp-core/functions-image.php on line 32

    header called from imageError (functions-image.php [32])

    from cacheImage (functions-image.php [493])

    from i.php [165]
    `
    Any idea ?
    (and I don't particularly want to get on your nerves...)
  • The error you report is probably not relevant to the problem. However, it is a downstream effect of some other error which should appear somewhere.

    The duplicate content is likely caused by database issues. I recall this problem, but unfortunately cannot at present find any references to it.

    I suggest you first install the current support build then run a database refresh. If this does not resolve the problem you will need to manually edit your database to remove the entries with double slashes.
  • Hi Stephen,
    I've installed the last official build 1.4.5.7, refreshed the database and still got this issue.
    You're right, no other way but manually delete the duplicated album with a slash before their name in the database.

    I'd like to know why they appeared but it will be for another time.
  • Hi... flu...i am dealing with this same issue, also after update to 1.4.5.7 release. Exactly same issue. And the disturbing part is that even after cleanup, duplicates keep appear again and again, i cannot get rid of them :( Wrong duplicates are created with leading slash "/" in front of album/image folder, which makes URL not found, but they appear in Search results. Out of ~2000 real images there are ~6000 entries in the database. Writing this i am already afraid of not only duplicates, but even triplicates. I don't know the root cause, but any idea how can i track it down?
  • acrylian Administrator, Developer
    If your database has no unique indexes set it will re-appear. Did you check that?
  • I have this in images table:
    Key Column
    PRIMARY* id
    filename filename
    albumid
    albumid albumid

    And this in my albums table:
    Key Column
    PRIMARY* id
    folder folder

    Not sure which unique indexes you mean..database was imported from previous zenphoto release..
  • acrylian Administrator, Developer
    Those I meant actually. Btw, You should upgrade to 1.4.5.9 anyway. You sadly have to remove those entries manually from the database. I cite my colleague from a ticket:
    you would have to re-load your database from a backup and manually correct the records--delete ones that should not be there and fix the folder string for ones that should be there but have invalid folder names.

    As to the difficulty, folder names are invalid if any of the following appear:

    leading slash
    trailing slash
    leading period
    containing the string /./
    containing the string /../

    For any of these cases the garbage collection will attempt to correct the problem by fixing the folder name and updating the database record. That update will fail if there is already a record with the correct folder name--thus the requirement sometimes that you fix these things manually.
  • I am afraid that cleanup might help only until the duplicates get created again...:( two days ago i already did cleanup.. is there any root cause known for this?
  • acrylian Administrator, Developer
    Yes, those missing unique (primary) field flags. I don't remember offhand the issue being in 1.4.5.7 or before. Again, please upgrade first.
  • flu Member
    Hi Wittie,
    for me this issue was solved after I made an update to 1.4.5.8.
Sign In or Register to comment.