Redis Cache By Xon

Redis Cache By Xon 2.1.5

No permission to download

Xon

Well-known member
#81
Please check if you've got any errors in the admincp (this occurs when css rendering fails), and try flushing redis cache incase something wonky got in there
 

Xon

Well-known member
#86
I cant use the 'server'property
If i change host to server, here my config
PHP:
$
$config['cache']['config'] = array(
        'host' => 'ip',
        'port' => 6379,
        'password' => 'pw',
        'timeout' => 2.5,
        'persistent' => null,
        'force_standalone' => false,
        'connect_retries' => 1,
        'read_timeout' => null,
        'database' => 0,
        'compress_data' => 1,
        'lifetimelimit' => 2592000,
        'compress_threshold' => 20480,
        'compression_lib' => null, // dynamically select first of; snappy,lzf,l4z,gzip IF EMPTY/null
        'use_lua' => false,
        'serializer' => 'igbinary', // to disable set ot 'php'
        );
i get this error:
Code:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught ErrorException: [E_WARNING] Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known in webpath/src/XF/CacheFactory.php:219
Stack trace:
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] Red...', '/var/www/vhosts...', 219, Array)
#1 webpath/src/XF/CacheFactory.php(219): Redis->connect('', 6379, 0)
#2 webpath/src/XF/CacheFactory.php(69): XF\\CacheFactory->createRedisCache(Array)
#3 webpath/src/XF/CacheFactory.php(24): XF\\CacheFactory->instantiate('Redis', Array)
#4 webpath/src/XF/App.php(472): XF\\CacheFactory->create('Redis', Array)
#5 webpath/src/XF/Container.p...
'
This bit is wrong: 'host' => 'ip',

It needs to be; 'server' => '127.0.0.1',
Replace 127.0.0.1 with whatever your redis's server's ip is.
 

Tealk

Active member
#87
This bit is wrong: 'host' => 'ip',

It needs to be; 'server' => '127.0.0.1',
Replace 127.0.0.1 with whatever your redis's server's ip is.
Sorry my misstake havent change
$config['cache']['provider'] = 'Redis'; to $config['cache']['provider'] = 'SV\RedisCache\Redis';
 

Tealk

Active member
#88
Hi,
on the server i have installed the php-redis version 3.1.1
php-redis ist schon die neueste Version (3.1.1-1)
but the acp show me the version 3.0.0
1520520617590.png
 

nodle

Well-known member
#90
@Xon , do you know does this add-on work when using a socket instead of an ip for your Redis? My host uses a socket instead like this:

/home/pathtoyoursocket.sock

There is no password.
 

Xon

Well-known member
#91
@Xon , do you know does this add-on work when using a socket instead of an ip for your Redis? My host uses a socket instead like this:

/home/pathtoyoursocket.sock

There is no password.
Yes, it is possible, use this stanza in $config['cache']['config'] configuration block;

Code:
'server' => 'unix:///home/pathtoyoursocket.sock',
 

Nirjonadda

Well-known member
#92
@Xon I am getting this server log about read error on connection.

Code:
CredisException: read error on connection src/addons/SV/RedisCache/Credis/Client.php:1157

Generated by: Unknown account Mar 9, 2018 at 8:30 PM

Stack trace

#0 src/addons/SV/RedisCache/Redis.php(226): Credis_Client->__call('get', Array)
#1 src/addons/SV/RedisCache/CacheProvider.php(46): SV\RedisCache\Redis->doFetch('xfredis__sessio...')
#2 src/XF/Session/CacheStorage.php(24): SV\RedisCache\CacheProvider->fetch('session_PZnyUZL...')
#3 src/XF/Session/Session.php(53): XF\Session\CacheStorage->getSession('PZnyUZLYROBORU0...')
#4 src/XF/App.php(632): XF\Session\Session->start('\xB60K\xCA')
#5 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#6 src/XF/Pub/App.php(39): XF\Container->offsetGet('session.public')
#7 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#8 src/XF/App.php(2208): XF\Container->offsetGet('session')
#9 src/XF/Pub/App.php(91): XF\App->session()
#10 src/XF/App.php(1885): XF\Pub\App->start(true)
#11 src/XF.php(328): XF\App->run()
#12 index.php(13): XF::runApp('XF\\Pub\\App')
#13 {main}

