Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-29619

StashPass should check if config[caches] is set

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.4.12, 1.7.8, 1.13.4
    • Fix Version/s: Customer request
    • Component/s: None
    • Labels:
    • Environment:

      php-fpm 5.6
      nginx nginx/1.10.2
      mysql 5.5
      centos 6

      Description

      I just updated ez Publish using composer and a critical error appeared

      The error is on like 30 of StashPass.php
      Missing 'caches'

      History ...
      There has been a long time bug with EE where the config.yml does not allow overriding settings from any ezpublish.yml or ezpublish_*.yml stash.caches.default values. it only APPENDS and basically does nothing.
      The documentation is either completely false or incomplete on how to configure ONLY memcache on production.

      Previously, I did many many tests proving that no matter what, config.yml's stash.caches.driver -FileSystem is always used. So I comment out the config.yml stash.caches and this allows ezpublish_prod.yml to actually set the stash.caches.default values.

      config.yml

      1. Comment out stash config becuase ezpublish*.yml never overwrites, only appends and then is NOT used.
        #stash:
      2. caches:
      3. default:
      4. drivers:
      5. - FileSystem
      6. inMemory: true
      7. registerDoctrineAdapter: false

      ezpublish_prod.yml

      1. Memcache Driver for dev stash
        stash:
        caches:
        default:
        drivers: [ Memcache ]
        inMemory: true
        registerDoctrineAdapter: false
        Memcache:
        retry_timeout: 1
        servers:
      • {server: %memcached_host%, port: %memcached_port%}

      This used to work fine ...

      However this recent compose update broke this fix.

      Several hours of testing shows that config.yml must now ALWAYS have a stash.caches.default.driver -FileSystem or eZ throws an error about missing 'caches' in the config.

      However that means NO OTHER stash driver can be used any more. as it either APPENDS to the end and is never used OR it will just error in StashPass.php

      1. GOAL: use ONLY stash.caches.default.driver -Memcache for ezpublish_prod.yml
      2. GOAL: use stash.caches.default.driver -FileSystem for NOT PROD configs

      Ideally the ezpublish*.yml should overrwrite the config.yml values OR work standalone again. Please fix this!

      For now I had to hack the StashPass.php

      1. DJS HACK to fix missing 'caches' bug while allowing ezpublish_prod.yml to set values (not config.yml append)

                if(array_key_exists('caches',$config)) {
                    foreach ($config['caches'] as $name => $configuration) {
                        if (in_array('Redis', $configuration['drivers'], true)) {
                            $this->configureRedis($container, $igbinary, $lzf);
                        }
                    }
                }
        

      2. DJS end hack

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            David Sayre
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: