Quantcast
Viewing latest article 8
Browse Latest Browse All 10

Incorrect integer value WATCHDOG_ERR

This tutorial is related to issue with Drupal after upgrade, module change or module activation. The error is similar to this one:

“PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ‘WATCHDOG_ERR’ for column ‘severity’ at row 1: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] => 0 [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => The specified file %file could not be copied to %destination. [:db_insert_placeholder_3] => a:2:{s:5:”%file”;s:22:”temporary://filefCLBmE”;s:12:”%destination”;s:56:”public://ctools/css/818a9e4e3a8a0543c79825df2bf73444.css”;} [:db_insert_placeholder_4] => WATCHDOG_ERR [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://www.domain-name.com/ [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => 84.22.6.242 [:db_insert_placeholder_9] => 1317299034 ) in dblog_watchdog() (line 157 of /var/www/vhosts/www.domain-name.com/httpdocs/modules/dblog/dblog.module).”

After some search and investigation the issue appeared to be in a file called ‘file.inc’ located inside ‘includes’ folder. All the rest variables were WATCHDOG_ERROR, but there was one WATCHDOG_ERR which seams to be not declared anywhere.

  1. cat /var/www/vhosts/www.domain-name.com/httpdocs/includes/file.inc |grep WATCHDOG_ERR

The output was :

  1. watchdog('security', "Security warning: Couldn't write .htaccess file. Please create a .htaccess file in your %directory directory which contains the following lines: <code>!htaccess</code>", $variables, WATCHDOG_ERROR);
  2. watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => $destination), WATCHDOG_ERR);
  3. watchdog('file', '%path is a directory and cannot be removed using file_unmanaged_delete().', array('%path' => $path), WATCHDOG_ERROR);
  4. watchdog('file', 'The file %path is not of a recognized type so it was not deleted.', array('%path' => $path), WATCHDOG_ERROR);
  5. watchdog('file', 'The file permissions could not be set on %uri.', array('%uri' => $uri), WATCHDOG_ERROR);

One of the watchdog lines is not like the rest, and instead of WATCHDOG_ERROR is WATCHDOG_ERR:

  1.  watchdog('file', 'The specified file %file could not be copied to %destination.', array('%file' => $source, '%destination' => $destination), WATCHDOG_ERR);

So use your preferred editor and just change the variable to WATCHDOG_ERROR and save the file.
Then the issue should be resolved.


Viewing latest article 8
Browse Latest Browse All 10

Trending Articles