Laravel 4.2 HHVM 3.6.1 (Ubuntu 14)
Getting an ugly problem filling up log files using HHVM using any kind of cache driver (our tests are File and Memcached). Appears related to the way Laravel sets the cache expiry with Carbon.
Doesn't happen on Vagrant, or OS X.
The following code:
Cache::put('cache_item_name', $data, 10); // or
Cache::add('cache_item_name', $data, 10); // or
$expiresAt = Carbon::now()->addMinutes(10);
Cache::put('cache_item_name', $data, $expiresAt);
Generates this bizarre error:
production.ERROR: exception 'InvalidArgumentException' with message 'Unknown setter 'date'' in /var/www/webapp/server/vendor/nesbot/carbon/src/Carbon/Carbon.php:556
The offending Carbon part (556):
case 'timezone':
case 'tz':
$this->setTimezone($value);
break;
Removing the cache line stops the error being logged (obviously). Using different values doesn't help (e.g. int for minutes, or expiry seconds). Only occurs with HHVM.
Stack trace:
#0 (): Carbon\Carbon->__set()
#1 (): DateTime->__sleep()
#2 (): Memcached->setByKey()
#3 /var/www/webapp/server/vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php(58): Memcached->set()
#4 /var/www/webapp/server/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(94): Illuminate\Cache\MemcachedStore->put()
#5 (): Illuminate\Cache\Repository->put()
#6 /var/www/webapp/server/bootstrap/compiled.php(8296): call_user_func_array()
#7 /var/www/webapp/server/bootstrap/compiled.php(3267): Illuminate\Support\Manager->__call()
#8 /var/www/webapp/server/app/modules/vms/controllers/ActivityController.php(68): Illuminate\Support\Facades\Facade::__callStatic()
#9 (): Vms\Controllers\ActivityController->show_team_newsfeed()
#10 /var/www/webapp/server/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array()
#11 /var/www/webapp/server/bootstrap/compiled.php(5843): Illuminate\Routing\Controller->callAction()
#12 /var/www/webapp/server/bootstrap/compiled.php(5831): Illuminate\Routing\ControllerDispatcher->call()
#13 /var/www/webapp/server/bootstrap/compiled.php(5036): Illuminate\Routing\ControllerDispatcher->dispatch()
#14 (): Closure$Illuminate\Routing\Router::getClassClosure()
#15 /var/www/webapp/server/bootstrap/compiled.php(5394): call_user_func_array()
#16 /var/www/webapp/server/bootstrap/compiled.php(5061): Illuminate\Routing\Route->run()
#17 /var/www/webapp/server/bootstrap/compiled.php(5049): Illuminate\Routing\Router->dispatchToRoute()
#18 /var/www/webapp/server/bootstrap/compiled.php(715): Illuminate\Routing\Router->dispatch()
#19 /var/www/webapp/server/bootstrap/compiled.php(696): Illuminate\Foundation\Application->dispatch()
#20 /var/www/webapp/server/bootstrap/compiled.php(7821): Illuminate\Foundation\Application->handle()
#21 /var/www/webapp/server/bootstrap/compiled.php(8428): Illuminate\Session\Middleware->handle()
#22 /var/www/webapp/server/bootstrap/compiled.php(8375): Illuminate\Cookie\Queue->handle()
#23 /var/www/webapp/server/bootstrap/compiled.php(11040): Illuminate\Cookie\Guard->handle()
#24 /var/www/webapp/server/bootstrap/compiled.php(657): Stack\StackedHttpKernel->handle()
#25 /var/www/webapp/server/public/index.php(50): Illuminate\Foundation\Application->run()
#26 {main} [] []
Did you ever have any success in solving this? I'm experiencing this exact error, caused by the Cache expiry as well.
Not as of yet. We're up to the latest version of HHVM (3.7.1 i think?) and still no fix. Looks like a problem with the way HHVM handles Carbon, and how Laravel serializes date objects. Makes no difference using any different type of cache either: memcached and redis both experience "500: Unknown setter 'date' (line 556 of Carbon.php)"
Same here, all seem to happen due to wrong serialization yes.
I have the same problem with Jobs queue atm, as I'm using carbon in db to store job starting dates.
Did you guys find a workaround? It's kind of annoying...
Is this problem still exists? I'm planning to upgrade my servers to hhvm from php56. I won't do that if it still exists.
Still seems like a problem and doesn't seem to be any fix in sight :(
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community