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

Laravel 11 - Call to undefined method Illuminate\Cache\TagSet::addEntry() #251

Closed
KVV0001 opened this issue May 30, 2024 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@KVV0001
Copy link

KVV0001 commented May 30, 2024

Subject of the issue

Describe your issue here.

Your environment:

Q A
Bug? yes
New Feature? no
Framework Laravel
Framework version 11.8.0
Package version 2.3.0
PHP version 8.3

Steps to reproduce

Call logout.

Expected behaviour

Logout successful

Actual behaviour

Logout failed trying to add token to blacklist.
stacktrace
Laravel got rid of redis tags, so logout failed at Blacklist.php 77 line:

      $this->storage->add(
            $this->getKey($payload),
            ['valid_until' => $this->getGraceTimestamp()],
            $this->getMinutesUntilExpired($payload)
        );

stacktrace

#0 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/Providers/Storage/Illuminate.php(73): Illuminate\Cache\RedisTaggedCache->put()
#1 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/Blacklist.php(76): PHPOpenSourceSaver\JWTAuth\Providers\Storage\Illuminate->add()
#2 [internal function]: PHPOpenSourceSaver\JWTAuth\Blacklist->add()
#3 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/Manager.php(160): call_user_func()
#4 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/JWT.php(114): PHPOpenSourceSaver\JWTAuth\Manager->invalidate()
#5 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/JWTGuard.php(183): PHPOpenSourceSaver\JWTAuth\JWT->invalidate()
#6 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php(341): PHPOpenSourceSaver\JWTAuth\JWTGuard->logout()
#7 /home/vadim/projects/agencies-api/app/Http/Controllers/Api/Auth/LoginController.php(55): Illuminate\Auth\AuthManager->__call()
#8 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\Api\Auth\LoginController->logout()
#9 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction()
#10 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\Routing\ControllerDispatcher->dispatch()
#11 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Route.php(206): Illuminate\Routing\Route->runController()
#12 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(806): Illuminate\Routing\Route->run()
#13 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#14 /home/vadim/projects/agencies-api/vendor/php-open-source-saver/jwt-auth/src/Http/Middleware/Authenticate.php(31): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#15 /home/vadim/projects/agencies-api/app/Http/Middleware/AuthRequiredMiddleware.php(19): PHPOpenSourceSaver\JWTAuth\Http\Middleware\Authenticate->handle()
#16 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\Http\Middleware\AuthRequiredMiddleware->handle()
#17 /home/vadim/projects/agencies-api/app/Http/Middleware/AccountMiddleware.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#18 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): App\Http\Middleware\AccountMiddleware->handle()
#19 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#20 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#21 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#22 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\Pipeline\Pipeline->then()
#23 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\Routing\Router->runRouteWithinStack()
#24 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\Routing\Router->runRoute()
#25 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\Routing\Router->dispatchToRoute()
#26 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch()
#27 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#28 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(62): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#29 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle()
#30 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#31 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle()
#32 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#33 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(51): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#34 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#35 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#36 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\ValidatePostSize->handle()
#37 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(110): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#38 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#39 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#40 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then()
#41 /home/vadim/projects/agencies-api/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#42 /home/vadim/projects/agencies-api/public/index.php(56): Illuminate\Foundation\Http\Kernel->handle()
#43 {main}

Seems function determineTags is not valid:

    protected function determineTagSupport()
    {
        // Laravel >= 5.1.28
        if (method_exists($this->cache, 'tags') || $this->cache instanceof PsrCacheInterface) {
            try {
                // Attempt the repository tags command, which throws exceptions when unsupported
                $this->cache->tags($this->tag);
                $this->supportsTags = true;
            } catch (\BadMethodCallException $ex) {
                $this->supportsTags = false;
            }
        } else {
            // Laravel <= 5.1.27
            if (method_exists($this->cache, 'getStore')) {
                // Check for the tags function directly on the store
                $this->supportsTags = method_exists($this->cache->getStore(), 'tags');
            } else {
                // Must be using custom cache repository without getStore(), and all bets are off,
                // or we are mocking the cache contract (in testing), which will not create a getStore method
                $this->supportsTags = false;
            }
        }
    }
@KVV0001 KVV0001 added the bug Something isn't working label May 30, 2024
@KVV0001 KVV0001 closed this as not planned Won't fix, can't repro, duplicate, stale May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant