4

I am trying to run a drush on functional Drupal 7 site, however, the attempt of run drush ends with an error saying: Class 'Drupal\user\Entity\User' not found in /usr/local/share/drush/lib/Drush/Boot/DrupalBoot.php, line 571.

Any idea what may be happening?

Full output:

vagrant@1843vm:/var/www/drupalvm/drupal/web$ drush
PHP Fatal error:  Class 'Drupal\user\Entity\User' not found in /usr/local/share/drush/lib/Drush/Boot/DrupalBoot.php on line 571
[error]  Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'Drupal\user\Entity\User' not found in /usr/local/share/drush/lib/Drush/Boot/DrupalBoot.php, line 571 
[error]  Drush was not able to start (bootstrap) Drupal.
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         :  7.50                                              
 drupal-settings-file   :  sites/default/settings.php                        
 uri                    :  http://default                                    
 db-driver              :  mysql                                             
 db-hostname            :  localhost                                         
 db-username            :  root                                              
 db-password            :  123                                               
 db-name                :  il                                                
 db-port                :                                                    
 install-profile        :  standard                                          
 db-status              :  Connected                                         
 theme                  :  intelligent_life                                  
 admin-theme            :  seven                                             
 php-bin                :  /usr/bin/php                                      
 php-os                 :  Linux                                             
 php-conf               :  /etc/php/5.6/cli/php.ini                          
 drush-script           :  /usr/local/share/drush/drush.php                  
 drush-version          :  9.0-dev-g1c91f8b                                  
 drush-temp             :  /tmp                                              
 drush-conf             :                                                    
 drush-alias-files      :  /home/vagrant/.drush/drupalvm.aliases.drushrc.php 
 root                   :  /var/www/drupalvm/drupal/web                      
 site                   :  sites/default                                     
 modules                :  sites/all/modules                                 
 themes                 :  sites/all/themes                                  
 files                  :  sites/default/files                               
 temp                   :  /tmp                                              
 %paths                 :  /var/www/drupalvm/drupal/web                      
                       sites/default                                     
                       sites/all/modules                                 
                       sites/all/themes                                  
                       sites/default/files                               
                       /tmp`
2

I had the same problem, it's related to the Drush version used by the DrupalVM. You can change the Drush version in the config.yml file.

More info: https://github.com/geerlingguy/drupal-vm/issues/1020

  • 3
    Where is this config.yml supposed to be and what should it look like to fix this? – kqw Mar 2 '17 at 22:08
  • I don't see a config.yml file either – Matt Mar 27 '19 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.