I am new to Drupal and trying to learn by using the examples in 'Using Drupal'. I enter the site definitions for the screens, saving my work at each step. When I either stop and re-start the browser (after logging out) or if the screen saver kicks in, my site is toast. I get the following errors on re-start of the browser:
* warning: array_map() [function.array-map]: Argument #2 should be
an array in /etc/drupal/modules/system/system.module on line
1015.
* warning: array_keys() [function.array-keys]: The first argument
should be an array in /etc/drupal/includes/theme.inc on line
1771.
* warning: Invalid argument supplied for foreach()
in /etc/drupal/includes/theme.inc on line 1771.
Further, the background, fonts, menus, most everything is gone. This seems like a caching issue. I am using Drupal 6.14, fedora linux 10, apache 2.2.11, PHP 5.2.9. I am running my browser (FireFox 3.0.14) on my server system.
All help is greatly appreciated!
Comments
I usually see those type of
I usually see those type of errors when moving a site from one directory to another. I think the old path to the theme gets cached and when it tries to find it, it can't. When you clear the caches everything returns to normal. Is there anything unusual in how your server is set up that might cause paths to change?
Ezra Wolfe
DLC Solutions
EthosCE
Just following example in Ch. 3 (Epic U. jobsdb) of Using Drupal
I don't think that there is anything unusual in my setup, though I have modified my httpd.conf (I am running fedora 10 linux). I have reviewed the file and backed out changes that I made - it still fails. Obviously, something unusual is happening.
It has failed at least 4 times, usually within 10 minutes of actual work from starting the example. Sometimes it fails after returning from the screensaver, sometimes simply after saving some changes (press save, it advances to a completely blank screen). It fails at different points and seemingly for different reasons, but always fails. Here are the apache log records associated with the last 2 failures.
first failure:
[Wed Oct 14 19:02:28 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function content_types() in /etc/drupal/sites/all/modules/contrib/cck/include
s/content.admin.inc on line 890, referer: http://www.chuck.com/?q=admin/content/node-type/job/fields/field_contact...
fields
[Wed Oct 14 19:02:31 2009] [error] [client 127.0.0.1] File does not exist: /etc/drupal/favicon.ico
[Wed Oct 14 19:02:38 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function content_types() in /etc/drupal/sites/all/modules/contrib/cck/include
s/content.admin.inc on line 890, referer: http://www.chuck.com/?q=admin/content/node-type/job/fields/field_contact...
fields
[Wed Oct 14 19:03:15 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function content_types() in /etc/drupal/sites/all/modules/contrib/cck/include
s/content.admin.inc on line 890, referer: http://www.chuck.com/?q=admin/content/node-type/job/fields/field_contact...
fields
second failure:
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.access' doesn't exist\nquery: SELECT 1 FROM access WHERE type = '
host' AND LOWER('127.0.0.1') LIKE LOWER(mask) AND status = 0 LIMIT 0, 1 in /usr/share/drupal/includes/database.mysqli.inc on line 128
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.cache' doesn't exist\nquery: SELECT data, created, headers, expire, se
rialized FROM cache WHERE cid = 'variables' in /usr/share/drupal/includes/database.mysqli.inc on line 128
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.variable' doesn't exist\nquery: SELECT * FROM variable in /usr/share/d
rupal/includes/database.mysqli.inc on line 128
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Notice: Undefined variable: variables in /usr/share/drupal/includes/bootstrap.inc on line 480
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.cache' doesn't exist\nquery: UPDATE cache SET data = '', cre
ated = 1255564861, expire = 0, headers = '', serialized = 0 WHERE cid = 'variables' in /usr/share/drupal/includes/database.mysqli.inc on line 128
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Notice: Undefined variable: variables in /usr/share/drupal/includes/bootstrap.inc on line 487
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.system' doesn't exist\nquery: SELECT name, filename, throttle FROM sys
tem WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC in /usr/share/drupal/includes/database.mysqli.inc on line 128
[Wed Oct 14 20:01:01 2009] [error] [client 127.0.0.1] PHP Warning: Table 'jobsdb.url_alias' doesn't exist\nquery: SELECT COUNT(pid) FROM url_alias in /
usr/share/drupal/includes/database.mysqli.inc on line 128
I am simply working along. I haven't had any interaction with mySQL (such as stopping it).
It seems to me that things are inconsistent, like the database was updated and something written to the cache (generated PHP code?) that somehow got confused. That is a pretty exotic scenario, but it seems to fit the symptoms.
How do you force the cache to clear or update?
TIA!
You can clear the cache
You can clear the cache through the admin screen here: admin/settings/performance
But looking at those errors you have more than a cache issue. It appears you are missing tables or your db user doesn't have permission to access them.
Are the access, url_alias and system tables in your database? If so, check and make sure your db user has full permissions to access all tables on the jobsdb database.
Another thought: Check and make sure mysql isn't shutting down when your screensaver kicks in or at other times. Check the mysql log for errors.
Ezra Wolfe
DLC Solutions
EthosCE
still no joy
This seemed a likely problem. However, I did verify that my drupal user has complete access. Also, the mentioned tables are there. There are 46 tables in the database.
show grants for drupal@localhost yields
GRANT USAGE ON *.* TO 'drupal'@'localhost' IDENTIFIED BY PASSWORD xyz
GRANT ALL PRIVILEGES ON 'jobsdb'.* TO 'drupal'@'localhost'
This time it ran quite some time, I actually got further than ever before. It 'failed' when I tried to advance to another screen and got a completely blank screen. It also gets errors when I start it. When it originally failed I got this single log message from the apache log.
[Thu Oct 15 22:01:39 2009] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function content_types() in /etc/drupal/sites/all/modules/contrib/cck/include
s/content.admin.inc on line 890, referer: http://www.jobs.com/?q=admin/content/node-type/application/fields
I also immediately checked and it seems MySQL was still running. I checked the MySQL error log and there wasn't anything notable. Just the startup message at the appropriate time and no shutdown message and no logged errors.
When it failed I was trying to add a file field (provided by FileField using CCK) (admin/content/node-type/application/fields) application was the content type that I had just added and saved. Earlier I had enabled FileField and several other modules in CCK. The module should be available due to the install script that is executed.
In my experience, complete systems like this are wonderful when they work, but awful to figure out when they fail, especially when you are trying to learn the system. :-(
A bit late for your problem,
A bit late for your problem, but for others out there.
These errors can come up if you don't have a theme selected. For instance, perhaps someone put a custom theme in /themes instead of sites/all/themes and set it as the default theme for the site. You come along and use Drush to update or untar the latest version of Drupal into a new folder, and you lose the theme, thus Drupal has no default theme to use and it sends out errors.
If this is what happened to you as well, then you can fix it if you can go to http://yourdrupalinstall/admin/build/themes/select and change your theme. If you can't get there, you can go into the database and set the theme in the system table, so set the status of garland (for example) to 1 and then set it to the default theme.
Hope that helps someone.