Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with debug:database:log command #3940

Closed
driesplasman opened this issue Oct 8, 2018 · 2 comments
Closed

issue with debug:database:log command #3940

driesplasman opened this issue Oct 8, 2018 · 2 comments
Milestone

Comments

@driesplasman
Copy link

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

@LOBsTerr
Copy link
Member

LOBsTerr commented Oct 9, 2018

Nice catch! Thank you

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

@LOBsTerr LOBsTerr added this to the 1.9.0 milestone Oct 9, 2018
@LOBsTerr
Copy link
Member

LOBsTerr commented Apr 5, 2019

It has been merged

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

No branches or pull requests

2 participants