Answers.Body: <p>You can clear the caches by running <code>drush cc civicrm</code>, by removing everything inside the templates_c directory, and by running clear caches in CiviCRM > Administer > System Settings > Cleanup Caches and File Paths.</p>
  
  <p>In my experience, it's beneficial to run <code>drush cc civicrm</code> separately from <code>drush cc all</code>, which seems to clear only Drush and Drupal caches.</p>
  
  <p>There is a bug reported about <code>drush cc all</code> not clearing CiviCRM caches:
  <a href="https://issues.civicrm.org/jira/browse/CRM-19206" rel="nofollow noreferrer">https://issues.civicrm.org/jira/browse/CRM-19206</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-19T03:32:46.440Z
Answers.Text: I would expect `all` to include the CiviCRM cache, does it not? I remove files from `templates_c` manually and that works. I'm just confused by what is required to clear the container cache using drush, my expectation is that `drush cc all` should do it, but it doesn't seem to.
Answers.UserDisplayName: mickadoo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-19T03:34:35.163Z
Answers.Text: I think the issue is that it seems that you built something custom so you would need to add it to the drush script. I could be wrong, and if so, others will pipe in. Did you try `drush cc civicrm`?
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-20T14:47:06.880Z
Answers.Text: `drush cc civicrm` also seems to fix it. Does this mean that the civicrm cache is not cleared as part of `drush cc all`, even though it is listed when you just do `drush cc`?
Answers.UserDisplayName: mickadoo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-20T15:48:43.977Z
Answers.Text: Updated my answer.
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-28T14:54:17.247Z
Answers.Text: It seems like a bug that the civicrm cache is not fully cleared as part of `drush cc all`, especially since `civicrm` is listed as one of the cache options if you just do `drush cc`. I'll mark this as accepted, thanks.
Answers.UserDisplayName: mickadoo
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-28T19:22:14.373Z
Answers.Text: Yes, my answer noted that there is a bug report filed on this issue. I'm glad the work around helped. :)
Answers.UserDisplayName: Christia
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-17T22:29:56.560Z
Answers.LastActivityDate: 2017-11-20T15:48:03.230Z
Answers.LastEditDate: 2017-11-20T15:48:03.230Z
Answers.UserDisplayName: Christia
Body: <p>I like being able to use the DI container in my extensions via the container hook, however I've run into the same problem a few times when switching branches that I get this error:</p>
  
  <blockquote>
    <p>You have requested a non-existent service "myserviceid"</p>
  </blockquote>
  
  <p>After trying <code>drush cc all</code> I'd expect the container cache to be clearer, but it doesn't seem to be. My go-to option is to remove all files in the <code>sites/default/files/civicrm/templates_c/</code> directory, but this seems like it should be handled by the cache clear command.</p>
  
  <p>I'm aware there's an option to not use a container cache, but my question is whether the failure to clear the container cache is expected, or should it be fixed?</p>
  
Tags: <core>
Title: Is the container cache not cleared as part of `drush cc all`?
ThreadText: # Is the container cache not cleared as part of `drush cc all`?
  
  (Asked by: username_0 on 2017-11-15)
  
  I like being able to use the DI container in my extensions via the container hook, however I've run into the same problem a few times when switching branches that I get this error:
  
  > You have requested a non-existent service "myserviceid"
  
  After trying `drush cc all` I'd expect the container cache to be clearer, but it doesn't seem to be. My go-to option is to remove all files in the `sites/default/files/civicrm/templates_c/` directory, but this seems like it should be handled by the cache clear command.
  
  I'm aware there's an option to not use a container cache, but my question is whether the failure to clear the container cache is expected, or should it be fixed?
  
  **Tags:** core
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-11-17. Score: 1 | Accepted answer
  
  You can clear the caches by running `drush cc civicrm`, by removing everything inside the templates\_c directory, and by running clear caches in CiviCRM > Administer > System Settings > Cleanup Caches and File Paths.
  
  In my experience, it's beneficial to run `drush cc civicrm` separately from `drush cc all`, which seems to clear only Drush and Drupal caches.
  
  There is a bug reported about `drush cc all` not clearing CiviCRM caches:
  <https://issues.civicrm.org/jira/browse/CRM-19206>
  
  > **Comments:**
  > **username_0**: I would expect `all` to include the CiviCRM cache, does it not? I remove files from `templates_c` manually and that works. I'm just confused by what is required to clear the container cache using drush, my expectation is that `drush cc all` should do it, but it doesn't seem to.  
  > **username_1**: I think the issue is that it seems that you built something custom so you would need to add it to the drush script. I could be wrong, and if so, others will pipe in. Did you try `drush cc civicrm`?  
  > **username_0**: `drush cc civicrm` also seems to fix it. Does this mean that the civicrm cache is not cleared as part of `drush cc all`, even though it is listed when you just do `drush cc`?  
  > **username_1**: Updated my answer.  
  > **username_0**: It seems like a bug that the civicrm cache is not fully cleared as part of `drush cc all`, especially since `civicrm` is listed as one of the cache options if you just do `drush cc`. I'll mark this as accepted, thanks.  
  > **username_1**: Yes, my answer noted that there is a bug report filed on this issue. I'm glad the work around helped. :)  
  
  ---
  
  