Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoph 0.9.7 #101

Closed
lizdodd opened this issue Jan 22, 2018 · 9 comments
Closed

zoph 0.9.7 #101

lizdodd opened this issue Jan 22, 2018 · 9 comments

Comments

@lizdodd
Copy link

lizdodd commented Jan 22, 2018

@jeroenrnl
This is fabulous work. I really appreciate that you have improved the search time, because with the thousands of photos I have stored in Zoph the slow search has made it hard to use.
I updated today.
When entering some albums to see the first page of photos I got an error instead of creating a map (not every album, so I am not sure what the trigger is.

string(614) "#0 /var/www/zoph/classes/db/db.inc.php(149): PDOStatement->execute() #1 /var/www/zoph/classes/zophTable.inc.php(633): db\db::query(Object(db\select)) #2 /var/www/zoph/classes/place.inc.php(399): zophTable::getRecordsFromQuery(Object(db\select)) #3 /var/www/zoph/classes/place.inc.php(534): place->getAutoCover('random') #4 /var/www/zoph/classes/geo/marker.inc.php(73): place->getQuicklook() #5 /var/www/zoph/classes/place.inc.php(419): geo\marker::getFromObj(Object(place), 'geo-place') #6 /var/www/zoph/classes/photo.inc.php(1237): place->getMarker() #7 /var/www/zoph/photos.php(225): photo->getMarker() #8 {main}" SELECT DISTINCT ar.photo_id AS photo_id FROM zoph_photos AS p INNER JOIN zoph_view_photo_avg_rating AS ar ON p.photo_id = ar.photo_id WHERE (p.location_id=22) ORDER BY rand() LIMIT 1;SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared Fatal Error: SQL failed db.inc.php: 159.
fatal error

Another error is instead of one of the albums in a group with a thumbnail.
This is from an album page with sub-albums displayed.

string(861) "#0 /var/www/zoph/classes/db/db.inc.php(149): PDOStatement->execute() #1 /var/www/zoph/classes/zophTable.inc.php(633): db\db::query(Object(db\select)) #2 /var/www/zoph/classes/album.inc.php(455): zophTable::getRecords

[it looks like an incomplete message]

I'm going to be looking more at Zoph, so I expect I could be reporting some more errors.

@lizdodd
Copy link
Author

lizdodd commented Jan 22, 2018

This is trying to explore "Places". The first one linked under "World" is "Africa" which has no photos. No other places are available to choose
I get
string(591) "#0 /var/www/zoph/classes/db/db.inc.php(149): PDOStatement->execute() #1 /var/www/zoph/classes/zophTable.inc.php(633): db\db::query(Object(db\select)) #2 /var/www/zoph/classes/place.inc.php(399): zophTable::getRecordsFromQuery(Object(db\select)) #3 /var/www/zoph/classes/zophTable.inc.php(687): place->getAutoCover('random') #4 /var/www/zoph/templates/default/blocks/view_thumbs.tpl.php(29): zophTable->displayAutoCover('random') #5 /var/www/zoph/classes/template/template.inc.php(123): include('/var/www/zoph/t...') #6 /var/www/zoph/places.php(209): template\template->__toString() #7 {main}" SELECT DISTINCT ar.photo_id AS photo_id FROM zoph_photos AS p INNER JOIN zoph_view_photo_avg_rating AS ar ON p.photo_id = ar.photo_id WHERE (p.location_id=658) ORDER BY rand() LIMIT 1;SQLSTATE[HY000]: General error: 1615 Prepared statement needs to be re-prepared Fatal Error: SQL failed db.inc.php: 159.
fatal error

@jeroenrnl
Copy link
Owner

The problem with "General error: 1615 Prepared statement needs to be re-prepared", seems to be a MySQL bug that exists, at least, in 5.1 and 5.6: https://bugs.mysql.com/bug.php?id=42041
I am running MariaDB 10.2 and I could not reproduce this.

A workaround (and a confirmation that you are indeed running into this bug) could be to change
PDO::ATTR_EMULATE_PREPARES,false);
(classes\db\db.inc.php, line 67) into
PDO::ATTR_EMULATE_PREPARES,true);
I wouldn't run like this for a long time, though, as it does disable some of the security features prepared statements bring.

Another option, albeit not a full solution as it seems to decrease the chance of the problem occuring, not completely make it disappear, it also doesn't seem to fix it for everyone
increase 'table_definition_cache' in mysql's my.conf
I tried setting it to the lowest value it can have (400), but that didn't cause the problem to occur on my system.

@jeroenrnl
Copy link
Owner

The error in place of a thumbnail, might be the same as the one I just found when adding a new circle: #102, if you open "show source" in your browser, you will be able to see the full error.

@lizdodd
Copy link
Author

lizdodd commented Jan 24, 2018

I've got mariadb-server-10.1_10.1.23-9+deb9u1_i386.deb installed (debian stable)
I'll look at further testing in a few days.

@lizdodd
Copy link
Author

lizdodd commented Feb 6, 2018

I just trialled the workaround above (change line 67). In the situation in which the code is trying to place a photo on a map, and the photo has no coordinates, it allows the map to be drawn. That seems to be the best description of the error that I was running into.
I haven't altered the table_definition_cache.

@jeroenrnl
Copy link
Owner

I'm not sure if I understand you correctly, did the change in line 67 make the error go away?

@lizdodd
Copy link
Author

lizdodd commented Feb 8, 2018

Yes, with the line 67 change to
PDO::ATTR_EMULATE_PREPARES,true);
the errors go away
there is a speed hit with map selection and drawing now able to occur.

@jeroenrnl
Copy link
Owner

Ok, I got the first part. So, this confirms you got hit by that MySQL bug, however, the bug should have been fixed in MySQL 5.7, and MariaDB 10.1 is MySQL 5.7-compatible 😕, maybe the MariaDB team picked up this fix later in the 10.1 train? I'm not sure...
I don't understand the part about the 'speed hit' and 'drawing now able to occur'

@jeroenrnl
Copy link
Owner

@lizdodd I am preparing for the v0.9.8 release... is there anything that needs to be fixed in this release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants