I recently upgraded from Symfony 6.2 to 6.3 on both my development and production servers, and everything went swimmingly up until the point that I needed to clear the cache on the product server, whereupon I received the following output.
$ php bin/console cache:clear --env=prod
// Clearing the cache for the prod environment with debug false
[2023-06-16T09:05:26.482252+00:00] deprecation.INFO: User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead at /var/www/stuffin.fairmont.local/vendor/symfony/doctrine-bridge/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php:109)"} []
[2023-06-16T09:05:28.157486+00:00] deprecation.INFO: User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since symfony/doctrine-bridge 6.3: Using Doctrine subscribers as services is deprecated, declare listeners instead at /var/www/stuffin.fairmont.local/vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php:195)"} []
[2023-06-16T09:05:28.191619+00:00] deprecation.INFO: User Deprecated: Doctrine\DBAL\Platforms\AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated. (AbstractPlatform.php:3945 called by ClassMetadataFactory.php:626, https://github.com/doctrine/dbal/pull/5513, package doctrine/dbal) {"exception":"[object] (ErrorException(code: 0): User Deprecated: Doctrine\\DBAL\\Platforms\\AbstractPlatform::usesSequenceEmulatedIdentityColumns is deprecated. (AbstractPlatform.php:3945 called by ClassMetadataFactory.php:626, https://github.com/doctrine/dbal/pull/5513, package doctrine/dbal) at /var/www/website.local/vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:209)"} []
[OK] Cache for the "prod" environment (debug=false) was successfully cleared.
This then makes the production server respond to all requests with a 500 Internal Server Error
, and the only way to fix it is to rm -rf /var/cache/prod/*
and clear the cache again.
I have gone through every single file in vendor/symfony/doctrine-bundle
, vendor/doctrine
folders, and removed any files that are no longer present on the development server (which went through the normal composer update
process), I also checked that all the new and updated files were present (which they are).
I'm not sure where to look next to fix this issue, I include my composer.json file below:
{
"type": "project",
"license": "proprietary",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"ext-ctype": "*",
"ext-iconv": "*",
"composer/package-versions-deprecated": "1.11.99.5",
"doctrine/annotations": "^2.0",
"doctrine/doctrine-bundle": "*",
"doctrine/doctrine-migrations-bundle": "*",
"doctrine/orm": "^2.15",
"phpdocumentor/reflection-docblock": "^5.2",
"stof/doctrine-extensions-bundle": "^1.5.0",
"symfony/asset": "6.3.*",
"symfony/console": "6.3.*",
"symfony/dotenv": "6.3.*",
"symfony/expression-language": "6.3.*",
"symfony/flex": "^2",
"symfony/form": "6.3.*",
"symfony/framework-bundle": "6.3.*",
"symfony/http-client": "6.3.*",
"symfony/intl": "6.3.*",
"symfony/mailer": "6.3.*",
"symfony/mime": "6.3.*",
"symfony/monolog-bundle": "^3.1",
"symfony/notifier": "6.3.*",
"symfony/password-hasher": "6.3.*",
"symfony/process": "6.3.*",
"symfony/property-access": "6.3.*",
"symfony/property-info": "6.3.*",
"symfony/proxy-manager-bridge": "6.3.*",
"symfony/runtime": "6.3.*",
"symfony/security-bundle": "6.3.*",
"symfony/serializer": "6.3.*",
"symfony/string": "6.3.*",
"symfony/translation": "6.3.*",
"symfony/twig-bundle": "6.3.*",
"symfony/validator": "6.3.*",
"symfony/web-link": "6.3.*",
"symfony/webpack-encore-bundle": "^1.12",
"symfony/yaml": "6.3.*",
"twig/extra-bundle": "^2.12|^3.0",
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.15.21",
"symfony/browser-kit": "6.3.*",
"symfony/css-selector": "6.3.*",
"symfony/debug-bundle": "6.3.*",
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^6.3",
"symfony/stopwatch": "6.3.*",
"symfony/var-dumper": "6.3.*",
"symfony/web-profiler-bundle": "6.3.*"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"sort-packages": true,
"allow-plugins": {
"symfony/flex": true,
"symfony/runtime": true
}
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"App\\Tests\\": "tests/"
}
},
"replace": {
"symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*"
},
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"post-install-cmd": [
"@auto-scripts"
],
"post-update-cmd": [
"@auto-scripts"
]
},
"conflict": {
"symfony/symfony": "*"
},
"extra": {
"symfony": {
"allow-contrib": false,
"require": "6.3.*"
}
}
}
Any advice will be greatly appreciated.