I recently noticed that Guests can not visit the same page twice in one session on my site.
The page shows up correctly on the first visit - upon reloading or visiting the page through another link, it will be blank. Changing the URL (even trivially, by adding "?test=1") will cause it to work - but again only once.
This only happens when I am not logged in. I assumed it was caused by a module at first, but I've disabled all non-required modules and the error still occurs.
The site is at http://arancaytar.ermarian.net/ .
Please tell me if you get the error as well; it may be on my end.
Comments
Comment #1
cburschkaI now know this doesn't only happen on my computer only. This only occurs on one of my sites, but on that site it always occurs, regardless of what modules are enabled. Does anyone have any ideas for why this could happen?
Comment #2
cburschkaI'm changing this title based on what I've found out now.
Accessing my site through lynx from another computer (I have no idea why) shows an error message instead of the standard blank response.
The error message is this:
The error is followed by a page of gibberish that I've cut short here.
Comment #3
SubWolf commentedWhile I haven't experienced this problem myself, I'm now hearing from clients and friends that it is happening to them, and I have no solution to offer so far, the code at first glance looks fine.
Help!
Comment #4
cburschkaI've worked around this by disabling page caching.
I don't know what exactly was the problem, but I've noticed that the error notice still appears occasionally at the top of the page, and it might be this notice that has "broken" the caching system by interfering with the HTTP headers (speculation).
Since it is a notice, it can be removed by disabling the "E_ALL" error mode. Whether this solves the original problem - ie that an enabled page cache causes blank pages - I haven't yet tried out.
Comment #5
Anonymous (not verified) commentedI am curious to your PHP version, OS Information and please mark the correct Drupal version.
Line 37 of cache.inc for 6.x-dev:
Comment #6
cburschkaUnfortunately (or fortunately?), I can't reproduce it anymore. Viewing as guest or as a logged-in user, it works without blank pages or error notices. Here are three things I changed since then:
1.) Upgraded PHP to version 5.2.1 (from 5.1.4)
2.) Downgraded Drupal from 6.x-dev to 5.1 (I know I shouldn't have used the HEAD anyway, but when it's not currently going through the early phases of a new major release, it's not such a problem)
3.) Removed
php error_reporting(E_ALL);from my settings page (should also have done this some time ago as I was done debugging).Any of these could have fixed it (I'm tending to the third one, really, since this was an error notice and won't be displayed when E_ALL is off.
So I'm closing this for now... the only issue that really remains is the often-requested E_ALL error-free compliance.
Comment #7
Wesley Tanaka commentedI'm getting this in IE. It happened to be the first time I was looking at a particular "domain" on my local computer with that IE.
Comment #8
Wesley Tanaka commentedThe $user object at the point where I get the error:
stdClass Object ( [uid] => 0 [hostname] => 127.0.0.1 [roles] => Array ( [1] => anonymous user ) [session] => )
Note that there is, indeed, no cache field.
Comment #9
Wesley Tanaka commentedSome "printf debugging" reveals that the $user object is coming from here (in session.inc)
drupal_anonymous_user does in fact, not set a cache field. I'm not sure if the solution is to change drupal_anonymous_user() or to change line 37 of cache.inc
Lemme go figure out what $user->cache means...
Comment #10
Wesley Tanaka commentedOkay, this seems to affect anonymous users that do not have an entry in the sessions table. The output created is a notice, so the obvious workaround is to turn off notice reporting. $user->cache is used to simulate a cache flush without actually flushing the cache -- if a piece of cached data is older than the $user->cache timestamp, it's ignored in cache_get (the check on line 37).
There are two ways to fix this:
1. Treat a non-existent $user->cache to mean $user->cache == 0
2. Set $user->cache to 0 in drupal_anonymous_user
Attached to this comment is a patch for approach #2
Comment #11
Wesley Tanaka commentedThis patch implements approach #1
Comment #12
Wesley Tanaka commentedA workaround for those hitting this in development is to do an action in your browser that would cause you to acquire a session (visiting the login page?), and then DELETE FROM {cache_page} to get rid of any pages with cached notices.
Comment #13
joemoraca commentedI applied the patch in comment #11 and it seemed applied fine but I didn't have the problem before the patch and don't have it after the patch.
Comment #14
owen barton commentedSubscribing.
http://drupal.org/node/123717 has been marked as a dupe
Comment #15
killes@www.drop.org commentedMoving this to HEAD so it can first be applied there. Should be backported to D5. I am not sure if the attached patch is the right one. Attached is an alternative patch which sets $user->cache = 0 for anon users. One of them is good to go.
Comment #16
Wesley Tanaka commentedMaybe you didn't see the patch in #10?
Comment #17
dries commentedI've committed this to CVS HEAD and DRUPAL-5. Yay!
Comment #18
hawkdrupal commentedI have this problem repeatedly. The error says the problem is in session.inc. Apparently, the cache isn't being set for anonymous users.
My problem is documented here:
http://drupal.org/node/132740
I applied the patches provides in this thread, but they didn't help:
http://drupal.org/node/111697
At this point, Drupal 5.1 is unusuable.
Comment #19
Wesley Tanaka commentedUnfortunately most open source bug tracking processes have a somewhat misleading definition of the "fixed" status (Drupal's included). It means "a fix has gone into source control somewhere" as opposed to "you should be able to get a fixed version of the product now". In this particular case, the fix should be available whenever the next release after 5.1 is released (which seems to be taking a long time).
That being said, if your notice is coming from a different file and a different line number, that means that it's a different issue, which you should open a different (new) bug report for.
Comment #20
Tresler commentedSaid fix is in CVS. as Dries says here http://drupal.org/node/111697#comment-219111
You want to check out a new copy of DRUPAL-5 from CVS instructions are in handbook here: http://drupal.org/handbook/cvs
Make sure you get the right version - not HEAD. Cheers!
Comment #21
(not verified) commented