I have 2 installations in the same url and different paths. One for testing (with own database table) and one for "usage" (with own database table).
Both installations should contain the same files I say on purpose "should"!
Some minute ago I was purging the caches (image/rss/html/search) of both installations.
The "test" version works still fine.
While the "usage" version shows a blank page.
error.log just says: 500
debug.log shows:
USER ERROR: MySQLi Error: ( SELECT DISTINCT id FROM [prefix]images WHERE show = 0 OR albumid in () ) failed. MySQLi returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 in /var/www/my_zpc/com/zp-core/functions-db-MySQLi.php on line 78
trigger_error called from query (functions-db-MySQLi.php [78])
from getNotViewableImages (functions.php [1568])
from getTagCountByAccess (functions.php [1191])
from getAllTagsUnique (functions.php [1116])
from tagSuggestJS (tag_suggest.php [64])
from tagSuggestJS_frontend (tag_suggest.php [50])
from call_user_func_array (unknown)
from zp_apply_filter (functions-filter.php [149])
from include (inc-header.php [37])
from include (index.php [1])
from include (index.php [130])
from index.php [31]
Then I overwrote functions-db-MySQLi.php by copy and pasting it from the test install. But no change.
But the "usage" installation can be accessed with my working browser where I am working as ZenPhoto-Admin and the page works all normal.
Any idea because this is really strange to me.
It is the first time that I see such behaviour.
It happens with all "usage" = live pages.
What/how I did it:
First after purging caches I just pressed F5 to refresh (in another browser ) the current picture album. In return I got a blank page.
I took my "admin browser" - where the front- and backend still work normal - and walked throught all the albums to generate the thumbnails and open all existing pictures.
(As the pages are still not available for public and there are not many albums and pictures imported, it takes no time to open all that.)
Ctrl+U shows this:
meta charset="UTF-8">
script type="text/javascript" src="/com/zp-core/js/jquery.js">
script type="text/javascript" src="/com/zp-core/js/encoder.js">/script>
script type="text/javascript" src="/com/zp-core/js/tag.js">/script>
link type="text/css" rel="stylesheet" href="/com/zp-core/zp-extensions/tag_suggest/tag.css">
/head>body>/body>/html
I now installed and activated the theme "Zenpage".
My "admin-browser" displays the page with the new layout.
Another browser still displays a blank page.
Meanwhile I tried 4 different browsers (FF, Opera, IE and QupZilla) on 2 other machines.
All with the same result.
Sorry, I was looking in the wrong error.log
When accessing the page with another browser it will cause this error.log entry:
PHP Fatal error: MySQLi Error: ( SELECT DISTINCT id FROM [prefix]images WHERE show = 0 OR albumid in () ) failed. MySQLi returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 in /var/www/my_zpc/com/zp-core/functions-db-MySQLi.php on line 78
In the access.log I can find following entries:
"GET /com/ HTTP/1.1" 500 197 "-"
"GET /com/zp-core/zp-extensions/tag_suggest/tag.css HTTP/1.1" 200 251 "https:// my_zpc/com/"
"GET /favicon.ico HTTP/1.1" 200 4286 "-"
"GET /com/ HTTP/1.1" 500 197 "-"
"GET /com/zp-core/zp-extensions/tag_suggest/tag.css HTTP/1.1" 304 - "https:// my_zpc/com/"
"GET /com/zp-core/js/encoder.js HTTP/1.1" 200 3446 "https:// my_zpc/com/"
"GET /com/zp-core/js/jquery.js HTTP/1.1" 200 33369 "https:// my_zpc/com/"
"GET /com/zp-core/js/tag.js HTTP/1.1" 200 2739 "https:// my_zpc/com/"
Do you have the html static cache enabled? Perhaps it did cache the broken page and therefore serves the blank page? Loggedin admins don't get the html cache.
The only thing in that query that looks weird is OR albumid in () ) since there should be in() and there should be some id probably. In any case it seems to be related to the tagsuggest plugin. So try to disable that. This is a older plugin and never cause these trouble to my knowledge (we even use it ourselves on our site).
I deactivated tagsuggest.
Purged all caches again.
Started Tor-Browser (to be sure I have a clean browser and different IP)
opened the page - AND believe what:
The website is showing now!
I tried all other browsers - and it is rocking again! miley:
Thanks for your assistance!!
Good, it worked again. The actual query error is related to a helper function named getNotViewableImages() which sorts out tags from images that are not viewable/not allowed for the current visitor. Reason is if there is an image/album with a unique tag it does not make sense to suggest this tag if the vistor cannot view the connected item anyway.
This however is a bit costly regarding performance since it needs to scan everything first to sort out which is why there is an option to disable this check. Please try to enable tag_suggest and disable that option.
And yes, html_static_cache is an offiicial plugin included for years already ;-) It just caches pages so it "might" that it accidentally caches a wrong result (not knowing what it caches). However that does relate to fatal errors since it just cachces the html result.