0

I am getting a weird error when attempting to use Drush.

Fatal error: Call to undefined function variable_get() in /home/1000/.drush/backups/pantheon/20161102190143/modules/xmlsitemap/xmlsitemap.drush.inc on line 29
Drush command terminated abnormally due to an unrecoverable error.
Error: Call to undefined function variable_get() in /home/1000/.drush/backups/pantheon/20161102190143/modules/xmlsitemap/xmlsitemap.drush.inc, line 29

I have disabled and removed the xmlsitemap module, but it looks like it is referencing some weird backup version of the module.

  • How about clear site and drush cache? Can it fix? – Jimmy Ko Nov 3 '16 at 10:16
1

The function variable_get doesn't exist in Drupal 8. I suggest just removing ~/.drush/backups/pantheon/20161102190143/modules/xmlsitemap/xmlsitemap.drush.inc or moving ~/.drush/backups to ~/.drushbackups if you can control this.

Your problem is probably caused by the fact that you are putting the backup inside the ~/.drush directory and Drush is parsing code/files in that directory.

  • Thanks - I'm using 7 but it seems to have worked itself out when creating a new instance based off of my most recent commit to a dev server. – cwahlfeldt Nov 3 '16 at 20:36
  • OK, so I missed about your version of Drupal (that is why you should include as much info as possible when asking a question), but I'm 100% correct about the cause of the problem. I just download the xmlsitemap module into my .drush folder and, pang, I got the "undefined function variable_get()" (under Drupal 7 and an old Drush). I guess Drush is parsing the files in .drush folder before it bootstraps Drupal. – hansfn Nov 4 '16 at 9:56

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.