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/cpresourcesCraft::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.
./craft clear-caches/all commandThat鈥檚 because @webroot is only reliable on web requests. To fix, update your resourceBasePath config setting to a real path:
'resourceBasePath' => dirname(__DIR__) . '/web/cpresources';
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',
],
Most helpful comment
As of the next release, the
clear-cachesconsole command will clear CP resources if the@webrootwas custom-defined by the aliases config setting as well.