Invalid argument supplied for foreach()
A php script run background processes, first time Works perfect,but a day ago throw, Invalid argument supplied for foreach() .
code like
$driver = Driver::remember(10,'driver_cache'.$driver_id)->find($driver_id);
Throws: Warning: Invalid argument supplied for foreach() in
#0 /data//vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(455): Illuminate\Exception\Handler->handleError(2, 'Invalid argumen...', ...', 455, Array)
#1 /data/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(137): Illuminate\Database\Eloquent\Builder->getModels(Array)
#2 /data//vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(111): Illuminate\Database\Eloquent\Builder->get(Array)
#3 /data//vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(68): Illuminate\Database\Eloquent\Builder->first(Array)
y)
Is this Laravel 4.2?
composer.json
"require": {
"laravel/framework": "4.1.*",
"pda/pheanstalk": "dev-master",
"nategood/httpful": "*"
},
Only laravel 4.2/5.0 is supported. Also "pda/pheanstalk": "dev-master" does not work on laravel 4.1.
@yuchen99 What is your cache driver? because we are experiencing the same issue.
@ammont memcached
@yuchen99 have you found a solution? We use redis.
Is fixed in 4.2; Problem was that tagged cache remember was non-atomic, which on a busy server leads to problems. In file Taggedcache.php:
if ($this->has($key)) return $this->get($key); // incorrect, non-atomic
if ( ! is_null($value = $this->get($key))) return $value; // correct, atomic
Hi Facing below issue, Could you please help me to sort out :