AccountInterface-foutmelding (Drupal)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Installatie van Drupal 8.0.1 met behulp van Drush, komt in januari 2016 niet verder dan:

Drupal installatie- & configuratiescript...
PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' 
not found in /var/www/example.com/core/includes/bootstrap.inc on line 58
Drush command terminated abnormally due to an unrecoverable error.                                  [error]
Error: Class 'Drupal\Core\Session\AccountInterface' not found in
/var/www/example.com/core/includes/bootstrap.inc, line 58
chmod: cannot access `/var/www/example.com/sites/default/files': 
No such file or directory
PHP Fatal error:  Class 'Drupal\Core\Session\AccountInterface' 
not found in /var/www/example.com/core/includes/bootstrap.inc on line 58
Drush command terminated abnormally due to an unrecoverable error.                                  [error]
Error: Class 'Drupal\Core\Session\AccountInterface' not found in
/var/www/example.com/core/includes/bootstrap.inc, line 58

Oorzaak

Mogelijke oorzaken

  • Het script werd mbv. sudo uitgevoerd, en dan werkt PATH soms niet [1]
  • Er draait stiekem nog een oude Drush-versie [2][3]
  • Drush-cache-probleem [4], op te lossen met drupal cache:Rebuild. Let op: drupal refereert naar Drupal Console, een verzamelin shell-tools voor het ontwikkelen van modules, en zodoende enigsinds gerelateerd aan Drush

Daadwerkelijke oorzaak

Het probleem had inderdaad met de versie te maken, in combinatie met sudo, terwijl de waarde van PATH wel identiek was (niet afgebeeld hier):

$ drush version
 Drush Version   :  8.1-dev 

$ sudo drush version
 Drush Version   :  6.2.0 

$ which drush
/home/strompf/.composer/vendor/bin/drush

$ sudo which drush
/usr/bin/drush

$ su
$ which drush
/usr/bin/drush

Oplossing

For the time being:

su
<naam drush-script>

Bronnen