chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
788 stars 479 forks source link

Problème durant la phase d'installation composer update : "Trying to register two bundles with the same name "SonataExporterBundle"." #4908

Open jpgaulier opened 12 months ago

jpgaulier commented 12 months ago

Description du problème Problème durant l'installation de Chamilo 2 sur une installation fraîche de Debian 12.

Comment le reproduire Durant le composer installou composer update, le script s'arrête et retourne l'erreur suivante :

 - Configuring vich/uploader-bundle (>=1.13): From github.com/symfony/recipes-contrib:main
Executing script cache:clear [KO]
 [KO]
Script cache:clear returned with error code 1
!!
!!  In Kernel.php line 389:
!!
!!    Trying to register two bundles with the same name "SonataExporterBundle".
!!
!!
!!  2023-09-28T20:17:04+00:00 [info] User Deprecated: The Sonata\Exporter\Bridge\Symfony\SonataExporterSymfonyBundle class is deprecated since sonata-project/exporter 2.12, to be removed in version 3.0. Use Sonata\Exporter\Bridge\Symfony\SonataExporterBundle instead.
!!
Script @auto-scripts was called via post-update-cmd

Comportement attendu Finalisation de l'installation. On peut bypasser la partie script du composer.json en faisant un composer update --no-scripts ce qui permet de dépasser ce problème et de finaliser l'installation, mais le problème réapparaît alors sur l'interface web au moment de la finalisation de l'installation.

La partie du composer.json concernée :

   "scripts": {
        "auto-scripts": {
            "cache:clear": "symfony-cmd",
            "assets:install %PUBLIC_DIR%": "symfony-cmd",
            "requirements-checker": "script"
        },
        "post-install-cmd": [
            "@auto-scripts"
        ],
        "post-update-cmd": [
            "@auto-scripts"
        ],
        "pre-install-cmd": [
            "Chamilo\\CoreBundle\\Component\\Utils\\ScriptHandler::deleteOldFilesFrom19x"
        ],
        "pre-update-cmd": [
        ],
        "phpcs": "@php vendor/bin/ecs check --no-interaction",
        "psalm": "@php vendor/bin/psalm --show-info=false",
        "phpstan": "@php vendor/bin/phpstan analyse --no-interaction"
    }

Captures d'écran

Lors de l'installation web, si on a au préalable forcé l'installation composer avec l'option --no-scripts sur l'url : http://X.X.X.X/main/install/index.php?running=1&installType=new&updateFromConfigFile=0

image

**Serveur

ywarnier commented 11 months ago

Pour l'instant (et jusqu'à ce qu'on rentre en phase beta), Chamilo 2 a toujours des problèmes avec les versions de PHP différentes de 8.1. Te serait-il possible de tester avec 8.1 et de nous dire si ça règle le problème ? (attention à bien avoir 8.1 au niveau de php-cli pour le composer update).

alex00888 commented 10 months ago

I have the same problem with PHP 8.1

alex00888 commented 10 months ago

I found the reason. It's because I agreed to execute recipes when running composer install. It added the line Sonata\Exporter\Bridge\Symfony\SonataExporterBundle::class => ['all' => true], to config/bundles.php