8000 RedisSessionHandler reported an error after upgrading phpredis to 6.0.0 · Issue #51700 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

RedisSessionHandler reported an error after upgrading phpredis to 6.0.0 #51700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TianLiangZhou opened this issue Sep 20, 2023 · 9 comments
Closed

Comments

@TianLiangZhou
Copy link

Symfony version(s) affected

6.3.0

Description

deprecation.INFO: Deprecated: Redis::expire(): Passing null to parameter #3 ($mode) of type ?string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: Redis::expire(): Passing null to parameter #3 ($mode) of type ?string is deprecated at

snc_redis.DEBUG: Executing command "EXPIRE sess:dlrqcnojkf0e2l2nnr2ovg79rj 604800 " [] []

request.CRITICAL: Uncaught PHP Exception ErrorException: "Warning: Redis::expire(): Unknown expiration modifier ''"

How to reproduce

upgrading phpredis to 6.0.0

Possible Solution

No response

Additional Context

No response

@nicolas-grekas
Copy link
Member

Related to phpredis/phpredis#2363
I guess either this fix isn't part of 6.0.0 or there are more arg info that need a fix.
Can you please check these possibilities?

@TianLiangZhou
Copy link
Author

Ok , now i need downgrade phpredis

@ahmed-bhs
Copy link
Contributor

@TianLiangZhou @nicolas-grekas any idea please, how to force apt install php8.2-redis to install phpredis 5.3.7 extension instead of 6.0.0 ?

@dmaicher
Copy link
Contributor

@TianLiangZhou @nicolas-grekas any idea please, how to force apt install php8.2-redis to install phpredis 5.3.7 extension instead of 6.0.0 ?

Install php-dev, then run pecl install redis-5.3.7 and enable the extension afterwards in your ini with extension=redis.so

@quentint
Copy link
Contributor
quentint commented Sep 25, 2023

Using Platform.sh? If so:

  • Remove redis from runtime.extensions
  • Add curl -fsS https://raw.githubusercontent.com/platformsh/snippets/main/src/install-phpredis.sh | { bash /dev/fd/3 6.0.1 ; } 3<&0 to the build hook

This will use phpredis 6.0.1 where the bug is fixed. Using a custom phpredis version on Platform.sh is documented here.

I hope this helps (it fixed my project).

@TianLiangZhou
Copy link
Author

@TianLiangZhou @nicolas-grekas any idea please, how to force apt install php8.2-redis to install phpredis 5.3.7 extension instead of 6.0.0 ?

Install php-dev, then run pecl install redis-5.3.7 and enable the extension afterwards in your ini with extension=redis.so

Correct +1

@99hops
Copy link
99hops commented Sep 27, 2023

I also see this with Redis 6.0.0/6.0.1

deprecation.INFO: Deprecated: Redis::scan(): Passing null to parameter #4 ($type) of type ?string is deprecated {"exception":"[object] (ErrorException(code: 0): Deprecated: Redis::scan(): Passing null to parameter #4 ($type) of type ?string is deprecated at /var/www/html/vendor/symfony/cache/Traits/Redis6Proxy.php:891)"} []

while 5.3.7 doesn't

@99hops
Copy link
99hops commented Sep 27, 2023

@TianLiangZhou @nicolas-grekas any idea please, how to force apt install php8.2-redis to install phpredis 5.3.7 extension instead of 6.0.0 ?

apt search php8.2-redis
apt install php8.2-redis=5.3.7 (if available)

or remove the apt package and install via pecl

pecl install redis-5.3.7 and enable module docker-php-ext-enable redis or make/link redis.ini

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Sep 27, 2023

If this persists despite phpredis/phpredis#2363, this should be reported there, because an argument with type ?string should accept null.

Closing since this is not on our side. Please link back here if you open the issue on phpredis.

nicolas-grekas added a commit that referenced this issue Oct 13, 2023
…y behaviors of internal classes (nicolas-grekas)

This PR was merged into the 6.3 branch.

Discussion
----------

[Cache][VarExporter] Fix proxy generation to deal with edgy behaviors of internal classes

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #51770, #51679, #51700
| License       | MIT

Instead of #51838

This fixes the issue by not passing default values explicitly when they were not provided during the call to the method.

Commits
-------

c66a2f7 [Cache][VarExporter] Fix proxy generation to deal with edgy behaviors of internal classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
0