0013826: Update auf 2018.02.3 Community Edition crasht mit Verweis auf Redis im Stacktrace #6837

Closed
Gloirin opened this Issue Jun 9, 2018 · 12 comments

Comments

Projects
None yet
1 participant
@Gloirin

Gloirin commented Jun 9, 2018

Reported by bammes on 14 Apr 2018 18:48

Version: 2018.02.3 Community Edition

Hallo,

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)
#2 /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()
#4 /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)
#2 /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()
#4 /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

@Gloirin Gloirin added this to the 2018.02.4 Community Edition milestone Jun 9, 2018

@Gloirin Gloirin self-assigned this Jun 9, 2018

@Gloirin Gloirin closed this Jun 9, 2018

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 17 Apr 2018 08:40

fixed in the next release

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 17 Apr 2018 08:40

fixed in the next release

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 18 Apr 2018 13:28

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

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 18 Apr 2018 13:28

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

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 13:35

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)
#2 /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()
#4 /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)
#2 /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()
#4 /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&#39;t do it ever!');
> break;
>

Gloirin commented Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 13:35

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)
#2 /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()
#4 /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)
#2 /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()
#4 /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&#39;t do it ever!');
> break;
>

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:05

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!

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:05

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!

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:06

redis backend without mandatory SERIALIZER_IGBINARY

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:06

redis backend without mandatory SERIALIZER_IGBINARY

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:09

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

Gloirin commented Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:09

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

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:14

see tine20/zendframework1@cf11dc2

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 19 Apr 2018 15:14

see tine20/zendframework1@cf11dc2

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:23

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).

Gloirin commented Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:23

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).

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:31

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.

Gloirin commented Jun 11, 2018

Comment posted by bammes on 19 Apr 2018 15:31

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.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by AdrianSt on 19 Apr 2018 18:28

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.

Gloirin commented Jun 11, 2018

Comment posted by AdrianSt on 19 Apr 2018 18:28

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.

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 20 Apr 2018 08:27

ok, thanks for the updates :)

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

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 20 Apr 2018 08:27

ok, thanks for the updates :)

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

@Gloirin

This comment has been minimized.

Show comment
Hide comment
@Gloirin

Gloirin Jun 11, 2018

Comment posted by pschuele on 20 Apr 2018 08:33

http://gerrit.tine20.com/customers/8965

Gloirin commented Jun 11, 2018

Comment posted by pschuele on 20 Apr 2018 08:33

http://gerrit.tine20.com/customers/8965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment