if you filter by php errors on d.o right now, there are a bunch of errors from user.module:
http://drupal.org/admin/logs/event/16408814
array_keys() [<a href='function.array-keys'>function.array-keys</a>]: The first argument should be an array in /var/www/drupal.org/htdocs/modules/user/user.module on line 361.
which causes:
http://drupal.org/admin/logs/event/16408815
implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in /var/www/drupal.org/htdocs/modules/user/user.module on line 361.
which leads to:
http://drupal.org/admin/logs/event/16408816
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /var/www/drupal.org/htdocs/includes/database.mysql.inc on line 172.
user.module is running with local modifications (the {user_access} split patch), but it's not clear if that's the source of the errors. this particular line of user.module appears to be unmodified. however, it wasn't changed for the 5.1 release, either. i don't have time to investigate more closely, but i figured i should post it here for others to look into and hopefully resolve. i sure hope this isn't a bug in 5.1 itself.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 114074_user_session_fix.patch.txt | 729 bytes | dww |
Comments
Comment #1
incom commentedI am using 5.1 and get the following error
I removed all contributed modules - error disappear - when enabling bio module, it appears - not tested with other modules -
Comment #2
Anonymous (not verified) commentedHi,
I posted a Bug report on 22.01.2007 (http://drupal.org/node/111754) with the same error message. I've got also the problem now with 5.1...
I tried to deactive some modules but i didn't find the error. My Drupal isn't modified...
cu tb.
Comment #3
flanderz commentedExperiencing this problem with the comment module as well. (Drupal 5.1)
Comment #4
BioALIEN commentedJust came across this error also. My scenario is somewhat strange though. I tried to login to another Drupal powered website using my Drupal ID and despite the successful login, I was presented with this error.
Comment #5
Southpaw commentedI also have this error, but only on the Comment > Settings page.
Drupal 5.1
Comment #6
rHOnDO commentedI'm getting this error with a default install of 5.1 (PHP 5.2.1 MySQL 5.0.27)
Comment #7
dwwok, this is clearly not specific to d.o, but apparently a bug in core itself. moving to the more appropriate issue queue.
Comment #8
rHOnDO commentedThis was solved for me using the code from this post:
http://drupal.org/node/121679#comment-203549
Thanks ravx.
- at file /includes/bootstrap.inc after line
case DRUPAL_BOOTSTRAP_SESSION:
insert this code
Comment #9
dwwok, very interesting. after reading http://drupal.org/node/20397 and http://drupal.org/node/6696 in some detail, it looks like our previous session-related fixes for calling 'session_write_close' at the right time are failing for sites with session.auto_start = 1 in some cases. so, right when we're first bootstrapping the session, if there's already a session open, we need to close it. otherwise, all sorts of bad things befall us. forcing php into
session.auto_start == 0mode might be a greater evil than this work-around for cases where it's set to 1. of course, this is critical-path bootstrap.inc time, so i suppose every newifclause counts. however, i'll take correctness over performance any day. ;)p.s. same patch applies with offset to D6, but i'm leaving this as a D5 bug for now, since that's where it's easily and frequently confirmed, and also since that's what d.o is still running.
Comment #10
drummsession.auto_start is PHP_INI_ALL, so we can set it in settings.php with similar variables.
If we can not for some reason, then we just need some comments in that code.
Comment #11
dwwAhh, interesting. So, we rely on .htaccess to set
php_value session.auto_start 0. However, not all hosts use apache and .htaccess, so I bet this is a big nasty problem on non-apache sites, where we're just not setting auto_start 0 at all. :(Sadly, the CVS history on this point is pretty spotty:
followed by:
and finally:
Sadly, revision 1.65 has no issue nid, so there's no telling where "Per Goba's comments" can be found. There's no mention in http://drupal.org/node/18641 nor http://drupal.org/node/17303. :( All I could find was http://drupal.org/node/17303#comment-317527 but that doesn't deal with auto_start.
Seems like we need Gabor to come back here and try to remember why it's the way it is. However, IMHO, we really should be declaring these PHP settings in settings.php where they'll work on all configurations, not just apache, especially for things as critical as session.auto_start.
Comment #12
gábor hojtsyOh, the feedback is that it is pointless to set session auto starting in settings.php, as by the time PHP reaches running settings.php code, it already started the session or not, depending on that setting. The point of the auto start setting is to start the session before any PHP code is run. So while PHP code already runs, there is no point fiddling with that setting.
Comment #13
dww@Gabor: Ahh, right. ;) Makes sense.
Yucky problem, though. :( Now what? I'd hate to think my patch above is really the best approach -- it's certainly cruft in a very performance-critical code path just to handle non-Apache configs. But, if we have to define auto_start in .htaccess for it to work, and not everyone's got .htaccess, I'm not sure what else we can do to avoid the bugs.
@drumm: given all this info, where do you think a code comment is needed? A comment next to my evil if() clause in the patch? A comment in settings.php that you can't put auto_start there? Both?
Thanks, all.
Comment #14
Aleet commentedIs this issue still being worked on? The patch didn't work for me. I'm getting this error:
* warning: array_keys() [function.array-keys]: The first argument should be an array in /home/ihea/public_html/multicultural_health_education/modules/user/user.module on line 361.
* warning: implode() [function.implode]: Bad arguments. in /home/ihea/public_html/multicultural_health_education/modules/user/user.module on line 361.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/ihea/public_html/multicultural_health_education/includes/database.mysql.inc on line 172.
Running 5.1.
Comment #15
diego.banchero commentedI found the same problem with latest drupal.
I used this workaround:
- in settings.php
- put session_destroy(); before ini_set(..) section.
This seems to work.
Comment #16
thedavidmeister commentedUnfortunately the patch in #9 is not for D6, there's no patch in #15 and nobody has confirmed/denied whether this is an issue in the latest version of Drupal (8).
Setting to needs work.