henninghorn's avatar

Auth::once() trying to establish memcached connection

Hi guys.

I just tried installing a fresh install of Lumen. I'm building an API and I don't need sessions, so when I'm authenticating request I'm trying to use Auth::once() which doesn't utilize session/cookies. But that seems to have changed, something is trying to create a session.

I did a vanilla install, enabled dotenv, facades and eloquent and made this simple route:

$app->get('/', function () use ($app) {
    $result = Auth::once(['email' => 'email@example.com', 'password' => 'myPassword']);
    if ($result) {
      return 'OK';
    } else {
      return 'ERROR';
    }
});

But I'm getting this error:

Whoops, looks like something went wrong.

1/1
RuntimeException in MemcachedConnector.php line 38:
Could not establish Memcached connection.
in MemcachedConnector.php line 38
at MemcachedConnector->connect(array(array('host' => '127.0.0.1', 'port' => '11211', 'weight' => '100'))) in CacheManager.php line 156
at CacheManager->createMemcachedDriver(array('driver' => 'memcached', 'servers' => array(array('host' => '127.0.0.1', 'port' => '11211', 'weight' => '100')))) in CacheManager.php line 97
at CacheManager->resolve('memcached') in CacheManager.php line 77
at CacheManager->get('memcached') in CacheManager.php line 55
at CacheManager->store('memcached') in CacheManager.php line 66
at CacheManager->driver('memcached') in SessionManager.php line 156
at SessionManager->createCacheHandler('memcached') in SessionManager.php line 143
at SessionManager->createCacheBased('memcached') in SessionManager.php line 108
at SessionManager->createMemcachedDriver() in Manager.php line 87
at Manager->createDriver('memcached') in Manager.php line 63
at Manager->driver() in SessionServiceProvider.php line 48
at SessionServiceProvider->Illuminate\Session\{closure}(object(Application), array()) in Container.php line 734
at Container->build(object(Closure), array()) in Container.php line 627
at Container->make('session.store', array()) in Application.php line 447
at Application->make('session.store') in Application.php line 822
at Application->loadComponent('session', 'Illuminate\Session\SessionServiceProvider', 'session.store') in Application.php line 732
at Application->Laravel\Lumen\{closure}(object(Application), array()) in Container.php line 734
at Container->build(object(Closure), array()) in Container.php line 627
at Container->make('session.store', array()) in Application.php line 447
at Application->make('session.store') in Container.php line 1159
at Container->offsetGet('session.store') in AuthManager.php line 93
at AuthManager->createEloquentDriver() in Manager.php line 87
at Manager->createDriver('eloquent') in AuthManager.php line 18
at AuthManager->createDriver('eloquent') in Manager.php line 63
at Manager->driver() in Manager.php line 137
at Manager->__call('once', array(array('email' => 'email@example.com', 'password' => 'myPassword'))) in Facade.php line 216
at AuthManager->once(array('email' => 'email@example.com', 'password' => 'myPassword')) in Facade.php line 216
at Facade::__callStatic('once', array(array('email' => 'email@example.com', 'password' => 'myPassword'))) in routes.php line 15
at Auth::once(array('email' => 'email@example.com', 'password' => 'myPassword')) in routes.php line 15
at Closure->{closure}()
at call_user_func_array(object(Closure), array()) in Container.php line 503
at Container->call(object(Closure), array()) in Application.php line 1314
at Application->callActionOnArrayBasedRoute(array(true, array(object(Closure)), array())) in Application.php line 1288
at Application->handleFoundRoute(array(true, array(object(Closure)), array())) in Application.php line 1207
at Application->Laravel\Lumen\{closure}() in Application.php line 1442
at Application->sendThroughPipeline(array(), object(Closure)) in Application.php line 1213
at Application->dispatch(null) in Application.php line 1153
at Application->run() in index.php line 28
at require_once('/Users/henning/Code/misc/auth-test/public/index.php') in server.php line 12
0 likes
2 replies
bobbybouwmann's avatar

I see it's trying to use memcached. Did you add that to your project? Maybe in your config or .env?

henninghorn's avatar

@bobbybouwmann

If I change my memcached settings in my .env to:

CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_DRIVER=database

I still get the memcached error.

But the point is, that it shouldn't even try to establish an memcached connection, since I'm not trying to do anything related to memcached.

Please or to participate in this conversation.