I installed cache warmer per the fairly straight forward instructions on the project page. I also created the hub pages text file in ~/.drush/ but am getting an error when trying to run the command...

drush cache-warmer --updated-last='-24 hours' --timeout=15 --hub-pages-file=~/.drush/hub_pages.txt http://www.example.tld

Cannot open hub pages file ~/.drush/hub_pages.txt.                    [error]
Cannot determine base URI to be crawled.                             [error]

PHP Fatal error:  Call to undefined function _drush_sql_get_db_spec() in /root/.drush/cache_warmer/cache_warmer.drush.inc on line 287

Drush command terminated abnormally due to an unrecoverable error.   [error]

Error: Call to undefined function _drush_sql_get_db_spec() in /root/.drush/cache_warmer/cache_warmer.drush.inc, line 287

I switched hubpages.txt to be owned by lighttpd (the web server and the php-fpm process owner) after receiving this error, assuming drush couldn't read it for whatever reason, and still get the same error.

I then tried moving the hub_pages.txt file to the local root folder of drupal where I am running the drush command.

drush cache-warmer --latest-n=3000 --hub-pages-file=./hub_pages.txt --timeout=30 http://www.example.tld

PHP Fatal error:  Call to undefined function _drush_sql_get_db_spec() in /root/.drush/cache_warmer/cache_warmer.drush.inc on line 287

Drush command terminated abnormally due to an unrecoverable error.  [error]

Error: Call to undefined function _drush_sql_get_db_spec() in /root/.drush/cache_warmer/cache_warmer.drush.inc, line 287

Am I missing something very obvious?

Comments

WebWalker3D’s picture

Update: It appears as though this issue is more specific to Drush versioning. Drush 6.x-stable and below use "_drush_sql_get_db_spec()" which was removed in Drush 7.x. Given that Drush 7.x is required for Drupal 8.x, I would recommend forward compatibility. I found https://www.drupal.org/node/2261469#comment-8757125 which suggests a patch for Drush 7.x but would break Drush 6.x and below. Is there perhaps some logic you could add to check the drush version and execute the proper function?

westwesterson’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB

Patch included.

KhaledBlah’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm the patch in #2 fixes this issue.

cola’s picture

I can also confirm the patch in #2 fixes this issue.

nicholasruunu’s picture

#2 works for me in Drush 8.0.2

delacosta456’s picture

hi

i can confirm too that #2 solve the issue for me .

Thanks

firewaller’s picture

#2 works for me as well.

andrew answer’s picture

I confirm what patch #2 is works.