laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.52k stars 11.02k forks source link

SerializableClosure error #1093

Closed ronnievisser closed 11 years ago

ronnievisser commented 11 years ago

Hi,

I just created an account at iron.io subscribed to a queue using artisan and sending out emails. I can see in iron queues are working since the messages are increasing.

However in my log files I see the following error message coming up: PHP Fatal error: Uncaught exception 'ErrorException' with message 'Warning: file_get_contents(/home/tweebies/vendor/laravel/framework/src/Illuminate/Support/SerializableClosure.php(173) : eval()'d code): failed to open stream: No such file or directory in ...

Looking at the source I can see that the file is there.

Is there something I am doing wrong of is there something missing. I am running on PHP 5.4.12

taylorotwell commented 11 years ago

To me it sounds like a parse error in your closure or something. Try it out using the sync driver first to make sure it's working.

On Apr 27, 2013, at 2:36 PM, Ronster notifications@github.com wrote:

Hi,

I just created an account at iron.io subscribed to a queue using artisan and sending out emails. I can see in iron queues are working since the messages are increasing.

However in my log files I see the following error message coming up: PHP Fatal error: Uncaught exception 'ErrorException' with message 'Warning: file_get_contents(/home/tweebies/vendor/laravel/framework/src/Illuminate/Support/SerializableClosure.php(173) : eval()'d code): failed to open stream: No such file or directory in ...

Looking at the source I can see that the file is there.

Is there something I am doing wrong of is there something missing.

— Reply to this email directly or view it on GitHub.

ronnievisser commented 11 years ago

Using the same code in the mail::send function works fine, I only changed the send tot queue as you mentioned in your screencast. my code is as follows.

$aData = array('email' => $this->email, 'code' => $this->activationcode);
        return (bool) Mail::queue('emails.welcome', $aData, function($oMail) {
            $oMail->to($this->email)->subject(Lang::get('mail.subject_activation'))->setCharset('UTF-8');
        });
ronnievisser commented 11 years ago

Any news on this? Error also occurs with the following code which is almost the same as in your screencast

Mail::queue('emails.welcome', array(), function($mail) {
            $mail->from('info@tweebies.nl')->to($this->email)->subject('Hey!');
        });
taylorotwell commented 11 years ago

Nope. I don't really know what to tell you at this point. I've never seen this issue. Perhaps try making a forum post with your code.

codex-corp commented 11 years ago

@taylorotwell i have the same issue when using 'Mail::queue', any suggest ?

crynobone commented 11 years ago

@codex-corp please come out with a different issue (since the original post is 6 months ago, and there been a lot of changes since). And don't forget to provide code to reproduce the bug.

Ali-Azmoud commented 10 years ago

I have the same Uncaught Exception file_get_contents ..... while I try to use eval(); I tried eval( $test ); eval("?>" . $test ); eval("?>" . $test . "<?php");

but none worked.

GrahamCampbell commented 10 years ago

@Ali-Azmoud Please post on the forums.

sdjrppl commented 3 years ago

In my case I have \Queue::pushOn('apiato-default', function(){ });

and I get this on console ` [2021-01-25 19:05:53][8d5c51e3-84f3-41b8-9492-a69385ef4b6f] Processing: Closure (ExecutionLoopClosure.php(55) : eval()'d code:1) [2021-01-25 19:05:53][8d5c51e3-84f3-41b8-9492-a69385ef4b6f] Failed: Closure (ExecutionLoopClosure.php(55) : eval()'d code:1) [2021-01-25 19:05:53] production.ERROR: Call to a member function bindTo() on null {"exception":"[object] (Error(code: 0): Call to a member function bindTo() on null at /var/www/vendor/opis/closure/src/SerializableClosure.php:263) [stacktrace]

0 [internal function]: Opis\Closure\SerializableClosure->unserialize()

1 /var/www/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(171): unserialize()

2 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(213): Illuminate\Queue\CallQueuedHandler->failed()

3 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(192): Illuminate\Queue\Jobs\Job->failed()

4 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(498): Illuminate\Queue\Jobs\Job->fail()

5 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(459): Illuminate\Queue\Worker->failJob()

6 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(383): Illuminate\Queue\Worker->markJobAsFailedIfWillExceedMaxAttempts()

7 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(360): Illuminate\Queue\Worker->handleJobException()

8 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(306): Illuminate\Queue\Worker->process()

9 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(265): Illuminate\Queue\Worker->runJob()

10 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(112): Illuminate\Queue\Worker->runNextJob()

11 /var/www/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(96): Illuminate\Queue\Console\WorkCommand->runWorker()

12 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle()

13 /var/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(37): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()

14 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()

15 /var/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()

16 /var/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(596): Illuminate\Container\BoundMethod::call()

17 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(134): Illuminate\Container\Container->call()

18 /var/www/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute()

19 /var/www/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run()

20 /var/www/vendor/symfony/console/Application.php(971): Illuminate\Console\Command->run()

21 /var/www/vendor/symfony/console/Application.php(290): Symfony\Component\Console\Application->doRunCommand()

22 /var/www/vendor/symfony/console/Application.php(166): Symfony\Component\Console\Application->doRun()

23 /var/www/vendor/laravel/framework/src/Illuminate/Console/Application.php(93): Symfony\Component\Console\Application->run()

24 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\Console\Application->run()

25 /var/www/artisan(37): Illuminate\Foundation\Console\Kernel->handle()

26 {main}

"} `