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

Cache store [] is not defined. #42

Closed
ybrmzj opened this issue May 25, 2018 · 5 comments
Closed

Cache store [] is not defined. #42

ybrmzj opened this issue May 25, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@ybrmzj
Copy link

ybrmzj commented May 25, 2018

我的运行环境如下:
+-------------------+------------------------------------------+
| Component | Version |
+-------------------+------------------------------------------+
| PHP | 7.2.4 |
| Swoole | 2.1.3 |
| Laravel Framework | Lumen (5.5.2) (Laravel Components 5.5.*) |
+-------------------+------------------------------------------+

config/cache.php 相关配置:

'default' => env('CACHE_DRIVER', 'redis'),

'stores' => [
    'redis' => [
        'driver' => 'redis',
        'connection' => env('CACHE_REDIS_CONNECTION', 'default'),
    ],

执行步骤:
开启websocket服务,
在postman中请求一个api接口(有启用throttle中间件),
第一次返回正常,第二次报错:
Oops! An unexpected error occurred: Cache store [] is not defined.

错误日志:
[ERROR] LaravelS: onRequest: Uncaught exception "InvalidArgumentException"([0]Cache store [] is not defined.) at /xxx/vendor/illuminate/cache/CacheManager.php:96,
#0 /xxx/vendor/illuminate/cache/CacheManager.php(80): Illuminate\Cache\CacheManager->resolve(NULL)
#1 /xxx/vendor/illuminate/cache/CacheManager.php(58): Illuminate\Cache\CacheManager->get(NULL)
#2 /xxx/vendor/illuminate/cache/CacheManager.php(69): Illuminate\Cache\CacheManager->store(NULL)
#3 /xxx/vendor/illuminate/cache/CacheServiceProvider.php(28): Illuminate\Cache\CacheManager->driver()
#4 /xxx/vendor/illuminate/container/Container.php(749): Illuminate\Cache\CacheServiceProvider->Illuminate\Cache{closure}(Object(Laravel\Lumen\Application), Array)
#5 /xxx/vendor/illuminate/container/Container.php(631): Illuminate\Container\Container->build(Object(Closure))
#6 /xxx/vendor/illuminate/container/Container.php(586): Illuminate\Container\Container->resolve('cache.store', Array)
#7 /xxx/vendor/laravel/lumen-framework/src/Application.php(230): Illuminate\Container\Container->make('cache.store', Array)
#8 /xxx/vendor/illuminate/container/Container.php(885): Laravel\Lumen\Application->make('cache.store')
#9 /xxx/vendor/illuminate/container/Container.php(813): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#10 /xxx/vendor/illuminate/container/Container.php(780): Illuminate\Container\Container->resolveDependencies(Array)
#11 /xxx/vendor/illuminate/container/Container.php(631): Illuminate\Container\Container->build('Tymon\JWTAuth\P...')
#12 /xxx/vendor/illuminate/container/Container.php(586): Illuminate\Container\Container->resolve('Tymon\JWTAuth\P...', Array)
#13 /xxx/vendor/laravel/lumen-framework/src/Application.php(230): Illuminate\Container\Container->make('Tymon\JWTAuth\P...', Array)
#14 /xxx/vendor/tymon/jwt-auth/src/Providers/AbstractServiceProvider.php(377): Laravel\Lumen\Application->make('Tymon\JWTAuth\P...')
#15 /xxx/vendor/tymon/jwt-auth/src/Providers/AbstractServiceProvider.php(201): Tymon\JWTAuth\Providers\AbstractServiceProvider->getConfigInstance('providers.stora...')
#16 /xxx/vendor/illuminate/container/Container.php(749): Tymon\JWTAuth\Providers\AbstractServiceProvider->Tymon\JWTAuth\Providers{closure}(Object(Laravel\Lumen\Application), Array)
#17 /xxx/vendor/illuminate/container/Container.php(631): Illuminate\Container\Container->build(Object(Closure))
#18 /xxx/vendor/illuminate/container/Container.php(586): Illuminate\Container\Container->resolve('tymon.jwt.provi...', Array)
#19 /xxx/vendor/laravel/lumen-framework/src/Application.php(230): Illuminate\Container\Container->make('tymon.jwt.provi...', Array)
#20 /xxx/vendor/illuminate/container/Container.php(503): Laravel\Lumen\Application->make('tymon.jwt.provi...')
#21 /xxx/vendor/illuminate/container/Container.php(238): Illuminate\Container\Container->rebound('tymon.jwt.provi...')
#22 /xxx/vendor/illuminate/container/Container.php(332): Illuminate\Container\Container->bind('tymon.jwt.provi...', Object(Closure), true)
#23 /xxx/vendor/tymon/jwt-auth/src/Providers/AbstractServiceProvider.php(202): Illuminate\Container\Container->singleton('tymon.jwt.provi...', Object(Closure))
#24 /xxx/vendor/tymon/jwt-auth/src/Providers/AbstractServiceProvider.php(75): Tymon\JWTAuth\Providers\AbstractServiceProvider->registerStorageProvider()
#25 /xxx/vendor/laravel/lumen-framework/src/Application.php(193): Tymon\JWTAuth\Providers\AbstractServiceProvider->register()
#26 /xxx/vendor/hhxsv5/laravel-s/src/Illuminate/Laravel.php(244): Laravel\Lumen\Application->register(Object(Tymon\JWTAuth\Providers\LumenServiceProvider), Array, true)
#27 /xxx/vendor/hhxsv5/laravel-s/src/Illuminate/Laravel.php(267): Hhxsv5\LaravelS\Illuminate\Laravel->reRegisterServiceProvider('\Tymon\JWTAuth\...')
#28 /xxx/vendor/hhxsv5/laravel-s/src/LaravelS.php(123): Hhxsv5\LaravelS\Illuminate\Laravel->cleanRequest(Object(Illuminate\Http\Request))
#29 /xxx/vendor/hhxsv5/laravel-s/src/LaravelS.php(78): Hhxsv5\LaravelS\LaravelS->handleDynamicResource(Object(Illuminate\Http\Request), Object(Swoole\Http\Response))
#30 {main}

@mountainguan
Copy link

是不是redis没开

@hhxsv5
Copy link
Owner

hhxsv5 commented May 25, 2018

尝试下基本的Cache功能是否可用

Cache::put('bar', 'baz' . time(), 20);
$ret = Cache::get('bar');
var_dump($ret);

@gazben
Copy link

gazben commented Jun 1, 2018

@hhxsv5 Same here.

CACHE_DRIVER=file

+-------------------+------------------------------------------+
| Component         | Version                                  |
+-------------------+------------------------------------------+
| PHP               | 7.2.6                                    |
| Swoole            | 2.2.0                                    |
| Laravel Framework | Lumen (5.6.3) (Laravel Components 5.6.*) |
+-------------------+------------------------------------------+

@hhxsv5
Copy link
Owner

hhxsv5 commented Jun 1, 2018

@gazben @ybrmzj Thanks for your feedback.

Fixed in 6025c96. You can try dev-master version.

@hhxsv5 hhxsv5 added the bug Something isn't working label Jun 1, 2018
@hhxsv5 hhxsv5 self-assigned this Jun 1, 2018
@hhxsv5
Copy link
Owner

hhxsv5 commented Jun 2, 2018

Release v1.11.3

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

4 participants