1

There are times when I run drush cc css-js and I get the following error:

'css-js' cache is not a valid cache type

Does anyone know why this may happen?

Thanks,

3
  • 1
    You're probably running it outside of a Drupal root, and without specifying a @site to run it on. So Drush tries to clear its internal cache, in which there's no 'css-js' type. To test: cd /path/to/drupal/root; drush cc css-js; cd ..; drush cc css-js. The first cc call should work, but not the second
    – Clive
    Commented Mar 27, 2013 at 16:47
  • Clive's answer above is correct. I added an issue to the Drush queue for this: drupal.org/node/1954552 Commented Mar 27, 2013 at 17:16
  • 1
    Please provide more information here. What is the output of drush status, and what happens when you run with --debug? Commented Apr 4, 2013 at 15:21

1 Answer 1

1

The latest dev releases of Drush (both 8.x-6.x and 7.x-5.x) now provide a better error message when attempting to select a specific cache type (e.g. css-js) without first selecting a working Drupal site. c.f. http://drupal.org/node/1954552

Note also that when selecting a Drupal site, cd /path/to/drupal/root only works if settings.php is stored in a directory called "default". Otherwise, you will need to instead cd /path/to/drupal/root/sites/mysite.com before using drush cc css-js. You can also use the --root and --uri parameters, e.g. drush --root=/path/to/drupal/root --uri=http://mysite.com cc css-js

1
  • Thank you for your answer. I took another look at my alias for clearing the cache and I am passing the root. drush -r /srv/examplesite/htdocs/ cc css-js and my settings.php file is in the default folder. Commented Apr 3, 2013 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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