-------------

Previous RedisException: read error on connection - src/addons/SV/RedisCache/Credis/Client.php:1139
#0 src/addons/SV/RedisCache/Credis/Client.php(1139): Redis->get('xfredis__sessio...')
#1 src/addons/SV/RedisCache/Redis.php(226): Credis_Client->__call('get', Array)
#2 src/addons/SV/RedisCache/CacheProvider.php(46): SV\RedisCache\Redis->doFetch('xfredis__sessio...')
#3 src/XF/Session/CacheStorage.php(24): SV\RedisCache\CacheProvider->fetch('session_PZnyUZL...')
#4 src/XF/Session/Session.php(53): XF\Session\CacheStorage->getSession('PZnyUZLYROBORU0...')
#5 src/XF/App.php(632): XF\Session\Session->start('\xB60K\xCA')
#6 src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container))
#7 src/XF/Pub/App.php(39): XF\Container->offsetGet('session.public')
#8 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#9 src/XF/App.php(2208): XF\Container->offsetGet('session')
#10 src/XF/Pub/App.php(91): XF\App->session()
#11 src/XF/App.php(1885): XF\Pub\App->start(true)
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state

array(4) {
  ["url"] => string(38) "/index.php?dbtech-security/fingerprint"
  ["referrer"] => string(34) "/login/login"
  ["_GET"] => array(1) {
    ["dbtech-security/fingerprint"] => string(0) ""
  }
  ["_POST"] => array(6) {
    ["fingerprint"] => string(32) "be8ad4b55ad69f5588688ef672bd82db"
    ["components"] => array(23) {
      [0] => array(2) {
        ["key"] => string(10) "user_agent"
        ["value"] => string(78) "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0"
      }
      [1] => array(2) {
        ["key"] => string(8) "language"
        ["value"] => string(5) "en-US"
      }
      [2] => array(2) {
        ["key"] => string(11) "color_depth"
        ["value"] => string(2) "24"
      }
      [3] => array(2) {
        ["key"] => string(11) "pixel_ratio"
        ["value"] => string(3) "1.5"
      }
      [4] => array(2) {
        ["key"] => string(20) "hardware_concurrency"
        ["value"] => string(1) "8"
      }
      [5] => array(2) {
        ["key"] => string(10) "resolution"
        ["value"] => array(2) {
          [0] => string(4) "1280"
          [1] => string(3) "720"
        }
      }
      [6] => array(2) {
        ["key"] => string(20) "available_resolution"
        ["value"] => array(2) {
          [0] => string(4) "1280"
          [1] => string(3) "680"
        }
      }
      [7] => array(2) {
        ["key"] => string(15) "timezone_offset"
        ["value"] => string(4) "-360"
      }
      [8] => array(2) {
        ["key"] => string(15) "session_storage"
        ["value"] => string(1) "1"
      }
      [9] => array(2) {
        ["key"] => string(13) "local_storage"
        ["value"] => string(1) "1"
      }
      [10] => array(2) {
        ["key"] => string(10) "indexed_db"
        ["value"] => string(1) "1"
      }
      [11] => array(2) {
        ["key"] => string(9) "cpu_class"
        ["value"] => string(7) "unknown"
      }
      [12] => array(2) {
        ["key"] => string(18) "navigator_platform"
        ["value"] => string(5) "Win64"
      }
      [13] => array(2) {
        ["key"] => string(12) "do_not_track"
        ["value"] => string(11) "unspecified"
      }
      [14] => array(1) {
        ["key"] => string(15) "regular_plugins"
      }
      [15] => array(2) {
        ["key"] => string(6) "canvas"
        ["value"] => string(17035)
 

Nirjonadda

Well-known member
#93
More log.

Code:
"canvas winding:yes~canvas fp:data:image/png;base64,
 [16] => array(2) {

        ["key"] => string(5) "webgl"

        ["value"] => string(9281) "data:image/png;base64,
      [17] => array(2) {

        ["key"] => string(7) "adblock"

        ["value"] => string(4) "true"

      }

      [18] => array(2) {

        ["key"] => string(18) "has_lied_languages"

        ["value"] => string(5) "false"

      }

      [19] => array(2) {

        ["key"] => string(19) "has_lied_resolution"

        ["value"] => string(5) "false"

      }

      [20] => array(2) {

        ["key"] => string(11) "has_lied_os"

        ["value"] => string(5) "false"

      }

      [21] => array(2) {

        ["key"] => string(16) "has_lied_browser"

        ["value"] => string(5) "false"

      }

      [22] => array(2) {

        ["key"] => string(13) "touch_support"

        ["value"] => array(3) {

          [0] => string(1) "0"

          [1] => string(5) "false"

          [2] => string(5) "false"

        }

      }

    }

    ["_xfRequestUri"] => string(12) "/login/login"

    ["_xfWithData"] => string(1) "1"

    ["_xfToken"] => string(8) "********"

    ["_xfResponseType"] => string(4) "json"

  }

}
 

Xon

Well-known member
#94
This is the phpredis extension losing connection to Redis. It would do it with my redis caching add-on or the built-in version.

Ensure you've got redis set to not write changes to disk or create periodic dumps. It saves automatically on shutdown, and as a cache isn't critical to be kept all the time.

Otherwise, please look at the FAQ for hints on this error.
 

Xon

Well-known member
#99
@CNK this is an English forum, and I am only able to offer support for questions in English.

Additionally, installing and configuring Redis is not covered by support for this add-on.
 

CNK

Active member
Sorry, Chrome automatically translated my post before I send this :)

So what I need to run Redis with XF2? I have VPS and I installed redis-server.

Code:
# ls -lh /var/run/redis
-rw-rw---- 1 redis www-data 6 mar 11 23:16 redis-server.pid
srwxrwxr-x 1 redis www-data 0 mar 11 23:16 redis.sock
I added to library/config.php this code:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => 'unix:///var/run/redis/redis.sock',
        'compress_data' => 6,
    );
