Open MatthiasKuehneEllerhold opened 1 year ago
Deleting all #[ORM\Cache(...)]
attributes fixes the problem but disables the 2nd level cache completely.
To reproduce, we need the code that leads to the exception being thrown.
Also, can you narrow the range of ORM versions where the break happens? Did it break between 2.13.5 and 2.14.0?
Yes it breaks by upgrading from 2.13.5 to 2.14.0.
Ive hoped that the code of the two entities would be enough, but Ill try to provide a complete reproducer.
I was finally able to reproduce the issue with a severly cut down version of my project. You can find it here: https://github.com/MatthiasKuehneEllerhold/DoctrineOrm10905
The problem is this (as far as I understand it):
Ive got Entity Product
and Machine
. These are my 2 base entities. Then Ive got 2 relationship entities:
ProductMachine
connects a product to a machine, has 2 FK (as PK) to Product
and Machine
ProductDefaultMachine
defines which machine is the default for a specific location. Its PK is a string-field (location
) and an FK to product
. The other FK is to a ProductMachine
. I'm using the field product
on product_default_machine
for BOTH FKs (to Product
and to ProductMachine
). In branch possible-fix
Ive added another field namend product2
- same problems.
Hopefully you can use this reproducer.
Any news? Any way I can help?
Still happening with
# composer show | grep doctrine
beberlei/doctrineextensions v1.5.0 A set of extensions to Doctrine 2 that add support for additional query functions available in MySQL, Oracle, PostgreSQL and SQLite.
doctrine/annotations 2.0.1 Docblock Annotations Parser
doctrine/cache 2.2.0 PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.
doctrine/collections 2.2.2 PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.
doctrine/common 3.4.4 PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, proxies and much more.
doctrine/dbal 3.8.6 Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/deprecations 1.1.3 A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.
doctrine/doctrine-laminas-hydrator 3.4.0 Doctrine hydrators for Laminas applications
doctrine/doctrine-module 6.1.1 Laminas Module that provides Doctrine basic functionality required for ORM and ODM modules
doctrine/doctrine-orm-module 6.1.0 Laminas Module that provides Doctrine ORM functionality
doctrine/event-manager 1.2.0 The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.
doctrine/inflector 2.0.10 PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.
doctrine/instantiator 2.0.0 A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer 3.0.1 PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
doctrine/migrations 3.8.0 PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use a...
doctrine/orm 2.19.6 Object-Relational-Mapper for PHP
doctrine/persistence 3.3.3 The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.
BC Break Report
We're using laminas/mvc with the these packages:
Ive just upgraded the doctrine packages:
After this upgrade every page that uses entities in the second level cache are throwing 500, its these errors:
We are using redis as a backend for this cache
Summary
2nd Level caching of entities does not work anymore and leads to error 500.
Previous behavior
Marked entities can be cached and the page is shown correctly.
Current behavior
The error above is logged to the error log and a 500 is displayed.
How to reproduce