Closed sebbm closed 2 years ago
sorry for the late response, did you fix this in the meantime? Please try to manually update the manager (upload the latest version) to make sure no file corruption is the problem.
Hi Andreas, thank you for your response. No i was not able to solve the issue by now. i've tried to replace the manager file on the server but still the same issue.
The issue seems to be somehow related to erdmannfreunde/optimist-theme-bundle
- at least according to the other reports in the community. @sebbm do you have that package as well?
@fritzmg: Yes, you're right i'm using this optimist-theme
The workaround would be to remove the package, update, then add the package again. However, @denniserdmann may be you can investigate this issue?
We'll have a look at it.
I did investigate but am unable to explain how this issue can be related to https://github.com/erdmannfreunde/optimist-theme-bundle in any way? There is no reference to those methods at all. Does someone have a guess?
As discussed on slack, i think the problem is, that updating optimist means uploading the package AND press update contao, as update all packages is canceled. But updating only selected packages results in a command like this: composer require contao/manager-bundle=4.13.* … --no-update
So symfony and all the other packages are not updated because of --no-update
. Result: you have a contao 4.13 installation that expects newer versions of packages that were not installed.
Update: I made some more tests and think Contao Manager itself is the problem.
php web/contao-manager.phar.php composer remove erdmannfreunde/optimist-theme-bundle
--> same errorphp composer.php remove erdmannfreunde/optimist-theme-bundle
it's working.I have ideas how this is happening, but not why. The Contao Manager ships with Symfony 4.4, which includes the ParameterBag
class. This class is likely different from what is installed in the vendor folder (which for Contao 4.13 is Symfony 5.4). Somehow the InputBag
class from vendor/symfony...
is used while the composer plugin is executed. I can't see how this is related to erdmannfreunde/optimist-theme-bundle
since its composer plugin does not use that class. But it sure is related to mixing two different Symfony versions. And probably not much the Contao Manager can do 😞
@denniserdmann what is this for: https://github.com/erdmannfreunde/optimist-theme-bundle/blob/c5de0079226964240634e97eecf26a4ccf31abb4/src/Composer/Plugin.php#L57-L60 ?
I have ideas how this is happening, but not why. The Contao Manager ships with Symfony 4.4, which includes the
ParameterBag
class. This class is likely different from what is installed in the vendor folder (which for Contao 4.13 is Symfony 5.4). Somehow theInputBag
class fromvendor/symfony...
is used while the composer plugin is executed. I can't see how this is related toerdmannfreunde/optimist-theme-bundle
since its composer plugin does not use that class. But it sure is related to mixing two different Symfony versions. And probably not much the Contao Manager can do 😞
Sounds like contao/contao#2183...
Sounds like contao/contao#2183...
There it's clear, because the Script Handler directly uses Symfony Process, which Composer has its own version of. But here it is not (yet) clear, as the plugin does not use InputBag directly. Without having tested this in depth my guess is the usage of the Symfony VarDumper within the plugin - because the VarDumper uses Symfony HttpFoundation components.
I think @denniserdmann should remove the VarDumper output as this should not be done for any production code anyway.
Sounds like contao/contao#2183...
There it's clear, because the Script Handler directly uses Symfony Process, which Composer has its own version of. But here it is not (yet) clear, as the plugin does not use InputBag directly. Without having tested this in depth my guess is the usage of the Symfony VarDumper within the plugin - because the VarDumper uses Symfony HttpFoundation components.
I think @denniserdmann should remove the VarDumper output as this should not be done for any production code anyway.
That's a good guess. However the dd
was introduced recently by accident, thus this wont be the culprit (as it was introduced after the issue occurred). Since the issue occurs very occasional, Dennis and I will investigate an affected Contao installation to reproduce this issue.
After several tests, we come to the following conclusion:
< 5.4
. Contao 4.13 uses symfony >=5.4
and Contao 4.9 and 4.10 use symfony 4.4
. composer.json
, adding the following lines before the last closing brace:
"config": {
"allow-plugins": {
"contao-components/installer": true,
"contao/manager-plugin": true,
"contao-community-alliance/composer-plugin": true,
"erdmannfreunde/optimist-theme-bundle": false
}
}
Thanks a lot @denniserdmann . I was stuck for hours on this bug, chasing for coincident PHP executable path errors (PhpExecutableFinder.php) and Google did me led to here.
Don't forget to add a ,
right before the code from Dennis, otherwise you get an JSON parse error.
Like:
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
]
}, <----------- ### THERE ###
"config": {
"allow-plugins": {
Keywords: Contao Install Manager 1.5.5 Compile Error Declaration Input Bag
Thank you too. I was also able to solve my issue and will close it.
Hi everybody, i've used contao-manager to update to version 1.5.2 of contao-manager. Since this update during system check of the contao-manager in the step the "Compeser Environment" ther comes following error message:
Error 500: Compile Error: Declaration of Symfony\Component\HttpFoundation\InputBag::get(string $key, $default = null) must be compatible with Symfony\Component\HttpFoundation\ParameterBag::get($key, $default = null)
The Apache log says: GET /contao-manager.phar.php/api/server/composer HTTP/1.0
Contao manager log-file: [25-Mar-2022 18:46:52 UTC] [2022-03-25 18:46:52] app.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Compile Error: Declaration of Symfony\Component\HttpFoundation\InputBag::get(string $key, $default = null) must be compatible with Symfony\Component\HttpFoundation\ParameterBag::get($key, $default = null)" at /var/www/vhosts/ABC.de/httpdocs/ABC/vendor/symfony/http-foundation/InputBag.php line 30 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Compile Error: Declaration of Symfony\Component\HttpFoundation\InputBag::get(string $key, $default = null) must be compatible with Symfony\Component\HttpFoundation\ParameterBag::get($key, $default = null) at /var/www/vhosts/ABC.de/httpdocs/ABC/vendor/symfony/http-foundation/InputBag.php:30)"} []
Is this an known issue ? The site itself and also the backend are OK but everytime i want to start contao-manager i get the same issue