Randomly occurring error on fresh install - bad SQL in role/user?
aylwin@groups.d... - March 3, 2008 - 18:26
| Project: | Drupal |
| Version: | 6.3 |
| Component: | user.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
This is on a fresh install of Drupal 6.1. This error keeps recurring on seemingly random pageloads:
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/.sites/10/site95/web/d/includes/database.inc on line 235.
warning: implode() [function.implode]: Invalid arguments passed in /home/.sites/10/site95/web/d/includes/database.inc on line 235.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.sites/10/site95/web/d/modules/user/user.module on line 500.
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 p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/.sites/10/site95/web/d/modules/user/user.module on line 500.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/.sites/10/site95/web/d/modules/block/block.module on line 402.
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/.sites/10/site95/web/d/includes/database.inc on line 235.
warning: implode() [function.implode]: Invalid arguments passed in /home/.sites/10/site95/web/d/includes/database.inc on line 235.
warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/.sites/10/site95/web/d/modules/block/block.module on line 403.
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 ') OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module' at line 1 query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '' AND b.status = 1 AND (r.rid IN () OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module in /home/.sites/10/site95/web/d/modules/block/block.module on line 403.If I hit reload a few times, the page may load normally. I haven't installed any modules yet or changed any settings.
Using PHP 5.2.5, MySQL 5.0.45.
If you'd like to see it for yourself: link

#1
Sorry, it turns out this was on MySQL 4.1.22. On the advice of our host, I've now been moved to a server with MySQL 5.0.45 and don't seem to be getting this error. But 6.1 is supposed to support 4.1.1, right?
#2
I also get the following errors after todays module updates:
* warning: array_fill() [function.array-fill]: Number of elements must be positive in ***/includes/database.inc on line 235.
* warning: implode() [function.implode]: Bad arguments. in ***/includes/database.inc on line 235.
* warning: array_keys() [function.array-keys]: The first argument should be an array in ***/modules/user/user.module on line 500.
* 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 p.perm FROM **role r INNER JOIN s08permission p ON p.rid = r.rid WHERE r.rid IN () in ***/modules/user/user.module on line 500.
After some refreshes it disappears, then appears again.
#3
I have the same errors skakasi reports.
MySQL 5.0.45
PHP 5.2.5
#4
Same warning message re-appears after every run of the update.php
#5
I have MySQL version 5.0.24.
The warning appears every time I see the admin pages.
#6
This happens to me after node save, MySQL 4.1.21
#7
Here are some more details for my case:
Drupal 6.3, PHP 5.2.5, Linux OS, Apache 2 (I can supply more details on the server if needed).
Reproducable: Always
Scenario: Edit a node of type 'Page' (CCK is installed, but no fields were added to this type), click 'Save'. The save works, but the following errors are reported
warning: array_fill() [function.array-fill]: Number of elements must be positive in /home/yuval/minsa.co.il/includes/database.inc on line 240.warning: implode() [function.implode]: Invalid arguments passed in /home/yuval/minsa.co.il/includes/database.inc on line 240.
warning: array_keys() [function.array-keys]: The first argument should be an array in /home/yuval/minsa.co.il/modules/user/user.module on line 500.
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 p.perm FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN () in /home/yuval/minsa.co.il/modules/user/user.module on line 500.
The selected file /tmp/fileUVu6ym could not be uploaded, because the destination files/xmlsitemap/sitemap.xml.gz is not properly configured.
Unable to load site map. Make sure that there is an xmlsitemap directory in your files directory and that it is writable by Drupal.
Screenshot of the status page attached.
[Update: While preparing this report, I tried to fix the xmlsitemap issue that you can see on the errors, and the problem was gone. So xmlsitemap might be a candidate module to blame for this. I'll update here if it comes back]
#8
I had the same errors, but my problem was that I've overridden my global $user variable by mistake with some other user on anonymous user;)
In this case maybe some additional module made it as well.