After switching servers, and operating system versions (Debian "Lenny" to "Squeeze"), all moved sites (without exception) emit insane amounts of PHP errors ("type: PHP", "Severity: error") into the watchdog logs, all complaining about "Undefined index", "Undefined variable", "Undefined constant", or "Undefined property".
At first I thought this might indicate some minor bugs in a couple of modules, but after monitoring watchdog for a while, basically every module/theme I'm running causes these errors, including core. Some examples:
Notice: Undefined index: key in format_xml_elements() (line 1114 of /var/www/drupal/includes/common.inc).
...
Notice: Undefined variable: node in include() (line 131 of /var/www/drupal/sites/all/themes/acquia_prosper/page.tpl.php).
...
Notice: Undefined index: HTTPS in translate_this_display_button() (line 60 of /var/www/drupal/sites/all/modules/translate_this/translate_this.module).
...
Notice: Undefined offset: 0 in content_taxonomy_token_values() (line 48 of /var/www/drupal/sites/all/modules/content_taxonomy/includes/content_taxonomy.token.inc).
...
Notice: Use of undefined constant OPENLIBRARY_COVERS_API_ROOT - assumed 'OPENLIBRARY_COVERS_API_ROOT' in include_once() (line 27 of /var/www/drupal/sites/all/modules/openlibrary/openlibrary.module).
...
Notice: Undefined variable: term_desc in _taxonomy_vtn_terms_blocks_view() (line 187 of /var/www/drupal/sites/all/modules/taxonomy_vtn/taxonomy_vtn_terms_blocks/taxonomy_vtn_terms_blocks.module).
...
Notice: Trying to get property of non-object in include() (line 13 of /var/www/drupal/sites/all/themes/rh/custom-pager.tpl.php).
...
Notice: Undefined property: stdClass::$parent in include() (line 12 of /var/www/drupal/sites/all/themes/rh/custom-pager.tpl.php).
As far as I know, watchdog messages prepended with "Notice:" are not severe and can be ignored. The sites seem to operate fine, but I'm shocked by the amout of errors - there's basically nothing else in the watchdog log, and far more than 100 of these PHP errors are recoreded in every watchdog log in every site per minute. Considering the impact of this on the database server, I'd like to either resolve these errors, if possible, or to disable these notices. However, ./admin/settings/error-reporting does not allow to completely disable error logging.
Any ideas or suggestions?
Comments
Suppressing PHP error notices globally in php.ini
The global
php.inifile allows to suppress PHP error notices:The default setting on Debian "Squeeze" is:
This quiets Drupal's watchdog logs down:
Though I'm not sure if this setting can be generally recommended for production use as even notices might indicate failures in the code.
I've mysteriously started
I've mysteriously started receiving these as well. I can't figure out what is going on. Very strange as it's as you said 'hundreds' of these all with the same time stamp.
Me too
same weird errors on a new linode server using ubuntu lucid and php pinned to karmic 5.2
Starting about a week ago I
Starting about a week ago I keep getting weird php errors in my sandbox. First I thought it was a new module I was testing. Then I realized that my Drupal logs are filled with php errors the minute I sync down a new database. These errors are all over the place and don't make sense, such as:
Any ideas what could be causing this? I'm on Ubuntu 10.10, Apache/2.2.16, MySQL database 5.1.49, PHP 5.2.10-2ubuntu6.
Thanks,
Eric
Bugs in the modules you are
Bugs in the modules you are using are causing this. You can suppress the errors by modifying the PHP error level, or you can debug the code.
If you follow each of the errors in each module's issue queue, you'll probably find a many related reports, and a couple of patches.
Been trying to help these issue along
http://drupal.org/node/1113666
http://drupal.org/node/1441144
http://drupal.org/node/1433258
http://drupal.org/node/1096218
http://drupal.org/node/1438000
http://drupal.org/node/900958
http://drupal.org/node/1165214
http://drupal.org/node/1244546
http://drupal.org/node/1032570
I am experiencing this as
I am experiencing this as well after migrating from a Wamp setup to Lamp (CentOS 6), on Drupal 6 sites.
My initial thought was that they couldn't all be down to module errors, as the error reporting level was set to 'all' on the old server as well and no messages were received there. However we have updated php from 5.2.13 to 5.3.3, and mysql from 5.1.45 to 5.1.52 as part of the move, so could this explain the errors? (Some modules not being updated for php 5.3 seems a possiblity - though I notice ericbroder is on 5.2 and getting errors)
The only other difference I can think of is that we are now using Drush to maintain the sites.
Any advice much appreciated, as I'd rather not have to change the error level if possible.
Ok, for my situation it
Ok, for my situation it appears that this explains it: http://groups.drupal.org/node/194883
i.e. the errors I'm receiving are due to specific modules not being ready for php 5.3.
I'll have to take a closer look at these modules and decide how problematic I think they are. I'm really not keen on getting a new server together just to run an older version of php on it.
Experiencing the same thing
* notice: Undefined index: #node in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/nap/modules/uc_nap/uc_nap.module on line 76.
* notice: Undefined variable: type in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/ubercart/uc_product/uc_product.module on line 1747.
* notice: Undefined index: #node in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 233.
* notice: Trying to get property of non-object in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 233.
* notice: Trying to get property of non-object in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 166.
* notice: Undefined index: blog in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: ad in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: image in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: product in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: product_kit in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: forum in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: panel in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: page in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: profile in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined index: story in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/paypernode/paypernode.module on line 163.
* notice: Undefined variable: title_color in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/themes/mix_and_match/page.tpl.php on line 43.
* notice: Undefined variable: slogan_color in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/themes/mix_and_match/page.tpl.php on line 43.
* notice: Undefined index: #node in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/nap/modules/uc_nap/uc_nap.module on line 76.
* notice: Undefined variable: type in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/ubercart/uc_product/uc_product.module on line 1747.
* notice: Undefined index: #node in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 233.
* notice: Trying to get property of non-object in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 233.
* notice: Trying to get property of non-object in /home/drunken6/public_html/modifiedcycletrader.com/sites/all/modules/node_author/nodeauthor.module on line 166.
I don't know what to do
Was this also after changing
Was this also after changing host? Are you able to provide what php / mysql / apache version you're on? Interested to know if there are any similarities between our setups.