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

PHP Fatal error: Class 'Drupal\user\Entity\User' not found in /var/lib/nginx/.composer/vendor/drush/drush/lib/Drush/User/User8.php #2046

Closed
keithyau opened this issue Mar 1, 2016 · 4 comments

Comments

@keithyau
Copy link
Contributor

keithyau commented Mar 1, 2016

Hi there,

having below issue. Any idea is appreciated.

[nginx@ip-10-0-4-230 sites]$ drush dis module_builder PHP Fatal error: Class 'Drupal\user\Entity\User' not found in /var/lib/nginx/.composer/vendor/drush/drush/lib/Drush/User/User8.php on line 26 Drush command terminated abnormally due to an unrecoverable error. [error] Error: Class 'Drupal\user\Entity\User' not found in /var/lib/nginx/.composer/vendor/drush/drush/lib/Drush/User/User8.php, line 26 Drush was not able to start (bootstrap) Drupal. [error] Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error generally points to a site configuration issue, and not a problem connecting to the database.

Keith

@weitzman
Copy link
Member

Please paste output of drush status --verbose

@michaellenahan
Copy link

vagrant@dkr:/var/www/drupalvm/dkr-web/docroot$ drush status --verbose
Executing: mysql --defaults-extra-file=/tmp/drush_cxOBMB --database=dkr --host=localhost --port=3306 --silent  < /tmp/drush_ypSCRo
Executing: mysql --defaults-extra-file=/tmp/drush_NLPAH1 --database=dkr --host=localhost --port=3306 --silent  < /tmp/drush_jV74JO
Error: Class 'Drupal\user\Entity\User' not found in Drush\User\User8->load_by_uid() (line 26 of                             [error]
/var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/User/User8.php) #0
/var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php(558): Drush\User\User8->load_by_uid(0)
#1 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(354): Drush\Boot\DrupalBoot->bootstrap_drupal_login()
#2 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(509): drush_bootstrap(6, 7)
#3 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(456): drush_bootstrap_max()
#4 /var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(59): drush_bootstrap_to_phase(-2)
#5 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 phar:///usr/local/bin/drush/bin/drush.php(150): drush_main()
#7 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#8 {main}.
Error: Class 'Drupal\user\Entity\User' not found in /var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/User/User8.php on line 26 #0 /var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/Boot/DrupalBoot.php(558): Drush\User\User8->load_by_uid(0)
#1 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(354): Drush\Boot\DrupalBoot->bootstrap_drupal_login()
#2 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(509): drush_bootstrap(6, 7)
#3 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/bootstrap.inc(456): drush_bootstrap_max()
#4 /var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(59): drush_bootstrap_to_phase(-2)
#5 /var/www/drupalvm/dkr-web/vendor/drush/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#6 phar:///usr/local/bin/drush/bin/drush.php(150): drush_main()
#7 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#8 {main}
Error: Class &#039;Drupal\user\Entity\User&#039; not found in Drush\User\User8->load_by_uid() (line 26 of /var/www/drupalvm/dkr-web/vendor/drush/drush/lib/Drush/User/User8.php).
Drush command terminated abnormally due to an unrecoverable error.                                                          [error]
A non well formed numeric value encountered drush.inc:1671                                                                     [notice]
ob_end_clean(): failed to delete buffer. No buffer to delete preflight.inc:786                                                 [notice]
Drush was not able to start (bootstrap) Drupal.                                                                             [error]
Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error
generally points to a site configuration issue, and not a problem connecting to the database.

Drush was attempting to connect to:
 Drupal version                  :  8.4.5
 Site URI                        :  http://default
 Database driver                 :  mysql
 Database hostname               :  localhost
 Database port                   :  3306
 Database username               :  drupaluser
 Database name                   :  dkr
 Database                        :  Connected
 Administration theme            :  seven
 PHP configuration               :  /etc/php/7.1/cli/php.ini
 PHP OS                          :  Linux
 Drush script                    :  /usr/local/bin/drush
 Drush version                   :  8.1.15
 Drush temp directory            :  /tmp
 Drush configuration             :
 Drush alias files               :
 Install profile                 :  thunder
 Drupal root                     :  /var/www/drupalvm/dkr-web/docroot
 Drupal Settings File            :  sites/default/settings.php
 Site path                       :  sites/default
 File directory path             :  sites/default/files
 Temporary file directory path   :  /tmp
 Sync config path                :  ../config/sync

@weitzman
Copy link
Member

weitzman commented Mar 4, 2018

Please use Drupal Answers for support questions.

@weitzman weitzman closed this as completed Mar 4, 2018
@clfer
Copy link

clfer commented Feb 24, 2022

For anyone coming from a google search:
http://www.john-brandenburg.com/blog/unable-run-drush-uli-drupal-8

Did your DB import finished properly?

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

No branches or pull requests

4 participants