nZEDb
nZEDb copied to clipboard
$pager disappears on /movies
Actual behaviour
Hard to reproduce as it only happens a few times a month and only seems to affect Firefox (Chrome is fine).
The $pager will disappear from /movies. I tried copying the contents of pager.tpl and put that directly into movies.tpl This may have lessened the occurrence but I can't say for sure.
restarting memcached will fix it.
Steps to reproduce the behaviour
General browsing and a lot of patience.
Debian 8 3.16.0-4-amd64 apache2 2.4.10-10+deb8u5 memcached 1.4.21-1.1 php5-memcache 3.0.8-5 php5-memcached 2.2.0-2 php5 5.6.23+dfsg-0+deb8u1
Hah I noticed this too a while ago and indeed it fixed itself after a while. Could never find what caused it or when. Only on /movies?t=blabla and not the /Movies main category.
I do not use Memcached but do use Redis. I do use Chrome though so it's not limited to just Firefox. Not limited to any browser as it's nothing happening on the front-end.
A while back I tried to troubleshoot this and noticed the query used to calculate the pagenumber returns only enough content for 1 page. So the pager is never shown.
var_dump($results[0]); shows:
["_totalcount"]=>
string(1) "1"
Whenevr I flush Redis the pager returns. Looks like it's caching the result of a messed up query from time to time.
Happened again today. Flushing Redis works but not a viable long-term solution.
Happened again yesterday...
Still having this problem. Only flushing redis works for a short while.
Happens on both /movies and /movies?t=xxxxx now. It never happens on any other category or /browse. Happens in all browsers.
This is likely a problem with my queryCalc function I use for cover view. I will have to look into it. It might be time for another overhaul anyways as I found some issues with the counting a few weeks back that caused it to be slower than SQL_CALC_FOUND_ROWS. Might be better now and can try it out.
Any updates on this @b3rs3rk ? Title may be misleading because it happens in every browser, the output from nZEDb to Smarty tells Smarty there should only be one page because the number of results is under a certain treshhold (which should not be the case).
After manually flushing the cache (Redis in my case) or waiting for the cache to timeout "solves" the problem for a short while.
This happened again.
https://github.com/nZEDb/nZEDb/blob/0.x/www/pages/movies.php#L81
The output of this is 1. Therefore the pager is not displayed: https://github.com/nZEDb/nZEDb/blob/0.x/www/themes/Gentele/templates/pager.tpl#L4
Then I flush the cache. In my case Redis, and then suddenly it's correct again:
["_totalcount"]=> string(5) "19159"
I will pay some serious $$$ for anyone who can fix this bloody bug.
Does this happen with categories other than Movies? I'm trying to narrow down the range of code to search through.
BTW, what is your definition of "serious $$$" :-D
No, only in Movies and it's subcategories.
My bet is the getMovieRange function. As that sends count to pager https://github.com/nZEDb/nZEDb/blob/dev/nzedb/Movie.php#L302
@DariusIII That's where I'm currently investigating, but I'm not convinced it is the cause. It calls queryCalc and there may be a logic error in there instead.