I was wondering why "drush cc all" did not purge the site from Varnish. Then found "drush varnish-purge-all", and it did not do anything either. Both were just quietly failing.

The reason is that drush does not know your base_url and sets it to http://default if not spesified using --uri/-l, or $base_url is set in settings.php.

I don't know if this is obvious to every drush user, so it might be an idea to have varnish-purge-all warn the user if $base_url is set to http://default? And/or include this in the documentation.

Both of these work flawlessly:
drush cc all --uri=http://domain.tld
drush varnish-purge-all --uri=http://domain.tld

Atle

Comments

DamienMcKenna’s picture

Component: Documentation » Code
Category: Feature request » Bug report
Issue summary: View changes

In that case, it should fail if it cannot work out the correct hostname.

DamienMcKenna’s picture

Title: Documentation: drush requires --uri=domain.tld or $base_url set in settings.php » Drush should fail if hostname cannot be properly identified

Clarifying the title.

tahiche’s picture

So glad i found this post. This was a tricky one.
Varnish was being purged when clicking the "Clear Cache" button at /performance page but not through "drush cc all".
So the UI Cache Clear is probably using $base_url and Drush is trying to clear Varnish at http://default.
It should certainly display a warning.

MiSc’s picture

Status: Active » Closed (won't fix)

This should be solved by using a drush alias, closing this.