nZEDb icon indicating copy to clipboard operation
nZEDb copied to clipboard

$pager disappears on /movies

Open ghost opened this issue 8 years ago • 12 comments

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

ghost avatar Jul 25 '16 12:07 ghost

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.

Fossil01 avatar Jul 28 '16 16:07 Fossil01

Happened again today. Flushing Redis works but not a viable long-term solution.

Fossil01 avatar Aug 16 '16 08:08 Fossil01

Happened again yesterday...

Fossil01 avatar Sep 09 '16 11:09 Fossil01

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.

Fossil01 avatar Nov 19 '16 13:11 Fossil01

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.

b3rs3rk avatar Dec 03 '16 23:12 b3rs3rk

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.

Fossil01 avatar Oct 10 '17 14:10 Fossil01

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"

Fossil01 avatar Oct 21 '17 13:10 Fossil01

I will pay some serious $$$ for anyone who can fix this bloody bug.

Fossil01 avatar Mar 24 '18 17:03 Fossil01

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

niel avatar Mar 25 '18 11:03 niel

No, only in Movies and it's subcategories.

Fossil01 avatar Mar 25 '18 11:03 Fossil01

My bet is the getMovieRange function. As that sends count to pager https://github.com/nZEDb/nZEDb/blob/dev/nzedb/Movie.php#L302

DariusIII avatar Mar 25 '18 20:03 DariusIII

@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.

niel avatar Mar 25 '18 22:03 niel