does dblog wanna log too early?
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'uid' cannot be null: 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] => [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:6:"Notice";s:8:"!message";s:65:"Use of undefined constant REFERER_THEME - assumed 'REFERER_THEME'";s:9:"%function";s:14:"include_once()";s:5:"%file";s:78:"/home/xl/workspace/sanago/sites/all/modules/referer_theme/referer_theme.module";s:5:"%line";i:3;s:14:"severity_level";i:5;} [:db_insert_placeholder_4] => 5 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://default.sanago.localhost/admin/modules [:db_insert_placeholder_7] => http://default.sanago.localhost/admin/structure/types/manage/event/fields [:db_insert_placeholder_8] => 127.0.0.1 [:db_insert_placeholder_9] => 1303138071 ) in dblog_watchdog() (line 155 of /home/xl/workspace/sanago/modules/dblog/dblog.module).
Comments
Comment #1
damien tournoud commentedThis is most likely already solved in 7.x-dev.
See #598586: watchdog() assumes $user is defined.
Comment #2
geek-merlinwrong assumption.
it's about missing quotes in a const definition in a module (php5 is more picky with that).
nevertheless, dblog should not freak out then.
Comment #3
geek-merlinups, race condition...
Comment #4
dwees commentedI'm seeing the exact same error, and I don't see the duplicate case that resolves it. The fix from the issue in #1 did nothing to resolve this error on my site, which came up after upgrading to Drupal 7. I have tried clearing the cache, and verifying that the most recent database upgrade changes were in fact implemented in the database (which I believe was to add an index to the uid column in the watchdog table?).
Here's the dump of the error from my site, is this the same issue as above?
Comment #5
dwees commentedSo my error is extremely strange simply because I did something completely strange - I apparently missed some files when upgrading my files. Setting this issue back to the most recent 'closed (duplicate)'.
Comment #6
adampv commented(Drupal 7.32) I took out the following code : /var/www/vhosts/website.com/modules/dblog/dblog.module and it solved the problem:
But 2 days later the ibdata file got corrupted. I don't know if there is any relation between the 2 problems (!)
----------------
/**
* Implements hook_watchdog().
*
* Note: Some values may be truncated to meet database column size restrictions.
*/
function dblog_watchdog(array $log_entry) {
Database::getConnection('default', 'default')->insert('watchdog')
->fields(array(
'uid' => $log_entry['uid'],
'type' => substr($log_entry['type'], 0, 64),
'message' => $log_entry['message'],
'variables' => serialize($log_entry['variables']),
'severity' => $log_entry['severity'],
'link' => substr($log_entry['link'], 0, 255),
'location' => $log_entry['request_uri'],
'referer' => $log_entry['referer'],
'hostname' => substr($log_entry['ip'], 0, 128),
'timestamp' => $log_entry['timestamp'],
))
->execute();
}
---------------------