Hi to all,

this is my first post. Initially I intended to write my first post, because I could not solve the above mentioned error message, which appeared when:

- User is logged out,
- User accesses any page,

the following message in the content area appeared:

"You are not authorized to access this page"

...followed by these errors:

* warning: array_fill() [function.array-fill]: Number of elements must be positive in /var/www/drupal2/includes/database.inc on line 258.
* warning: implode() [function.implode]: Invalid arguments passed in /var/www/drupal2/includes/database.inc on line 258.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/drupal2/modules/user/user.module on line 512.
* 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 /var/www/drupal2/modules/user/user.module on line 512.
* warning: Cannot modify header information - headers already sent by (output started at /var/www/drupal2/includes/database.inc:258) in /var/www/drupal2/includes/common.inc on line 148.
* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/drupal2/modules/block/block.module on line 432.
* warning: array_fill() [function.array-fill]: Number of elements must be positive in /var/www/drupal2/includes/database.inc on line 258.
* warning: implode() [function.implode]: Invalid arguments passed in /var/www/drupal2/includes/database.inc on line 258.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /var/www/drupal2/modules/block/block.module on line 433.
* 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 LEFT JOIN i18n_blocks i18n ON (b.module = i18n.module AND b.delta = i18n.delta) WHERE (i18n.language ='en' OR i18n.language ='' OR i18n.language IS NULL) AND ( b.theme = '' AND b.status = 1 AND (r.rid IN () OR r.rid IS NULL) )ORDER BY b.region, b.weight, b.module in /var/www/drupal2/modules/block/block.module on line 433.

Of course there will be many possible causes for this error. In my case, the solution was simple but wasted hours of my life...

The solution:

Check the table "users" if it contains an empty row the the uid = 0. If not, add it and hopefully, you'll get rid of the error.

Of threads, concerning the error:
http://drupal.org/node/362156
http://drupal.org/node/777116
http://stackoverflow.com/questions/857203/errors-on-front-page-of-drupal...
https://drupal.org/node/777116

Kind regards!

Comments

verta’s picture

Thanks for posting this. Hopefully someone will write a patch so it can be tested and perhaps released some day.