Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to clear Control Panel resources using ./craft clear-caches/all #3787

romainpoirier opened this issue Feb 5, 2019 · 2 comments


None yet
2 participants
Copy link

commented Feb 5, 2019


I'm trying to use the ./craft clear-caches/all CLI command.

Everything is working fine, except that I always get this error:

Error clearing cache Control Panel resources: Unable to clear Control Panel resources because the location isn't known for console commands.

My configuration returns these values:

  • Craft::$app->getConfig()->getGeneral()->resourceBasePath -> @webroot/cpresources
  • Craft::getAlias('@webroot') -> return correct value (using /htdocs as root folder)

I tried on another Craft 3.1 website, and got the same error. So perhaps it is a bug.

Steps to reproduce

  1. Use the ./craft clear-caches/all command

Additional info

  • Craft version: 3.1.8
  • PHP version: 7.1.8
  • Database driver & version: PostgreSQL 9.6.9

This comment has been minimized.

Copy link

commented Feb 6, 2019

That’s because @webroot is only reliable on web requests. To fix, update your resourceBasePath config setting to a real path:

'resourceBasePath' => dirname(__DIR__) . '/web/cpresources';

brandonkelly added a commit that referenced this issue Feb 12, 2019


This comment has been minimized.

Copy link

commented Feb 12, 2019

As of the next release, the clear-caches console command will clear CP resources if the @webroot was custom-defined by the aliases config setting as well.

'aliases' => [
    '@webroot' => dirname(__DIR__) . '/web',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.