---
title: "Drush cache clears can cause Cloud Hooks failure"
date: "2025-02-05T23:43:59+00:00"
summary:
image:
type: "article"
url: "/acquia-cloud-platform/help/93246-drush-cache-clears-can-cause-cloud-hooks-failure"
id: "2323ba12-cc4f-4375-8c45-27a2ad8a8ab1"
---

**Issue**
---------

When a cloud hook is running a `drush cr` while another job is executing a Drush command that is using Drush cache, an error can occur:

    Started drupal cache rebuild for *** [success]
    Cache rebuild complete. 
    
    In Filesystem.php line 181: Failed to remove directory "/home/***/.drush/cache/factory": rmdir(/home/****/.drush/cache/factory): Directory not empty

**Resolution**
--------------

The solution is to isolate the cache directory between processes using the `DRUSH_PATHS_CACHE_DIRECTORY` variable.