cubicweb #14803503 OSError: [Errno 13] Permission denied: '/usr/local/var/lib/cubicweb/instances/app/uicache/cubes.pnia_home.cssj9rqq_' [open]

When running a cubicweb application as user cubicweb, if one does a ccplugin command as root the ownership of the uicache and uicachehttps get changed

# ls -alh /usr/local/var/lib/cubicweb/instances/app/
drwxr-sr-x 10 cubicweb cubicweb  12K Aug 11 14:10 data
drwxr-sr-x  5 cubicweb cubicweb 4.0K Aug 11 14:43 uicache
drwxr-sr-x  2 cubicweb cubicweb 4.0K Aug 11 14:10 uicachehttps


# ls -alh /usr/local/var/lib/cubicweb/instances/app/
drwxr-sr-x 10 cubicweb cubicweb  12K Aug 11 14:10 data
drwxr-sr-x  5 root     root     4.0K Aug 11 14:43 uicache
drwxr-sr-x  2 root     root     4.0K Aug 11 14:10 uicachehttps

We then get no more css and traceback

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pyramid_debugtoolbar/toolbar.py", line 215, in toolbar_tween
  response = _handler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid_debugtoolbar/panels/performance.py", line 57, in resource_timer_handler
  result = handler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid/tweens.py", line 62, in excview_tween
  reraise(*attrs['exc_info'])
File "/usr/local/lib/python2.7/dist-packages/pyramid/tweens.py", line 22, in excview_tween
  response = handler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid_cubicweb/bwcompat.py", line 176, in __call__
  response = self.cwhandler(request)
File "/usr/local/lib/python2.7/dist-packages/pyramid_cubicweb/bwcompat.py", line 78, in __call__
  content = controller.publish(rset=rset)
File "/usr/local/lib/python2.7/dist-packages/cubicweb/web/views/staticcontrollers.py", line 213, in publish
  dirpath, rid = config.locate_resource(relpath)
File "/usr/local/lib/python2.7/dist-packages/cubicweb/web/webconfig.py", line 331, in locate_resource
  return self._fs_locate(rid, 'data')
File "/usr/local/lib/python2.7/dist-packages/cubicweb/web/webconfig.py", line 360, in _fs_locate
  join(directory, rdirectory), rid)), rid
File "/usr/local/lib/python2.7/dist-packages/cubicweb/web/propertysheet.py", line 107, in process_resource
  tmpfd, tmpfile = tempfile.mkstemp(dir=rcachedir, prefix=osp.basename(cachefile))
File "/usr/lib/python2.7/tempfile.py", line 308, in mkstemp
  return _mkstemp_inner(dir, prefix, suffix, flags)
File "/usr/lib/python2.7/tempfile.py", line 239, in _mkstemp_inner
  fd = _os.open(file, flags, 0600)
OSError: [Errno 13] Permission denied: '/usr/local/var/lib/cubicweb/instances/app/uicache/cubes.pnia_home.cssj9rqq_'

# cubicweb-ctl version 3.22.4

prioritynormal
typebug
done in<not specified>
closed by<not specified>