After an extended period of time without any activity on a site, views that make use of the Global Filter generate a "Page not found" result.

I have tried changing the various options in the session cache API module to no avail. I have set the global filter block to be on every page, and it shows the correct selection choices.

The behaviour is the same if I am using multiple or single choice drop-down, or multiple choice select box.

I am using PHP 5.4.14 on Server 2012 (IIS 8).

I am able to clear the issue by clearing the Class Registry cache or "Page and Else" cache, until some time passes, and the "Page not found" result shows again.

Please let me know what else I can try to isolate the cause...

Thanks!

Comments

rdeboer’s picture

Hi timatlee,

Thank you for your report.

Not sure what to advise. Looks like you've tried almost everything.

It does sound like something times out. What "storage mechanism" is selected in Session Cache API? File, $_SESSION, cookie...?

And what expiration period have you set?

What is roughly the time before "Page not found"s start to emerge?

What is this "Page and Else" cache? I'm not familiar with it.

Rik

timatlee’s picture

Hi Rik

I have 3 choices for session storage: User's computer in a cookie, on core cache database, in $_SESSION memory. It is presently set to "in a cookie", as this seems to last longest.

Expiration is set at 7 days.

The time until "Page not found" appears is a bit challenging. I don't have precise measurements, but my gut says that if the storage is set to be a cookie, it lasts a day. If it's set to Core cache DB, it will work for a few hours. Same as if I use $_SESSION.

"Page and Else" is a cache clearing feature from .. uhh.. the Admin Menu module, I think. Clearing the registry invokes registry_rebuild(), while page and else clears the cache, cache_boostrap, cache_filter, cache_page tables, I believe (just taking a cursory look at what admin_menu does

For what it's worth, if I check the configuration of the view when the issue is present, I find that the Contextual Filter selection is missing the Global Filter option. Once I clear the cache, and re-check the configuration, the Contextual Filter type has been selected back to Global Filter (field or search term).

I'm going to see if I can measure how long it takes for the issue to occur, and see if that gives me any insight.

Thanks for your help!

rdeboer’s picture

Hi Tim,

I'm starting to think that some module is interfering.
You are the first to report this issue. Maybe you use an uncommon module, or an uncommon setup?
Then again, many people may not expect their filter settings to still be the same 24 hours later, so may not have noticed what you are noticing.

To eliminate the chance of interference, I suggest you configure Session Cache API to stay away from cookies, database and session.

Enable the Session Cache File submodule, included with the Session Cache project, and elect the IP address as the session key.
This will ensure that no other module tramples all over the session data, as cookies and $_SESSION are accessible (and destroyable) by any module on your site.
By using "file", you can then also inspect the creation dates (and contents) of your session data on disk. So you can take a snapshot of the directory and see how long the files live. You'll find the session cache files in the directory you defined as your Private file system path, on the configuration page .../admin/config/media/file-system.

Hope this helps you getting to the bottom of this.

Rik

timatlee’s picture

Hi Rik

I'll give that a shot, and see how it goes.

I set up a small python script to poll the page that was generating the error.. and since running that, the error did not reappear overnight (as I have come to expect it to)... go figure?

The site is presently in development, and as such, we haven't scheduled cron - so it runs on the first user's visit using Drupal's automated cron.

Thanks for the suggestion - I'll disable the "404 check" script I wrote, apply your suggestions, and let you know.

Tim

timatlee’s picture

Hi Rik

about 3.5 hours later, the problem re-surfaced. That was with session cache API using a small file, and without frequent harassment by my 404 checking script.

The session file is still there, and dated from earlier this morning from shortly after my response to you (9:28 AM or thereabouts). It's contents "look right" - it has the machine name and value of the taxonomy term I have been filtering on.

I'm going to try to move this site over to another (non-IIS) web server to see if there's anything with that...

rdeboer’s picture

Whoa... what a palaver to get to the bottom of this.

You are very persistent.

So if the session file is still there then Session Cache API has not expired it and its data is still available to Global Filter.

Which means to me that Views is losing something else (or is robbed of it). Do you have Cache switched on in your Views UI ?

Rik

timatlee’s picture

Hi

Well, I'm keenly interested in having the module work :) When the system is behaving, it perfectly solves a need that we have. When it stops working, it's very odd!

None of the displays in the view in question have caching turned on.

I've still been experimenting with the timing of the thing. I ran the 404 checking script overnight, but at a 2 hour interval, and the issue did not re-appear overnight.. the site was working just fine in the morning.

So, I turned that off, and let it sit for more than 2 hours, and sure enough, there's the issue again. Hypothesizing that cron runs every 3 hours (by default in a drupal 7 install), that on the occasion that when I access the site, and cron runs, the error appears.

Though.. I would expect that this would be the case with installs of this module on other sites.. and as you point out, that's not the case.

I've since turned cron off on the site, and am letting it sit .. I'll ratchet up the time an hour at a time and see if I can get it to occur with the automatic cron off.

I admit .. I'm flipping switches to see what happens.

I didn't have time to bring the site over to another server to see if that solves the issue.. hoping to do that before I leave today so it has time to timeout over the weekend.

Thanks again for your continued help :)

Tim

rdeboer’s picture

"I ran the 404 checking script overnight, but at a 2 hour interval, and the issue did not re-appear overnight.. the site was working just fine in the morning"

Maybe that script works as ping/keep-alive !

I hope you find out what combination of modules and configuration settings causes this bizarre behaviour.

timatlee’s picture

Yeah, that's what I was trying to test.

I'm considering turning on crontab on an hourly basis, call it from Nagios, and see if the issue goes away. I'd like to find out what the problem is.. but it's getting to be rather time consuming :-/

I think I'm leaning toward it being an IIS issue, to be honest. I copied the site to a Linux VM, and let it sit over the weekend. Monday morning, the IIS site is 404ing, and the Apache site is not.

Either that, or it's a PHP version. Linux is 5.4.39, and IIS is 5.4.14.. so I'll upgrade PHP on the Windows server, and see if anything changes.

timatlee’s picture

Hmmm, so same versions of PHP, the site on IIS generates the error after 3ish hours, while the site on Apache does not.

I will admit - I wasn't all that careful about ensuring identical configurations between platforms, so it stands to reason that there might be an issue there.

It's making me lean more towards some sort of weirdness in IIS, rather than Drupal or PHP.

In any case, I'm going to add the site's cron URL to Nagios, and see if that makes the issue not reappear.

Thanks again,

Tim

rdeboer’s picture

Hey TIm, this is a long shot, but would this have something to do with it:
"Due to an issue in the caching mechanism of Views it's possible that configured filters lose their effect."
FIxed in the latest official release of Views: https://www.drupal.org/node/2480327

rdeboer’s picture

Status: Active » Closed (cannot reproduce)

Assuming this was fixed with 7.x-1.13. Please re-open if not.