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
Comment #1
WebWalker3D commentedUpdate: 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?
Comment #2
westwesterson commentedPatch included.
Comment #3
KhaledBlah commentedI can confirm the patch in #2 fixes this issue.
Comment #4
cola commentedI can also confirm the patch in #2 fixes this issue.
Comment #5
nicholasruunu commented#2 works for me in Drush 8.0.2
Comment #6
delacosta456 commentedhi
i can confirm too that #2 solve the issue for me .
Thanks
Comment #7
firewaller commented#2 works for me as well.
Comment #8
andrew answer commentedI confirm what patch #2 is works.