Skip to content
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

Predis\Response\ServerException thrown with message "WRONGTYPE Operation against a key holding the wrong kind of value" #44

Closed
ghost opened this issue Mar 2, 2020 · 16 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Mar 2, 2020

  • Operating system and version (e.g. Ubuntu 16.04, Windows 7): Laravel Homestead on macOS 10.15.1
  • Package Version: 2.2.0
  • Laravel Version: 5.8.37

Description:

Predis\Response\ServerException thrown with message "WRONGTYPE Operation against a key holding the wrong kind of value"

Stacktrace:
#62 Predis\Response\ServerException in /home/vagrant/code/MonkeyCam/vendor/predis/predis/src/Client.php:370
#61 Predis\Client:onErrorResponse in /home/vagrant/code/MonkeyCam/vendor/predis/predis/src/Client.php:335
#60 Predis\Client:executeCommand in /home/vagrant/code/MonkeyCam/vendor/predis/predis/src/Client.php:314
#59 Predis\Client:__call in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:114
#58 Illuminate\Redis\Connections\Connection:command in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php:214
#57 Illuminate\Redis\Connections\Connection:__call in /home/vagrant/code/MonkeyCam/vendor/awssat/laravel-visits/src/DataEngines/RedisEngine.php:35
#56 Awssat\Visits\DataEngines\RedisEngine:increment in /home/vagrant/code/MonkeyCam/vendor/awssat/laravel-visits/src/Traits/Record.php:22
#55 Awssat\Visits\Visits:recordRefer in /home/vagrant/code/MonkeyCam/vendor/awssat/laravel-visits/src/Visits.php:212
#54 Awssat\Visits\Visits:increment in /home/vagrant/code/MonkeyCam/app/Http/Controllers/ProfileController.php:44
#53 App\Http\Controllers\ProfileController:showProfile in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
#52 call_user_func_array in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54
#51 Illuminate\Routing\Controller:callAction in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45
#50 Illuminate\Routing\ControllerDispatcher:dispatch in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Route.php:219
#49 Illuminate\Routing\Route:runController in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Route.php:176
#48 Illuminate\Routing\Route:run in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Router.php:680
#47 Illuminate\Routing\Router:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
#46 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41
#45 Illuminate\Routing\Middleware\SubstituteBindings:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#44 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#43 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:75
#42 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#41 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#40 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php:58
#39 Illuminate\Session\Middleware\AuthenticateSession:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#38 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#37 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49
#36 Illuminate\View\Middleware\ShareErrorsFromSession:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#35 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#34 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:56
#33 Illuminate\Session\Middleware\StartSession:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#32 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#31 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37
#30 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#29 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#28 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66
#27 Illuminate\Cookie\Middleware\EncryptCookies:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#26 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#25 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
#24 Illuminate\Pipeline\Pipeline:then in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Router.php:682
#23 Illuminate\Routing\Router:runRouteWithinStack in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Router.php:657
#22 Illuminate\Routing\Router:runRoute in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Router.php:623
#21 Illuminate\Routing\Router:dispatchToRoute in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Router.php:612
#20 Illuminate\Routing\Router:dispatch in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
#19 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
#18 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/fideloper/proxy/src/TrustProxies.php:57
#17 Fideloper\Proxy\TrustProxies:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#16 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#15 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21
#14 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#12 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21
#11 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#10 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#9 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
#8 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#6 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62
#5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:163
#4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#3 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
#2 Illuminate\Pipeline\Pipeline:then in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /home/vagrant/code/MonkeyCam/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
#0 Illuminate\Foundation\Http\Kernel:handle in /home/vagrant/code/MonkeyCam/public/index.php:55
@hedeqiang
Copy link

hedeqiang commented Mar 6, 2020

Yes, I did too
php

PHP 7.4.1 (cli) (built: Dec 18 2019 14:44:04) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.1, Copyright (c), by Zend Technologies

Laravel

Laravel Framework 6.17.1

laravel-visits

