Refresh database in latest nighty build

"Refresh the Database" does not work as I would expect. Because it reset all records in the images table, e.g. the title becomes image name, the sorting is gone, the link to the tags does not work anymore and... This is not a garbage collection, it's a kind of a reset function! If this behaviour is correct, please rename the button!

Comments

  • The button does just what it's title says.

    It examines the database, removes orphaned records (ones where the file no longer exists). It also cleans up invalid records such as those where the file name starts with a slash or has double slashes, etc.

    If some of those invalid records did contain your titles, etc. then they may well have been discarded. But they were not valid records to start with.

    You can, of course, restore your database from a backup and manually fix those records.
  • The previous release (1.4.5.5) did what you said. But now, zp deletes every record (independed if it's valid or not) and writes a new one. All the manually entered text is gone (like image titles etc). Since the old image id's does not exist anymore, all links to the 'obj_to_tag' table become invalid! That's really bad.
  • Does not do that for me. Have to assume then that your database entries were corrupt and that cleaning up the corruption resulted in this.

    Again--reload from your backup (you did make one, didn't you?) and manually correct the database entries.
  • acrylian Administrator, Developer
    I just tried and I also cannot reproduce this behaviour.
  • I have exactly the same problem, using dynamic albums.
    I use tu re-enter after each refresh the title of each image and also the album title.

    If i have "Musées du Monde" as dynamic album, i rename it as "musees" for example, then after i meet the problem.
  • acrylian Administrator, Developer
    Are you sure you use the "database refresh" and not the "meta data refresh". The 2nd might do this as it re-reads the EXIF etc metadata again.
  • Yes, "Actualiser la Base de données" in french. The Metadata refresh never worked for me. Each time he "scan" my more than 1000 images todo nothing.
  • acrylian Administrator, Developer
    Well, if your images don't have meta data or stored them off the standard (which some programs do) that would be correct.
  • Oh, no... My images have metadata, i just told that i have the same problem. Then since i stop use the dynamic albums.

    Can you specify "good" metadata for you ?
  • acrylian Administrator, Developer
    I cannot specify "good metadata" as there is no such. Some programs use EXIF/IPTC fields not as defined in the official standards. But we follow those standards naturally.

    Anway, this is for sure not your issue and I can only repeat what sbillard already said above. I cannot reproduce any issues.
  • Let us be perfectly clear.

    Refresh database (garbage collect) does not cause any metadata refresh directly. But certainly if the garbage collect detects flawed database records and removes and then Zenphoto re-discovers the album the database record will be recreated correctly.
    If i have "Musées du Monde" as dynamic album, i rename it as "musees" for example, then after i meet the problem.
    There are two possibilities here since you were far from clear as to what you did. If you renamed the folder on your file system then Zenphoto would consider it a new album of course.

    It is also possible that your file system has difficulties with files with diacritical marked characters. This is often the case when the file system is UTF-8 and you have not told Zenphoto.
  • I probably found the reason for this behaviour. Following situations:

    ZP 1.4.5.5
    Press "Set as thumbnail for" in edit images in the backend-> ZP generates wrong records in album/images table (leading/trailing slashes in names) -> remove them manually in the DB -> ZP generates new invalid records, when I view the gallery again

    Update from 1.4.5.5 to 1.4.5.7 (last build from github)

    First try:
    Starting setup process to update to new version (no errors) -> Album/images table looks ok -> View gallery -> Album/images table completely rewritten (new id’s, all manual text gone, link to tags table become invalid, etc)

    Second try:
    Starting setup process to update to new version (no errors) -> Album/images table looks ok -> remove just the invalid album records with leading or trailing slashes in DB manually and leave images table untouched -> View gallery -> Album/images tables are untouched by ZP, everything looks good -> Press "Refresh the Database": ZP found the wrong image records and removed them -> DB ok (no invalid records), Gallery look ok

    It seems that ZP has problems with DB records containing leading/trailing slashes in albums. In this case it rewrites the entire album/images table, at least on my system...
  • acrylian Administrator, Developer
    there was an serious issue with diacritical marks in 1.4.5.6 which is why we release 1.4.5.7 one day after it. There was also an issue with trailing slashes that should not be there in certain places.

    Please create a ticket so sbillard more easily sees it later.
  • It seems that ZP has problems with DB records containing leading/trailing slashes in albums. In this case it rewrites the entire album/images table, at least on my system...
    Perhaps you missed it the first time I told you that this was the problem. And maybe you missed it again the second time. And maybe again the third time....

    Also you seem to miss the normal suggestion that if you are having a problem you should at least try to see if the support build corrects it. You can do this either by installing it or by perusing the changes to the release to see if anything fits.
  • Hi guys,
    I've got the same problem with some albums name in my DB, Zenphoto adds a slash before some of them.
    As suggested, I remove them manually because they only appear in the search results.
    I've noticed that they are created at the same time than the regular named albums.

    Zenphoto 1.4.5.7
    MySQLi : 5.1.67
    PHP : 5.3.22
    encoding : fr_FR.UTF8

    This is weird. I'd like to prevent it to happen again.
  • acrylian Administrator, Developer
    As noted on this topic this was an issue in 1.4.5.6 that has been corrected in 1.4.5.7.
  • We would like this not to happen as well. We think the problem is fixed, but if that is not case we need sufficient information to know where the error ins occurring.
  • Well, guys,
    as mentioned above, my ZP version is a 1.4.5.7 one (updated step by step from a 1.4.5.2 fresh installation).
    Stephen, as mentioned above, I gave some informations about my settings,
    here they are again :
    Zenphoto 1.4.5.7 [59c22b2fba]
    MySQLi : 5.1.67
    PHP : 5.3.22
    encoding : fr_FR.UTF8
    theme : lightly modified ZPskeleton

    would you mind saying to me what do you need to go further ?
  • Need to know under what circumstances these bad entries are created.

    So, after you have cleaned your database manually, what was it that causes a new wrong item to appear?
  • I have no idea.
    Since my last message, other duplicated albums have been created (with a slash before their names).
    Maybe something about the cache ?
    Or maybe if a thumbnail is manually selected by the user ?
    For example, in the database I get this :
    album01/albumtitle title:a:1:{s:5:"fr_FR";s:19:"Album TITLE ";}
    and created at the same time I get this :
    /album01/albumtitle title:albumtitle

    Anyway I have no errors about that in the debug log but I get that :

    `
    {64956:Thu, 21 Nov 2013 20:34:46 GMT}

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

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

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

    from i.php [165]

    {64956:Thu, 21 Nov 2013 20:34:46 GMT}

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

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

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

    from i.php [165]

    {64956:Thu, 21 Nov 2013 20:34:46 GMT}

    WARNING: Cannot modify header information - headers already sent by (output started at /home/XXX/public_html/zp-core/lib-GD.php:114) in /home/XXX/public_html/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]
    `
    Last : it only happened to albums of a connected uploader since the last database clean up today.
  • The warnings are downstream issues, but there should have been an error logged by the `imageError` function mentioned. The error is that a particular image failed in the image create function of the graphics library. The message should tell you the image name as well.

    I do not understand "connected uploader", but that is probably the key information since it seems to be the source of the problem.

    Also you can install the latest support build [550e100083] as I have added some more debugging of this problem which might help.
  • Hi stephen,
    by "connected uploader" I mean regularly registered users who have the right to edit their own album and to upload pictures.
    It seems that this happens only after these users edit or upload some pictures.

    I'll give a try to this release and let you know.

    Thank you.
Sign In or Register to comment.