Skip to content

issue with debug:database:log command #3940

Closed

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).

Activity

  1. LOBsTerr commented on Oct 9, 2018

    @LOBsTerr
    Member

    Nice catch! Thank you

    PR #3945
    PR Translation hechoendrupal/drupal-console-en#214

  2. added this to the 1.9.0 milestone on Oct 9, 2018
  3. LOBsTerr commented on Apr 5, 2019

    @LOBsTerr
    Member

    It has been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions