question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Redis Extension Bug - Upgrade needed

See original GitHub issue

What version of the buildpack you are using? v4.3.79 - v4.3.82

If you were attempting to accomplish a task, what was it you were attempting to do? Using the included Redis extension to connect to a Redis Cluster

What did you expect to happen? Successful connection to Redis

What was the actual behavior? Exception thrown stating “No such file or directory”

No such file or directory {"exception":"[object] (RedisException(code: 0): No such file or directory at /home/vcap/app/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:120)
   2019-09-11T18:31:14.92+0200 [APP/PROC/WEB/0] OUT 16:31:14 nginx   | [stacktrace]
   2019-09-11T18:31:14.92+0200 [APP/PROC/WEB/0] OUT 16:31:14 nginx   | #0 /home/vcap/app/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(120): Redis->connect('kubernetes-serv...', 49948, 0, NULL, 0, 0)
   2019-09-11T18:31:14.92+0200 [APP/PROC/WEB/0] OUT 16:31:14 nginx   | #1 /home/vcap/app/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(77): Illuminate\\Redis\\Connectors\\PhpRedisConnector->establishConnection(Object(Redis), Array)
   2019-09-11T18:31:14.92+0200 [APP/PROC/WEB/0] OUT 16:31:14 nginx   | #2 /home/vcap/app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(424): Illuminate\\Redis\\Connectors\\PhpRedisConnector->Illuminate\\Redis\\Connectors\\{closure}(Object(Redis))
   2019-09-11T18:31:14.92+0200 [APP/PROC/WEB/0] OUT 16:31:14 nginx   | #3 /home/vcap/app/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php(94): tap(Object(Redis), Object(Closure))

Reproduction steps:

  • Setup a Redis connection using the PhpRedis (redis.so) extension using a port > 32768

Reason: With the release of PHP Buildpack v4.3.79 the PhpRedis extension was upgraded to v5.0.1. But this release of the extension contains a bug which prevents connecting to Redis using a port greater than 32768. See https://github.com/phpredis/phpredis/pull/1602.

Our CF provider uses Redis port 49948 which means we have to stick with the buildpack version v4.3.78 and cannot benefit from PHP 7.3.9 and the various improvements of PhpRedis.

Recommendation: Upgrade PhpRedis extension to v5.0.2 to fix this. Additionally this will make the extension ready for PHP 7.4.

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ocean90commented, Oct 15, 2019

This can be closed, 4.4.0 with the fix has been released. ✨

2reactions
ocean90commented, Oct 5, 2019

If you don’t depend on PhpRedis 5.0 you can write a custom extension which replaces redis.so with the version from v4.3.78:

.extensions/php-redis/extension.py
"""Replace PHP redis module

Replaces the redis.so with the one from php7-7.3.6-linux-x64-cflinuxfs3-1a76a4dd.
See https://github.com/cloudfoundry/php-buildpack/issues/322.
"""
import os
import os.path
import logging
from build_pack_utils import utils
import shutil


_log = logging.getLogger('php-redis')

# Extension Methods
def preprocess_commands(ctx):
    return ()

def service_commands(ctx):
    return {}

def service_environment(ctx):
    return {}

def compile(install):
    print 'Replacing PHP redis module'

    ctx = install.builder._ctx
    dest   = os.path.join(ctx['BUILD_DIR'], 'php', 'lib', 'php', 'extensions', 'no-debug-non-zts-20180731', 'redis.so')
    source = os.path.join(ctx['BUILD_DIR'], '.extensions', 'php-redis', 'redis.so')
    shutil.copy(source, dest)

    return 0
Read more comments on GitHub >

github_iconTop Results From Across the Web

phpredis extension doesn't work, unable to load 'redis.so'
After upgrading from php7.0 to 7.1, redis was not working for me.. was scratching my head and doing all stuff said on diff...
Read more >
Redis 6.2 release notes - GitHub
MODERATE: Program an upgrade of the server, but it's not urgent. HIGH: There is a critical bug that may affect a subset of...
Read more >
Redis Connection Failed - Management and Administration
Hi all, I have installed OpenEMR 5.01 successfully after downloading it 2 days ago. However, it is not working on PHP 7.0 (gives...
Read more >
Learn Redis the hard way (in production) - trivago tech blog
Debugging and fixing the issue · Closing Redis connections at the end of a web request · A/B-Testing of connection libraries · Upgrade...
Read more >
201902 – [NEW PORT] Request: Add php5*-redis to lang/php5 ...
Bug 201902 - [NEW PORT] Request: Add php5*-redis to lang/php5*-extensions ... After each pkg upgrades of php55-extensions, pecl-igbinary and php55-redis ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found