Skip to content

issue with debug:database:log command #3940

@driesplasman

Description

@driesplasman

Started with Drupal only a couple of weeks ago. During tests, I added and deleted users. After the first deletion of a user (a full delete, including contents), in a fairly clean environment with only a handful of contributed modules, I seem to have a database issue as the debug:database:log Console command doesn't work anymore. The output is at the bottom of the message.

The issue can be reproduced as follows :

  • Create a user
  • Run the debug :database:log command -> all should be OK
  • Delete the user
  • Run the debug:database log command -> error, command not executed.
  • Clean the log file through the Drupal UI
  • Run the debug :database:log command -> all should be OK again

My environment:

  • Drupal 8.5.7
  • PHP 7.2.9
  • Percona SQL 5.6.41-84.1

command output

Error: Call to a member function getUsername() on null in /var/www/html/vendor/drupal/console/src/Command/Database/DatabaseLogBase.php on line 231 #0 /var/www/html/vendor/drupal/console/src/Command/Debug/DatabaseLogCommand.php(158): Drupal\Console\Command\Database\DatabaseLogBase->createTableRow(Object(stdClass))
#1 /var/www/html/vendor/drupal/console/src/Command/Debug/DatabaseLogCommand.php(110): Drupal\Console\Command\Debug\DatabaseLogCommand->getAllEvents()
#2 /var/www/html/vendor/symfony/console/Command/Command.php(251): Drupal\Console\Command\Debug\DatabaseLogCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/vendor/symfony/console/Application.php(964): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 /var/www/html/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Drupal\Console\Command\Debug\DatabaseLogCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/vendor/drupal/console-core/src/Application.php(185): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/vendor/symfony/console/Application.php(148): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/vendor/drupal/console/Bin/drupal.php(89): Symfony\Component\Console\Application->run()
#9 /var/www/html/vendor/drupal/console/Bin/drupal(4): require('/var/www/html/v...')
#10 {main}
Error: Call to a member function getUsername() on null in Drupal\Console\Command\Database\DatabaseLogBase->createTableRow() (line 231 of /var/www/html/vendor/drupal/console/src/Command/Database/DatabaseLogBase.php).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions