Hello all,
We recently migrated our home photos site to ZenPhoto and basically everything was fine for a while, we configured a theme and uploaded our albums via FTP.
But at some point we had to physically modify the tree structure of the albums and after that an error keeps occurring when we open "albums" in the admin panel. The error is kind of random, sometimes it does appear sometimes not and it also appears on different albums. At the same time the site doesn't seem to work when accessed via the front-end yet sometimes (i suppose when the error doesn't actually occur) it manages to load properly and function until the next time you go to the root of the albums.
Here's an example of the error:
[code]Fatal error: MySQLi Error: ( INSERT INTO [prefix]albums (folder, show, mtime, title, date, parentid) VALUES ('2015/04 - April/2015-04-05 P�ques Chasse aux Oeufs', '1', '1466473461', '2015-04-05 P�ques Chasse aux Oeufs', '2016-06-21 04:44:21', '645') ) failed. MySQLi returned the error Duplicate entry '2015/04 - April/2015-04-05 P' for key 'folder' in /home/manchevi/public_html/zp-core/functions-db-MySQLi.php on line 78
[/code]
What we did try so far is to delete the whole cache folder so that the system can start fresh with the new folder tree but it doesn't seem to have fixed the problem.
On a side note, might be related or not, there's a specific folder in the cache that doesn't want to delete via FTP, saying it's not empty... but it is empty.
Any ideas?
Comments
Zenphoto would update (sync) it's albums and database relations automatically on the next visit if you modified the file system via ftp.
You can also manually request that by performing a "database refresh". There is a button for this on the overview page on the backend.
To the mysql error: Apparently you have duplicate entries that should be unique in the database. How that happened I cannot really tell. It might be a setup problem or it got corrupt somehow. Best first try the database refresh to see if that help to sync it again.
If it doesn't you may need to use a backup or setup everything fresh.
I know deleting /cache doesn't help with the structure but since at first there were duplicated entries in that folder because it kept the original cache and the new one too.
I tried running the refresh db, it produced the same error (same type, with other duplicates, as usual).
Do you suggest we completely reinstall the system?
You could of course try to remove these duplicate album entries manually and test if that fixes it.
If you haven't entered any data on the backend that could be lost, you can also empty the albums folder and re-upload all of your albums (you can of course just move the albums out of the albums folder to save uploading everything).
A complete reinstall should not be necessary, if you should use a backup your database before the issue occured (if you haven't you should setup such backups, ZP has a tool for that onboard).
However the site is very slow. Since this is a brand new host for me, i have no idea if it's the host being slow or the ZenPhoto engine.
Is there a process of cache creation that happens "on demand" when you make a clean install? If so, perhaps that's why the site is slow when we access albums for the first time... ?
You can also check within the albums table via tools like phpmyadmin if 'id" has the primary mark and "folder" really is set to "unique". If not you could try to add that via SQL afterwards. But it should have happened on installing.
Yes, by default Zenphoto caches resized images on demand:
http://www.zenphoto.org/news/caching/
Depending on the host's power, the size (dimensions) and number of images and albums this that can be slow.
Other systems just feel faster because they create some default sizes on upload. We don't as themes have all freedom to use their own sizes. It is possible to pre-cache using the cacheManager. But a theme must be setup for it if it is using it's ownl sizes.