View Issue Details

IDProjectCategoryView StatusLast Update
0013826Tine 2.0Tinebasepublic2018-04-20 10:33
ReporterbammesAssigned Topschuele 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2018.02.3 Community Edition 
Target Version2018.02.4 Community EditionFixed in Version2018.02.4 Community Edition 
Summary0013826: Update auf 2018.02.3 Community Edition crasht mit Verweis auf Redis im Stacktrace
DescriptionHallo,

gerade habe ich versucht, das Update von 2018.02.2 auf 2018.02.3 zu fahren.
Dieses schlägt mit folgender Ausgabe fehl:

[www@www-1 /usr/local/www/calendar.postadigitale.de.new]$ php ./setup.php --update All
PHP Fatal error: Uncaught Error: Undefined class constant 'Redis::SERIALIZER_IGBINARY' in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php:115
Stack trace:
#0 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(153): Zend_Cache_Backend_Redis->__construct(Array)
#1 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Redis', Array, false, false)
0000002 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(932): Zend_Cache::factory('Core', 'Redis', Array, Array)
#3 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(1502): Tinebase_Core::setupCache()
0000004 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(985): Tinebase_Core::getCache()
#5 /usr/local/www/calendar.postadigitale.de.new/Setup/Core.php(209): Tinebase_Core::setupDatabaseConnection()
#6 /usr/local/www/calendar.postadigitale.de.new/Setup/Core. in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php on line 115

Fatal error: Uncaught Error: Undefined class constant 'Redis::SERIALIZER_IGBINARY' in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php:115
Stack trace:
#0 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(153): Zend_Cache_Backend_Redis->__construct(Array)
#1 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Redis', Array, false, false)
0000002 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(932): Zend_Cache::factory('Core', 'Redis', Array, Array)
#3 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(1502): Tinebase_Core::setupCache()
0000004 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(985): Tinebase_Core::getCache()
#5 /usr/local/www/calendar.postadigitale.de.new/Setup/Core.php(209): Tinebase_Core::setupDatabaseConnection()
#6 /usr/local/www/calendar.postadigitale.de.new/Setup/Core. in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php on line 115
TagsNo tags attached.
mwticket

Activities

pschuele

pschuele

2018-04-17 10:40

administrator   ~0021618

fixed in the next release
pschuele

pschuele

2018-04-18 15:28

administrator   ~0021620

you can now download the fixed zf1 version here: https://github.com/tine20/zendframework1/releases/tag/1.12.20pl25

just unzip into tine20/vendor/zendframework/zendframework1
bammes

bammes

2018-04-19 15:35

reporter   ~0021628

I am sorry, same behaviour as before:

[www@www-1 /usr/local/www/calendar.postadigitale.de.new]$ php setup.php --update All
PHP Fatal error: Uncaught Error: Undefined class constant 'Redis::SERIALIZER_IGBINARY' in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php:115
Stack trace:
#0 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(153): Zend_Cache_Backend_Redis->__construct(Array)
#1 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Redis', Array, false, false)
0000002 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(932): Zend_Cache::factory('Core', 'Redis', Array, Array)
#3 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(1502): Tinebase_Core::setupCache()
0000004 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(985): Tinebase_Core::getCache()
#5 /usr/local/www/calendar.postadigitale.de.new/Setup/Core.php(209): Tinebase_Core::setupDatabaseConnection()
#6 /usr/local/www/calendar.postadigitale.de.new/Setup/Core. in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php on line 115

Fatal error: Uncaught Error: Undefined class constant 'Redis::SERIALIZER_IGBINARY' in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php:115
Stack trace:
#0 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(153): Zend_Cache_Backend_Redis->__construct(Array)
#1 /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache.php(94): Zend_Cache::_makeBackend('Redis', Array, false, false)
0000002 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(932): Zend_Cache::factory('Core', 'Redis', Array, Array)
#3 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(1502): Tinebase_Core::setupCache()
0000004 /usr/local/www/calendar.postadigitale.de.new/Tinebase/Core.php(985): Tinebase_Core::getCache()
#5 /usr/local/www/calendar.postadigitale.de.new/Setup/Core.php(209): Tinebase_Core::setupDatabaseConnection()
#6 /usr/local/www/calendar.postadigitale.de.new/Setup/Core. in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php on line 115

short diff between old and new dir-content:

