I created a shopware 6 plugin but when activating it, it shows cannot delete /var/cache/h97xxxxxxxxxxxxxx/ directory not empty

projekte/treppe/var/cache/prod_hd174669f24b5b5032ac120086360367c/pools/ONphTzeVip/Q): Directory not empty"

after deleting this directory another one comes how to solve it??

That is a weird error. Before activating the plugin, I would try to clear the cache and then try it again. You can do that in the Administration, but perhaps it would be better to do this using the Command console. I have recently found out, that it actually makes a difference in some cases, especially regarding the output you get. I have an artcle here https://shopwarian.com/the-most-useful-commands-for-shopware-6-development/ on my blog, regarding using the console commands, so maybe you will find it useful. I think clearing the cache, using the command line, should solve your problem and if not, then you should probably check, what does your plugin actually do during activation.

1 Like

No idea where you development is taking place. A common problem I have once a while is that I logging on the server as root or doing a sudo then triggering a bin/console cache:clear when you after this run another shopware command the cache folder might get the wrong file system rights.

Take a look to the var/cache folder and check the filesystem acls or rights. also check the owner. So in case these are wrong go and correct them.


1 Like