doctrine/DoctrineMongoDBBundle

PHP 8 | CommandSubscriber not found

thedomeffm opened this issue · 6 comments

I installed the MongoODM Bundle with flex => https://www.doctrine-project.org/projects/doctrine-mongodb-bundle/en/4.3/installation.html#install-the-bundle-with-symfony-flex

ReflectionException:
Class "MongoDB\Driver\Monitoring\CommandSubscriber" not found while loading "Doctrine\Bundle\MongoDBBundle\APM\PSRCommandLogger".

PHP 8.0.9
pecl mongodb 1.10.0

"require": {
        "php": ">=8.0.0",
        "ext-ctype": "*",
        "ext-iconv": "*",
        "ext-mongodb": "^1.5",
        "composer/package-versions-deprecated": "1.11.99.2",
        "firebase/php-jwt": "^5.4",
        "jms/serializer-bundle": "^3.10",
        "knpuniversity/oauth2-client-bundle": "^2.8",
        "league/oauth2-google": "^4.0",
        "phpdocumentor/reflection-docblock": "^5.2",
        "sensio/framework-extra-bundle": "^6.1",
        "symfony/asset": "5.3.*",
        "symfony/console": "5.3.*",
        "symfony/dotenv": "5.3.*",
        "symfony/expression-language": "5.3.*",
        "symfony/flex": "^1.3.1",
        "symfony/form": "5.3.*",
        "symfony/framework-bundle": "5.3.*",
        "symfony/http-client": "5.3.*",
        "symfony/intl": "5.3.*",
        "symfony/mailer": "5.3.*",
        "symfony/mime": "5.3.*",
        "symfony/monolog-bundle": "^3.1",
        "symfony/notifier": "5.3.*",
        "symfony/process": "5.3.*",
        "symfony/property-access": "5.3.*",
        "symfony/property-info": "5.3.*",
        "symfony/proxy-manager-bridge": "5.3.*",
        "symfony/runtime": "5.3.*",
        "symfony/security-bundle": "5.3.*",
        "symfony/serializer": "5.3.*",
        "symfony/string": "5.3.*",
        "symfony/translation": "5.3.*",
        "symfony/twig-bundle": "^5.3",
        "symfony/uid": "5.3.*",
        "symfony/validator": "5.3.*",
        "symfony/web-link": "5.3.*",
        "symfony/yaml": "5.3.*",
        "twig/extra-bundle": "^2.12|^3.0",
        "twig/twig": "^2.12|^3.0"
    },

Hi @thedomeffm! The error you're facing is not a bug in the bundle but seems like a misconfiguration on your end, therefore please seek help either on our Slack or on StackOverflow under doctrine-odm tag.

From the top of my head it seems you have ext-mongodb enabled in CLI as composer allowed you to install the bundle, maybe it's not enabled for fpm (or any thing you use for web)?

Hey @thedomeffm,
I'm having the same problem, have you found a solution ?

@atouzard
i am not sure why it works now, i have loaded an older version of pecl in any case. now it works

I forgot to restart php_fpm after the pecl upgrade. Make sure to restart php if you're using fpm and pecl modules.

This problem still exists by the way...

This problem still exists by the way...

I had the same issue and restarting the symfony server fixed it