Can not open some folders in admin: "Cannot bind closure to scope of internal class ReflectionProperty"

setup

Pimcore: 6.8.4
CoreShop: 2.2.6

local development with docker-compose:

version: '2.0'
services:
    redis:
    image: redis:alpine
    container_name: pimcore-redis

  db:
    image: mariadb:10.1
    container_name: pimcore-mariadb
    working_dir: /application
    command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-format=Barracuda, --innodb-large-prefix=1, --innodb-file-per-table=1]
    volumes:
      - pimcore-database:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=ROOT
      - MYSQL_DATABASE=pimcore
      - MYSQL_USER=pimcore
      - MYSQL_PASSWORD=pimcore
    ports:
      - 2003:3306

  php:
    image: pimcore/pimcore:PHP7.2-apache
    container_name: pimcore-php
    volumes:
      - .:/var/www/html:cached
    ports:
     - "2000:80"
     - "2001:443"
    links:
     - db:db
     - redis:redis

  php-debug:
    image: pimcore/pimcore:PHP7.2-apache-debug
    container_name: pimcore-debug-php
    volumes:
      - .:/var/www/html:cached
    ports:
     - "2006:80"
    links:
     - db:db
     - redis:redis
    environment:
      - PHP_IDE_CONFIG="serverName=localhost"

volumes:
  pimcore-database:

issue

When clicking on the plus sign in front of a folder containing objects of class CoreShopCategory it spins forever loading.

Bildschirmfoto 2020-11-03 um 17.20.18

In fact an error occurs on the request making the response an invalid JSON string:
http://localhost:2000/admin/object/tree-get-childs-by-id?_dc=1604420074777&limit=30&view=&fromPaging=0&start=0&node=102

Response is:

{"offset":0,"limit":30,"total":"3","overflow":false,"nodes":[{"id":5534,"idx":1,"key":"consumables","sortBy":"key","sortOrder":"ASC","text":"consumables","type":"object","path":"\/cab\/categories\/consumables","basePath":"\/cab\/categories\/","elementType":"object","locked":false,"lockOwner":false,"isTarget":true,"allowDrop":true,"allowChildren":true,"leaf":false,"cls":"pimcore_class_icon  ","published":true,"className":"CoreShopCategory","allowVariants":null,"icon":null,"iconCls":"pimcore_icon_object","qtipCfg":{"title":"ID: 5534","text":"Type: CoreShopCategory"},"expanded":false,"permissions":{"save":true,"unpublish":true,"lEdit":true,"lView":true,"layouts":true,"list":true,"view":true,"publish":true,"delete":true,"rename":true,"create":true,"settings":true,"versions":true,"properties":true}},{"id":141,"idx":3,"key":"printers","sortBy":"key","sortOrder":"ASC","text":"printers","type":"object","path":"\/cab\/categories\/printers","basePath":"\/cab\/categories\/","elementType":"object","locked":false,"lockOwner":false,"isTarget":true,"allowDrop":true,"allowChildren":true,"leaf":false,"cls":"pimcore_class_icon  ","published":true,"className":"CoreShopCategory","allowVariants":null,"icon":null,"iconCls":"pimcore_icon_object","qtipCfg":{"title":"ID: 141","text":"Type: CoreShopCategory"},"expanded":true,"permissions":{"save":true,"unpublish":true,"lEdit":true,"lView":true,"layouts":true,"list":true,"view":true,"publish":true,"delete":true,"rename":true,"create":true,"settings":true,"versions":true,"properties":true},"expandable":false,"loaded":true},{"id":5490,"idx":2,"key":"spareparts","sortBy":"index","sortOrder":"ASC","text":"spareparts","type":"object","path":"\/cab\/categories\/spareparts","basePath":"\/cab\/categories\/","elementType":"object","locked":false,"lockOwner":false,"isTarget":true,"allowDrop":true,"allowChildren":true,"leaf":false,"cls":"pimcore_class_icon  ","published":true,"className":"CoreShopCategory","allowVariants":null,"icon":null,"iconCls":"pimcore_icon_object","qtipCfg":{"title":"ID: 5490","text":"Type: CoreShopCategory"},"expanded":false,"permissions":{"save":true,"unpublish":true,"lEdit":true,"lView":true,"layouts":true,"list":true,"view":true,"publish":true,"delete":true,"rename":true,"create":true,"settings":true,"versions":true,"properties":true}}],"fromPaging":0,"filter":"","inSearch":0}<br />
<b>Fatal error</b>:  Uncaught ErrorException: Warning: Cannot bind closure to scope of internal class ReflectionProperty in /var/www/html/var/cache/dev/ContainerHQx3b31/EntityManager_9a5be93.php:377
Stack trace:
#0 [internal function]: EntityManager_9a5be93-&gt;__get('config')
#1 /var/www/html/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php(249): ReflectionProperty-&gt;getValue(Object(EntityManager_9a5be93))
#2 /var/www/html/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php(208): DeepCopy\DeepCopy-&gt;copyObjectProperty(Object(EntityManager_9a5be93), Object(ReflectionProperty))
#3 /var/www/html/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php(144): DeepCopy\DeepCopy-&gt;copyObject(Object(EntityManager_9a5be93))
#4 /var/www/html/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php(252): DeepCopy\DeepCopy-&gt;recursiveCopy(Object(EntityManager_9a5be93))
#5 /var/www/html/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php(208): DeepCopy\DeepCopy-&gt;copyObjectProperty(Object(CoreShop\Bundle\StoreBundle\Doctrine\ORM\StoreRepository), Object(Reflect in <b>/var/www/html/var/cache/dev/ContainerHQx3b31/EntityManager_9a5be93.php</b> on line <b>377</b><br />

As you see the JSON is valid but gets an error message appended. I think(!) it happens when caching the result.

I already tried:

bin/console cache:clear
docker exec -it pimcore-redis redis-cli FLUSHALL
… and clearing the cache within admin via: settings -> cache -> clear cache -> all caches (symfony + data)

This issue occured after upgrading from coreshop 2.2.0-RC.1 and pimcore 6.5.3 - the migrations ran fine as far as I can tell.

Any hints what could cause this error are much appreciated! :slight_smile:

Solved by resaving all class definitions in pimcore admin