extra-php-extensions icon indicating copy to clipboard operation
extra-php-extensions copied to clipboard

Call to a member function removeQueryCacheProfile() on null

Open pesseyjulien opened this issue 2 years ago • 5 comments

Hi,

After upgrading to 1.1.1 (because now using bref v2), I'm getting the following error :

Error: Call to a member function removeQueryCacheProfile() on null
#38 /vendor/doctrine/orm/lib/Doctrine/ORM/Query.php(291): Doctrine\ORM\Query::_doExecute
#37 /vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(1212): Doctrine\ORM\AbstractQuery::executeIgnoreQueryCache
#36 /vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(1166): Doctrine\ORM\AbstractQuery::execute
#35 /vendor/doctrine/orm/lib/Doctrine/ORM/AbstractQuery.php(913): Doctrine\ORM\AbstractQuery::getArrayResult
#34 /vendor/gedmo/doctrine-extensions/src/Translatable/Mapping/Event/Adapter/ORM.php(96): Gedmo\Translatable\Mapping\Event\Adapter\ORM::loadTranslations
#33 /vendor/gedmo/doctrine-extensions/src/Translatable/TranslatableListener.php(511): Gedmo\Translatable\TranslatableListener::postLoad
#32 /vendor/symfony/doctrine-bridge/ContainerAwareEventManager.php(68): Symfony\Bridge\Doctrine\ContainerAwareEventManager::dispatchEvent
#31 /vendor/doctrine/orm/lib/Doctrine/ORM/Event/ListenersInvoker.php(98): Doctrine\ORM\Event\ListenersInvoker::invoke
#30 /vendor/doctrine/orm/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php(66): Doctrine\ORM\Internal\HydrationCompleteHandler::hydrationComplete
#29 /vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(3677): Doctrine\ORM\UnitOfWork::hydrationComplete
#28 /vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php(54): Doctrine\ORM\Internal\Hydration\SimpleObjectHydrator::cleanup
#27 /vendor/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php(272): Doctrine\ORM\Internal\Hydration\AbstractHydrator::hydrateAll
#26 /vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(760): Doctrine\ORM\Persisters\Entity\BasicEntityPersister::load
#25 /vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php(770): Doctrine\ORM\Persisters\Entity\BasicEntityPersister::loadById
#24 /vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php(207): Doctrine\ORM\Proxy\ProxyFactory::Doctrine\ORM\Proxy\{closure}
#23 /tmp/cache/prod/doctrine/orm/Proxies/__CG__AppBundleEntitySkill.php(329): Closure::__invoke
#22 /tmp/cache/prod/doctrine/orm/Proxies/__CG__AppBundleEntitySkill.php(329): Proxies\__CG__\AppBundle\Entity\Skill::getLabel
#21 /vendor/symfony/property-access/PropertyAccessor.php(468): Symfony\Component\PropertyAccess\PropertyAccessor::readProperty
#20 /vendor/symfony/property-access/PropertyAccessor.php(154): Symfony\Component\PropertyAccess\PropertyAccessor::getValue
#19 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(161): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformObjectToDocument
#18 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(104): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformNested
#17 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(170): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformObjectToDocument
#16 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(96): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformNested
#15 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(170): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformObjectToDocument
#14 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(96): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformNested
#13 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(170): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transformObjectToDocument
#12 /vendor/friendsofsymfony/elastica-bundle/src/Transformer/ModelToElasticaAutoTransformer.php(79): FOS\ElasticaBundle\Transformer\ModelToElasticaAutoTransformer::transform
#11 /vendor/friendsofsymfony/elastica-bundle/src/Persister/ObjectPersister.php(190): FOS\ElasticaBundle\Persister\ObjectPersister::transformToElasticaDocument
#10 /vendor/friendsofsymfony/elastica-bundle/src/Persister/ObjectPersister.php(145): FOS\ElasticaBundle\Persister\ObjectPersister::replaceMany
#9 /src/Command/System/UpdateEsCommand.php(74): AppBundle\Command\System\UpdateEsCommand::execute
#8 /vendor/symfony/console/Command/Command.php(298): Symfony\Component\Console\Command\Command::run
#7 /vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Application::doRunCommand
#6 /vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Bundle\FrameworkBundle\Console\Application::doRunCommand
#5 /vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application::doRun
#4 /vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Bundle\FrameworkBundle\Console\Application::doRun
#3 /vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application::run
#2 /vendor/symfony/runtime/Runner/Symfony/ConsoleApplicationRunner.php(54): Symfony\Component\Runtime\Runner\Symfony\ConsoleApplicationRunner::run
#1 /vendor/autoload_runtime.php(35): require_once
#0 /bin/console(12): null

Orm config :

    orm:
        auto_generate_proxy_classes: true
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
#        metadata_cache_driver:
#            type: pool
#            pool: doctrine.system_cache_pool
        query_cache_driver:
            type: pool
            pool: doctrine.system_cache_pool
        result_cache_driver:
            type: pool
            pool: doctrine.result_cache_pool
        second_level_cache:
            enabled: '%env(bool:resolve:CACHE_ENABLED)%'
            region_cache_driver:
                type: pool
                pool: doctrine.second_level_cache_pool
framework:
    cache:
        prefix_seed: "likeo.fr"
        app: cache.adapter.redis
        default_redis_provider: snc_redis.redis_client
        pools:
            doctrine.metadata_cache_driver:
                adapter: cache.app
            doctrine.result_cache_pool:
                adapter: cache.app
            doctrine.system_cache_pool:
                adapter: cache.app
            doctrine.second_level_cache_pool:
                adapter: cache.app
            cache.api_rate_limit:
                adapter: cache.adapter.redis
                provider: snc_redis.redis_client

Any idea why ?

Thanks in advance,

pesseyjulien avatar May 05 '23 08:05 pesseyjulien

If I comment the 'query_cache_driver' param -> it works.

pesseyjulien avatar May 05 '23 08:05 pesseyjulien

Hi @pesseyjulien, any reason to think that this is related to this repository? I'm not familiar with this method, so not sure where to go from there.

mnapoli avatar May 05 '23 08:05 mnapoli

Yeah, sorry I forgot to mention it works locally and on a server but does not work on my lambda :

functions:
    # This function let us run console commands in Lambda
    console:
        handler: bin/console
        role: arn:aws:iam::xxxx:role/lambda
        vpc:
            securityGroupIds:
              - sg-xx
            subnetIds:
              - subnet-xxx
              - subnet-xxx
        timeout: 900 # in seconds
        reservedConcurrency: 1 # max. processed in parallel
        memorySize: 1024
        #architecture: arm64
        layers:
            - ${bref:layer.php-82}
            - ${bref-extra:redis-php-82}
            - ${bref:layer.console}
            - 'arn:aws:lambda:eu-west-3:347599033421:layer:wkhtmltopdf-0_12_6:1'
            - 'arn:aws:lambda:eu-west-3:347599033421:layer:amazon_linux_fonts:1'

Thanks, Julien

pesseyjulien avatar May 05 '23 08:05 pesseyjulien

Do you get any other log or warning before the error?

mnapoli avatar May 05 '23 12:05 mnapoli

Nop, I have sent the full error stack trace.

pesseyjulien avatar May 05 '23 12:05 pesseyjulien