[www@www-1 /usr/local/www]$ diff -r calendar.diff/vendor/zendframework/zendframework1/ calendar.postadigitale.de.new/vendor/zendframework/zendframework1/
Only in calendar.postadigitale.de.new/vendor/zendframework/zendframework1/: .gitignore
diff -r calendar.diff/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php
269c269,290
< return $this->_redis->flushDB();
---
> $iterator = null;
> $success = true;
> $prefix = $this->_redis->getOption(Redis::OPT_PREFIX);
> if (!is_string($prefix) || strlen($prefix) === 0) {
> $prefix = null;
> $pattern = null;
> } else {
> $this->_redis->setOption(Redis::OPT_PREFIX, '');
> $pattern = $prefix . '*';
> }
> try {
> while (is_array($keys = $this->_redis->scan($iterator, $pattern, 100))) {
> // don't && the other way! we still want to delete as much as possible, even if it failes once
> $success = $this->_redis->del($keys) && $success;
> }
> } finally {
> if (null !== $prefix) {
> $this->_redis->setOption(Redis::OPT_PREFIX, $prefix);
> }
> }
> return $success;
> //return $this->_redis->flushDB();
325c346,354
< $allTags = array_unique(array_merge($tags, $values[$i][3]));
---
> // if the record also has some other tags attached, remove record from these tag lists too
> // $values[$i] can be null if id was not found by getMultiple
> if (is_array($values[$i]) && is_array($values[$i][3])) {
> $allTags = array_unique(array_merge((array) $tags, $values[$i][3]));
> // otherwise just remove from the tag lists provided
> } else {
> $allTags = (array) $tags;
> }
>
diff -r calendar.diff/vendor/zendframework/zendframework1/library/Zend/RedisProxy.php calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/RedisProxy.php
79a80,102
> public function scan(&$iterator, $pattern = null, $count = 0)
> {
> $tries = 0;
> while (true) {
> try {
> return $this->_redis->scan($iterator, $pattern, $count);
> } catch (RedisException $re) {
> if (true === $this->_inMulti || ++$tries > 5) {
> throw $re;
> }
>
> // give Redis 100ms and try again
> usleep(100000);
>
> try {
> $this->_redis->ping();
> } catch (RedisException $re) {
> $this->_reconnect();
> }
> }
> }
> }
>
110a134,138
> case 'flushDB':
> case 'flushAll':
> throw new RedisException($_name . ' is forbidden, it well may be a shared redis, don\'t do it ever!');
> break;
>

pschuele

pschuele

2018-04-19 17:05

administrator   ~0021652

hi bammes,

i attached a patched version of the redis backend (vendor/zendframework/zendframework1/library/Zend/Cache/Backend/Redis.php). could you please try it and tell us if this works?

thanks!
pschuele

pschuele

2018-04-19 17:06

administrator   ~0021654

redis backend without mandatory SERIALIZER_IGBINARY

Redis.php (21,082 bytes)
bammes

bammes

2018-04-19 17:09

reporter   ~0021656

Looks, like RedisProxy.php has to be changed as well:

[www@www-1 /usr/local/www/calendar.postadigitale.de.new]$ php setup.php --update All
PHP Fatal error: Cannot declare class Zend_Cache_Backend_Redis, because the name is already in use in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/RedisProxy.php on line 31

Fatal error: Cannot declare class Zend_Cache_Backend_Redis, because the name is already in use in /usr/local/www/calendar.postadigitale.de.new/vendor/zendframework/zendframework1/library/Zend/RedisProxy.php on line 31
pschuele

pschuele

2018-04-19 17:14

administrator   ~0021658

see https://github.com/tine20/zendframework1/commit/cf11dc28ca6b565cf4d409a204dd5f73e3abc06d
bammes

bammes

2018-04-19 17:23

reporter   ~0021662

Looks good now with your new Redis.php, replaced the wrong file...

[www@www-1 /usr/local/www/calendar.postadigitale.de.new]$ php setup.php --update All
Updated 4 application(s).
bammes

bammes

2018-04-19 17:31

reporter   ~0021664

Just found out, that freebsds default package switched ignbinary off.
If I compile php71-pecl-redis WITH ignbinary support myself, it works.
It could be also a possible solution to include a hint in the Changelog, that from 2018.02.3 on IGNBINARY support is needed.
I don't know, what the Debian/Ubuntu/Redhat default is, which should cover most of the cases...

Your "redis backend without mandatory SERIALIZER_IGBINARY" made me check, if there where any non-default build-options in php71-pecl-redis in freebsd.
AdrianSt

AdrianSt

2018-04-19 20:28

reporter   ~0021666

Bammes, thanks for the hint.
2018.02.3 works unpatched after reinstalling/activating redis with igbinary support and igbinary through PECL.
Ubuntu doesn't come with Redis for PHP 7.1/7.2 out of the box so you have to use PECL.
And "no" is the default when being asked for igbinary support.
pschuele

pschuele

2018-04-20 10:27

administrator   ~0021670

ok, thanks for the updates :)

closing this issue. 2018.02.4 will have the fixed Redis cache backend that works with or without IGBINARY.

Issue History

Date Modified Username Field Change
2018-04-14 20:48 bammes New Issue
2018-04-16 15:27 pmehrer Assigned To => pschuele
2018-04-17 10:40 pschuele Target Version => 2018.02.4 Community Edition
2018-04-17 10:40 pschuele Status new => resolved
2018-04-17 10:40 pschuele Resolution open => fixed
2018-04-17 10:40 pschuele Fixed in Version => 2018.02.4 Community Edition
2018-04-17 10:40 pschuele Note Added: 0021618
2018-04-18 15:28 pschuele Note Added: 0021620
2018-04-19 15:35 bammes Status resolved => new
2018-04-19 15:35 bammes Resolution fixed => reopened
2018-04-19 15:35 bammes Note Added: 0021628
2018-04-19 17:05 pschuele Status new => feedback
2018-04-19 17:05 pschuele Note Added: 0021652
2018-04-19 17:06 pschuele File Added: Redis.php
2018-04-19 17:06 pschuele Note Added: 0021654
2018-04-19 17:09 bammes Note Added: 0021656
2018-04-19 17:09 bammes Status feedback => assigned
2018-04-19 17:14 pschuele Note Added: 0021658
2018-04-19 17:23 bammes Note Added: 0021662
2018-04-19 17:31 bammes Note Added: 0021664
2018-04-19 20:28 AdrianSt Note Added: 0021666
2018-04-20 10:27 pschuele Status assigned => resolved
2018-04-20 10:27 pschuele Resolution reopened => fixed
2018-04-20 10:27 pschuele Note Added: 0021670