restarted redis by:
Code:
sudo service redis-server restart
but in admin.php?redis-info/ I still have:
Redis Information
Redis is disabled.

Ok, my mistake. I was editing the old config...
I edit src/config.php and.. now I have error:
Fatal error: Uncaught CredisException: Connection to Redis /var/run/redis/redis.sock: failed after 2 failures.Last Error : (2) No such file or directory in /web/src/addons/SV/RedisCache/Credis/Client.php:475 Stack trace: #0 /web/src/addons/SV/RedisCache/Credis/Client.php(471): Credis_Client->connect() #1 /web/src/addons/SV/RedisCache/Credis/Client.php(784): Credis_Client->connect() #2 /web/src/addons/SV/RedisCache/Redis.php(251): Credis_Client->__call('mget', Array) #3 /web/src/addons/SV/RedisCache/CacheProvider.php(60): SV\RedisCache\Redis->doFetchMultiple(Array) #4 /web/src/XF/DataRegistry.php(113): SV\RedisCache\CacheProvider->fetchMultiple(Array) #5 /web/src/XF/DataRegistry.php(81): XF\DataRegistry->readFromCache(Array, Array) #6 /web/src/XF/DataRegistry.php(225): XF\DataRegistry->get(Array) #7 /web/src/XF/App.php(1402): XF\DataRegistry->offsetGet('codeEventListen...') #8 /web/src/XF/Container.php(28): XF\App->XF\{closure}(Object(XF\Container)) #9 /web/src/XF/App.php(1216): XF\Container->offsetGet('extension.liste...' in /web/src/addons/SV/RedisCache/Credis/Client.php on line 475
but with TCP settings it work's great:
Code:
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'SV\RedisCache\Redis';
$config['cache']['config']  = array(
        'server' => '127.0.0.1',
        'port' => 6379,
        'compress_data' => 6,
    );
1520845330637.png

phpredis, igbinary also installed:
1520854116529.png

but how to configure this using a socket?

I don't know what's wrong, because in terminal all works like a charm:
Code:
# redis-cli -s /var/run/redis/redis.sock
redis /var/run/redis/redis.sock>
 

Attachments

Last edited:
Top