Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2677

Doctrine\Common\Annotations\Reader::getMethodAnnotations sometimes doesn't return an array

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Labels:
      None

      Activity

      Hide
      Christophe Coevoet added a comment -

      Are you using a cached annotation reader ? and if yes, which cache implementation is it ?

      Show
      Christophe Coevoet added a comment - Are you using a cached annotation reader ? and if yes, which cache implementation is it ?
      Hide
      Ángel Guzmán Maeso added a comment -

      Yes. I am using APC. In my config.yml for production:

      <pre>
      doctrine:
      orm:
      metadata_cache_driver: apc
      result_cache_driver: apc
      query_cache_driver: apc
      </pre>

      Show
      Ángel Guzmán Maeso added a comment - Yes. I am using APC. In my config.yml for production: <pre> doctrine: orm: metadata_cache_driver: apc result_cache_driver: apc query_cache_driver: apc </pre>
      Hide
      Christophe Coevoet added a comment -

      I'm not talking about your ORM cache but about the annotation reader cache (for Symfony, it is configured in FrameworkBundle, and it defaults to a FileCacheReader if you don't configure it explicitly)

      Show
      Christophe Coevoet added a comment - I'm not talking about your ORM cache but about the annotation reader cache (for Symfony, it is configured in FrameworkBundle, and it defaults to a FileCacheReader if you don't configure it explicitly)
      Hide
      Ángel Guzmán Maeso added a comment -

      Ok sorry. I am still very new with Symfony and Doctrine.

      This is the framework config:
      framework:
      translator:

      { fallback: en }

      secret: %secret%
      router:
      resource: "%kernel.root_dir%/config/routing.yml"
      form: true
      csrf_protection: true
      validation:

      { enable_annotations: true }

      templating:
      engines: ['twig']
      assets_version: v1.0
      default_locale: %locale%
      trusted_proxies: ~
      session: ~

      So it should be FileCacheReader as default config.

      PS: I found this that could be related http://stackoverflow.com/questions/14070492/doctrine-annotations-filecachereader-php-invalid-argument

      Show
      Ángel Guzmán Maeso added a comment - Ok sorry. I am still very new with Symfony and Doctrine. This is the framework config: framework: translator: { fallback: en } secret: %secret% router: resource: "%kernel.root_dir%/config/routing.yml" form: true csrf_protection: true validation: { enable_annotations: true } templating: engines: ['twig'] assets_version: v1.0 default_locale: %locale% trusted_proxies: ~ session: ~ So it should be FileCacheReader as default config. PS: I found this that could be related http://stackoverflow.com/questions/14070492/doctrine-annotations-filecachereader-php-invalid-argument
      Hide
      Jonathan Ingram added a comment -

      I've noticed this issue since upgrading two things (not sure if either or both are relevant):

      1. PHP 5.3 --> 5.5.7
      2. Changed to memcached instead of apc for the 3 doctrine ORM cache drivers (note: I haven't touched the framework:annotations:cache configuration so it's the default "file")

      I've tried to debug it but no luck figuring out what's going on. As far as I can see, the result is actually an empty array so I am not sure why PHP complains. Makes me wonder if it's a PHP 5.5 bug.

      Show
      Jonathan Ingram added a comment - I've noticed this issue since upgrading two things (not sure if either or both are relevant): 1. PHP 5.3 --> 5.5.7 2. Changed to memcached instead of apc for the 3 doctrine ORM cache drivers (note: I haven't touched the framework:annotations:cache configuration so it's the default "file") I've tried to debug it but no luck figuring out what's going on. As far as I can see, the result is actually an empty array so I am not sure why PHP complains. Makes me wonder if it's a PHP 5.5 bug.
      Hide
      Marco Pivetta added a comment -

      Jonathan Ingram can we reduce the scope of the problem? Try using an array cache to remove any caching/serialization related issues.

      Show
      Marco Pivetta added a comment - Jonathan Ingram can we reduce the scope of the problem? Try using an array cache to remove any caching/serialization related issues.

        People

        • Assignee:
          Benjamin Eberlei
          Reporter:
          Ángel Guzmán Maeso
        • Votes:
          1 Vote for this issue
          Watchers:
          4 Start watching this issue

          Dates

          • Created:
            Updated: