There was an error saving your invoice - self host

Hi there, I am experiencing the same thing. Laravel log shows the following error:

[2017-01-24 05:35:51] production.ERROR: exception 'ReflectionException' with message 'Class does not exist' in bootstrap/cache/compiled.php:1355 Stack trace: #0 bootstrap/cache/compiled.php(1355): ReflectionClass->__construct('') #1 bootstrap/cache/compiled.php(1309): Illuminate\Container\Container->build('', Array) #2 bootstrap/cache/compiled.php(1874): Illuminate\Container\Container->make('', Array) #3 vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(154): Illuminate\Foundation\Application->make('') #4 vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(210): Illuminate\Queue\Jobs\Job->resolve('') #5 vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(153): Illuminate\Queue\Jobs\Job->failed() #6 vendor/laravel/framework/src/Illuminate/Queue/SyncQueue.php(36): Illuminate\Queue\SyncQueue->handleFailedJob(Object(Illuminate\Queue\Jobs\SyncJob)) #7 bootstrap/cache/compiled.php(9963): Illuminate\Queue\SyncQueue->push(Object(App\Jobs\SendInvoiceEmail)) #8 bootstrap/cache/compiled.php(9949): Illuminate\Bus\Dispatcher->pushCommandToQueue(Object(Illuminate\Queue\SyncQueue), Object(App\Jobs\SendInvoiceEmail)) #9 bootstrap/cache/compiled.php(9924): Illuminate\Bus\Dispatcher->dispatchToQueue(Object(App\Jobs\SendInvoiceEmail)) #10 bootstrap/cache/compiled.php(5726): Illuminate\Bus\Dispatcher->dispatch(Object(App\Jobs\SendInvoiceEmail)) #11 app/Http/Controllers/InvoiceController.php(418): App\Http\Controllers\BaseController->dispatch(Object(App\Jobs\SendInvoiceEmail)) #12 app/Http/Controllers/InvoiceController.php(397): App\Http\Controllers\InvoiceController->emailInvoice(Object(App\Models\Invoice), 'data:applicatio…') #13 [internal function]: App\Http\Controllers\InvoiceController->update(Object(App\Http\Requests\UpdateInvoiceRequest), '2') #14 bootstrap/cache/compiled.php(9482): call_user_func_array(Array, Array) #15 bootstrap/cache/compiled.php(9544): Illuminate\Routing\Controller->callAction('update', Array) #16 bootstrap/cache/compiled.php(9524): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\InvoiceController), Object(Illuminate\Routing\Route), 'update') #17 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #18 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #19 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #20 bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #21 bootstrap/cache/compiled.php(9525): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #22 bootstrap/cache/compiled.php(9512): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\InvoiceController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'update') #23 bootstrap/cache/compiled.php(8582): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'App\Http\Contro…', 'update') #24 bootstrap/cache/compiled.php(8569): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request)) #25 bootstrap/cache/compiled.php(8283): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #26 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #27 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #28 app/Http/Middleware/Authenticate.php(90): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #29 [internal function]: App\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure), 'user') #30 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #31 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #32 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #33 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #34 bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #35 bootstrap/cache/compiled.php(8284): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #36 bootstrap/cache/compiled.php(8275): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #37 bootstrap/cache/compiled.php(8265): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #38 bootstrap/cache/compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #39 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #40 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #41 app/Http/Middleware/StartupCheck.php(197): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #42 [internal function]: App\Http\Middleware\StartupCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #43 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #45 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #46 app/Http/Middleware/QueryLogging.php(29): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #47 [internal function]: App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure)) #48 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #49 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #50 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #51 app/Http/Middleware/DuplicateSubmissionCheck.php(36): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #52 [internal function]: App\Http\Middleware\DuplicateSubmissionCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #53 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #54 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #55 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #56 bootstrap/cache/compiled.php(3225): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #57 app/Http/Middleware/VerifyCsrfToken.php(42): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #58 [internal function]: App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #59 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #60 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #61 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #62 bootstrap/cache/compiled.php(13532): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #63 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #64 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #65 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #66 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #67 bootstrap/cache/compiled.php(12022): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #68 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #69 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #70 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #71 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #72 bootstrap/cache/compiled.php(13271): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #73 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #74 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #75 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #76 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #77 bootstrap/cache/compiled.php(13208): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #78 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #79 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #80 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #81 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #82 bootstrap/cache/compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #83 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #84 bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #85 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #86 vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #87 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #88 bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #89 bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #90 bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #91 public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #92 {main} [] []

Have you recently upgraded, if you got the code from GitHub did you run composer install?

I cloned from github and ran composer install- it is a fresh install I did this morning. Notice how the class exception is showing an empty classname?

I’m not sure, you could try running php artisan optimize

Same problem :frowning: - very frustrating as it’s a beautiful product.

It may be related to this: https://github.com/laravel/framework/issues/15891

You could try enabling queues in config/queue.php to see if it helps.

What do you mean by enabling queues, it appears to be set to “sync” at the moment, would you like me to change it to mysql or something else?

Set it to database and then run php artisan queue:listen

Yes! Thanks so much that worked! (Well no error this time) - will confirm with client later today!
Great support! Recommending to all my friends!

To confirm it was sent you can check that the jobs and failed_jobs tables are empty.

select * from jobs;
select * from failed_jobs;

2 entries in jobs; failed_jobs is empty so I think we’re good!

If there are entries in the jobs table it means the emails haven’t been sent.

You can try to manually run the job by calling php artisan queue:work.

Are there any new errors in the logs?

No new errors in the logs. All seems resolved :slight_smile:

Were the emails sent, the jobs table should be empty.

Eeek, no it’s not empty - I ran php artisan queue:work and got the following error:

[2017-01-24 08:43:34] production.ERROR: exception ‘ErrorException’ with message ‘Argument 1 passed to Illuminate\Queue\Jobs\Job::resolveAndFire() must be of the type array, integer given, called in vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php on line 49 and defined’ in vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php:124 Stack trace: #0 vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(124): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(4096, ‘Argument 1 pass…’, ‘/var/www/vhosts…’, 124, Array) #1 vendor/laravel/framework/src/Illuminate/Queue/Jobs/DatabaseJob.php(49): Illuminate\Queue\Jobs\Job->resolveAndFire(0) #2 vendor/laravel/framework/src/Illuminate/Queue/Worker.php(213): Illuminate\Queue\Jobs\DatabaseJob->fire() #3 vendor/laravel/framework/src/Illuminate/Queue/Worker.php(157): Illuminate\Queue\Worker->process(‘database’, Object(Illuminate\Queue\Jobs\DatabaseJob), 0, 0) #4 vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(126): Illuminate\Queue\Worker->pop(NULL, NULL, 0, 3, 0) #5 vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(79): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, NULL, 0, 128, false) #6 [internal function]: Illuminate\Queue\Console\WorkCommand->fire() #7 vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array) #8 vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array) #9 vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #10 vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #11 vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #12 vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #13 vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #14 vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #15 artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #16 {main} [] []

We’ve released v3.0.1 which should help.

Upgraded, didn’t help - same error :frowning:

Hmmm… I’m surprised, others have reported this issue fixed

https://github.com/invoiceninja/invoiceninja/issues/1303

Updated to 3.0.2, but I think the reason it wasn’t working on 3.0.1 is because I edited the queue.php. All work now and emails received.

Great to hear, thanks for letting us know!