awssat/laravel-visits                 2.2.0
[2020-03-06 21:40:10] local.ERROR: WRONGTYPE Operation against a key holding the wrong kind of value {"exception":"[object] (Predis\\Response\\ServerException(code: 0): WRONGTYPE Operation against a key holding the wrong kind of value at /var/www/html/LaravelCode/vendor/predis/predis/src/Client.php:370)

image

@malicucen
Copy link
Contributor

same issue

@abdumu
Copy link
Member

abdumu commented Mar 18, 2020

Hello,

If you have the ability to try PHPredis instead of predis, will this issue disappear or keep happening ?

(reference: https://laravel.com/docs/7.x/redis#phpredis

@abdumu abdumu self-assigned this Mar 18, 2020
@abdumu abdumu added this to the 2.1.3 milestone Mar 18, 2020
@hedeqiang
Copy link

@abdumu YES, Change to predis, this problem disappear

@abdumu
Copy link
Member

abdumu commented Apr 4, 2020

I couldn't reproduce the error, but i made changes for the next version that might fix this error which is predis vs phpredis method signature difference.

I will close this and if it's not fixed in the next release, then you can re open it.

thanks

@abdumu abdumu closed this as completed Apr 4, 2020
@myixyt
Copy link

myixyt commented Apr 28, 2020

I couldn't reproduce the error, but i made changes for the next version that might fix this error which is predis vs phpredis method signature difference.

I will close this and if it's not fixed in the next release, then you can re open it.

thanks

i have the same problem,look forward to a quicker resolution,thanks

@bsh
Copy link

bsh commented Apr 28, 2020

Hi! I had the same issue maybe with the empty referers. If I not use refs(), the error disappears.

{message: "WRONGTYPE Operation against a key holding the wrong kind of value",…} exception: "Predis\Response\ServerException" file: "/var/www/vendor/predis/predis/src/Client.php" line: 370 message: "WRONGTYPE Operation against a key holding the wrong kind of value" trace: [,…] 0: {file: "/var/www/vendor/predis/predis/src/Client.php", line: 335, function: "onErrorResponse",…} 1: {file: "/var/www/vendor/predis/predis/src/Client.php", line: 314, function: "executeCommand",…} 2: {file: "/var/www/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",…} 3: {file: "/var/www/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",…} 4: {file: "/var/www/vendor/awssat/laravel-visits/src/DataEngines/RedisEngine.php", line: 111,…} 5: {file: "/var/www/vendor/awssat/laravel-visits/src/Traits/Lists.php", line: 71,…} 6: {file: "/var/www/vendor/awssat/laravel-visits/src/Traits/Lists.php", line: 49,…}

@myixyt
Copy link

myixyt commented Apr 28, 2020

Hi! I had the same issue maybe with the empty referers. If I not use refs(), the error disappears.

{message: "WRONGTYPE Operation against a key holding the wrong kind of value",…} exception: "Predis\Response\ServerException" file: "/var/www/vendor/predis/predis/src/Client.php" line: 370 message: "WRONGTYPE Operation against a key holding the wrong kind of value" trace: [,…] 0: {file: "/var/www/vendor/predis/predis/src/Client.php", line: 335, function: "onErrorResponse",…} 1: {file: "/var/www/vendor/predis/predis/src/Client.php", line: 314, function: "executeCommand",…} 2: {file: "/var/www/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",…} 3: {file: "/var/www/vendor/laravel/framework/src/Illuminate/Redis/Connections/Connection.php",…} 4: {file: "/var/www/vendor/awssat/laravel-visits/src/DataEngines/RedisEngine.php", line: 111,…} 5: {file: "/var/www/vendor/awssat/laravel-visits/src/Traits/Lists.php", line: 71,…} 6: {file: "/var/www/vendor/awssat/laravel-visits/src/Traits/Lists.php", line: 49,…}

I'm not use refer ,visits($project)->increment(1,false,['refer']);but it can't issue this problem

@abdumu
Copy link
Member

abdumu commented Apr 28, 2020

What version of laravel-visits you are using?

@bsh
Copy link

bsh commented Apr 28, 2020

"awssat/laravel-visits": "^2.0"

@myixyt
Copy link

myixyt commented Apr 29, 2020 via email

@hedeqiang
Copy link

hedeqiang commented Apr 29, 2020

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
REDIS_CLIENT=phpredis

Replace phpredis

@oiuv
Copy link

oiuv commented Mar 3, 2022

原来如此,换phpredis搞定,thanks

@abdumu
Copy link
Member

abdumu commented May 22, 2022

This wasn't solved, opened again for more debugging...

@Firman95
Copy link

This is also happens on version 1.5.3.
For my case, its only throw this error when I open the URL via postman. If I open the URL via browser this error doesn't raised

@abdumu
Copy link
Member

abdumu commented Jul 28, 2023

I think I can report that this issue appears to have been resolved in the newer versions. I am currently using the latest version on production and I have not experienced the issue. I will close this issue, but I will reopen it if someone else reports that they are still experiencing the issue with the newer versions.

@abdumu abdumu closed this as completed Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants