Home Forums Support There was an error saving your invoice – self host

This topic contains 82 replies, has 7 voices, and was last updated by  Hillel Coren 1 month ago.

Viewing 83 posts - 1 through 83 (of 83 total)
  • Author
    Posts
  • #5241

    TGHepburn
    Participant

    Hello; I was posting on Github but thought I should put this one here: When saving or clicking “Email Invoice” I get the message “There was an error saving your invoice Forbidden”

    I am logged in as owner.
    No errors in laravel error log file
    No erros in apache
    Latest version 2.9.3 (prepackaged )

    I’ve checked the user account settings and can’t find the reason for this error

    #5244

    Hillel Coren
    Keymaster

    It looks like a permission issue however you wouldn’t expect any permission limitations if you’re logged in as the account owner.

    Does this happen when both saving a new invoice and updating an existing invoice?

    Also, can you check is_admin is true for your user in the users table in the database.

    #5245

    TGHepburn
    Participant

    Does this happen when both saving a new invoice and updating an existing invoice?

    The only time it does not happen is when “save draft” is clicked for new invoice. I will try making new invoice and make first click “email invoice” or other

    Also, can you check is_admin is true for your user in the users table in the database.

    is_admin is set to “1”

    #5385

    Sjoerd Blom
    Participant

    I had the same issue. It turned out that the upgrade to php 7.1 caused this. I previously used php 7.0.
    So if you use 7.1 downgrading to 7.0 may solve this.

    #5389

    Hillel Coren
    Keymaster

    Thanks for letting us know, our next major release (v3.0) should hopefully solve the PHP 7.1 issues.

    #5402

    TGHepburn
    Participant

    No, I’m running PHP 7.0

    I was using an even older PHP version and upgraded to 7.0.

    Any other suggestions I could try? I’m stumped. Could it have something to do with https vs http ? I recently switched it over to secured site so I could look into getting payment gateways set up.

    #5403

    Hillel Coren
    Keymaster

    Try loading /update (or /public/update) to check that all migrations have completed.

    #5405

    TGHepburn
    Participant

    No go. I did this again for you just to be sure. Same behavior.

    I’m 2 point releases behind -your churning out the code! I will update to 2.9.5 and see if this error msg still pops up then post again.

    #5406

    Hillel Coren
    Keymaster

    I don’t think it’s likely to help.

    Can you provide more details. Did this just start happening or did you recently upgrade? If you upgraded from which version, and are you using a new server or the same one?

    #5436

    TGHepburn
    Participant

    This error happened with version 2.9.3 (I believe it was a fresh install.) I created a new sub-directory and created a certificate for it (https://subdir.example.com/) When the error occured one thing I tried was to change it back to http but this did not change the Error.

    No change in server otherwise, still my shared hosting on Funio.com

    I’m going to create another install from scratch and see if it happens again. I may be the cause of it with all the mucking around. I will use v. 2.9.3 and no encrypted web.

    #5440

    Hillel Coren
    Keymaster

    Thanks for the info!

    We haven’t heard about this problem from anyone else so it may be something specific to your setup.

    #5449

    TGHepburn
    Participant

    A fresh install did not have any errors while saving the invoice.

    I think the error was created when I changed the subdirectory name during an upgrade. .Htaccess? .ENV file? not sure. I combined too many thing into one step.

    I’m now running php 7.0 with the latest version 2.9.5 and NO ISSUES! saving/emailing/deleting (I invoiced Thor-Son-Of-Oden but he never paid Haha 🙂

    Thanks for the support!

    #5450

    TGHepburn
    Participant

    I spoke too soon!

    Second invoice I made returned the error! ARg.

    Okay, this time it’s a new install version 2.9.5. I’m tempted to give full access to anyone since I don’t even have any “real data” into the application yet. I just finished setting up paypal and wanted to test the results with a mock invoice and got the error again.

    #5451

    TGHepburn
    Participant

    I have something more to report: If I turn off “Live Preview” under /settings/account_management then No error message when I click “Email Invoice” but no Email sent. I am able to Save Invoice without error.

    With live preview ON, I cannot save or email invoice due to error.

    Should the Laravel debug bar show something under the EMAIL tab when I click “email invoice”?

    I am starting to wonder if my shared host is blocking something or I’m missing a PHP module.

    #5452

    TGHepburn
    Participant

    MORE….

    The error only occurs when I have “Attach Invoice” Checked under /settings/email_settings and I click “Email Invoice”

    I hope this helps narrow it down. I need the pdf attached when I send it.

    #5453

    Hillel Coren
    Keymaster

    Are there any errors in your server error logs?

    #5454

    TGHepburn
    Participant

    No Apache errors. No Laravel errors. I’m thinking this is js related. the error is returned quickly and no page reload. the debug bar returns nothing

    I got last hint from reading the js code that the button linked to using firebug.

    #5457

    Hillel Coren
    Keymaster

    The page uses an AJAX call so you may not see the page request, you can check the network tab in the browser debug console to see if a request is being made.

    The word ‘Forbidden’ is what’s shown when the permission checks fail. It would also explain why nothing is appearing in the logs. That said, you’re an admin so it shouldn’t fail.

    #5458

    TGHepburn
    Participant

    Just Checked: when “attach invoice” selected and click “email invoice” I get nothing logged in the browsers debug network tab, error msg appears.

    Also created a second user – Non-Admin – and had this user create invoice. Invoice saved but clicking “email” invoice” returned error.

    Is anyone else able to create this error message?

    #5464

    Hillel Coren
    Keymaster

    Could you try tracing through the code to see where it’s failing.

    If you add \Log::info('Test...'); it will appear in storage/logs/laravel-info.log.

    Here’s the relevant part of the code:

    https://github.com/invoiceninja/invoiceninja/blob/master/app/Http/Controllers/InvoiceController.php#L434

    #5513

    psychocrackpot
    Participant

    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} [] []

    #5514

    Hillel Coren
    Keymaster

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

    #5516

    psychocrackpot
    Participant

    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?

    #5518

    Hillel Coren
    Keymaster

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

    #5519

    psychocrackpot
    Participant

    Same problem 🙁 – very frustrating as it’s a beautiful product.

    #5520

    Hillel Coren
    Keymaster

    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.

    #5521

    psychocrackpot
    Participant

    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?

    #5522

    Hillel Coren
    Keymaster

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

    #5523

    psychocrackpot
    Participant

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

    #5524

    Hillel Coren
    Keymaster

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

    select * from jobs;
    select * from failed_jobs;

    #5525

    psychocrackpot
    Participant

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

    #5526

    Hillel Coren
    Keymaster

    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?

    #5527

    psychocrackpot
    Participant

    No new errors in the logs. All seems resolved 🙂

    #5528

    Hillel Coren
    Keymaster

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

    #5529

    psychocrackpot
    Participant

    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} [] []

    #5538

    Hillel Coren
    Keymaster

    We’ve released v3.0.1 which should help.

    #5539

    psychocrackpot
    Participant

    Upgraded, didn’t help – same error 🙁

    #5540

    Hillel Coren
    Keymaster

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

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

    #5541

    psychocrackpot
    Participant

    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.

    #5542

    Hillel Coren
    Keymaster

    Great to hear, thanks for letting us know!

    #5543

    TGHepburn
    Participant

    For me, still no change.

    • I’ve updated to 3.0.2 and run billing.thomashepburn.ca/public/update (zip file from website, not github)
    • I tried inserting logging \Log::info('Test...'); in invoicecontroller.php but it did not trigger as expected. I will try with new files.
    #5544

    Hillel Coren
    Keymaster

    It looks like the code link above is out of date, the relevant code is emailInvoice. It’s called in both the store and update functions.

    #5545

    psychocrackpot
    Participant

    If this helps, after I updated (from github) I ran deleted the php files in the cache folder, then ran php artisan optimize

    #5546

    TGHepburn
    Participant

    I’m on a shared host server. Not familiar with this “php artisan optimize”. Is it accessible through URL in browser?

    I’m playing with app/Http/Controllers/InvoiceController.php in an attempt to track down this error message still.

    Entered Log::info('update info');

    and got this in debug Class 'App\Http\Controllers\Log' not found/home/hepburn/public_html/billing/app/Http/Controllers/InvoiceController.php#383

    I tried with Log::error('error...'); and it logged an error in Laravel-error.log….with a mile of extra garble.

    I’m not understanding why info error logging is not working. It may be beside the point. I just want to put more meaningful info logging injected into the code to help track what causes this Error message to appear.

    I will look at the other files you’ve pointed to.

    Could it be from some cached data locally? I’ve noticed that I do not have to log in after machine reboot which should not be the case. How/where does the app check that I’m logged in and have permissions? is this info stored in a cookie? Maybe this is the issue?

    I’ve also checked behavior in MS Edge and get the same thing.

    #5548

    Hillel Coren
    Keymaster

    You need to use a backslash. ie, \Log…

    #5567

    TGHepburn
    Participant

    Yes, I am using backslash. Sorry my previous post didn’t include that. I’ve entered as you stated in reply
    #5464 above. Full line is…

    \Log::info('Test msg....');

    #5568

    Hillel Coren
    Keymaster

    In that case I’m not sure. Have you tried a clean install, transferring your data using the JSON import/export?

    I haven’t heard of this problem from any other user which makes me think the problem is with your specific install.

    #5569

    TGHepburn
    Participant

    I just finished a test on a clean install v3.0.2 with fresh data entered upon setup (new db)

    Same behavior: When I select “attach invoice” and attempt to email invoice it returns error. No attached invoice, it works fine; emails sent, yay.

    Since Phantomjs is used, I created an account and swapped the demo key with my free API. No change.

    Logic says it’s just me if attaching the invoice is popular (seems so from Q&A on Github about local phantomjs )

    I’ll keep chipping away here. Any ideas you might have just throw them my way. I’m going to have to leave it for another week after today.

    #5570

    Hillel Coren
    Keymaster

    You may want to try using a local phatomjs install

    https://github.com/invoiceninja/invoiceninja/blob/master/.env.example#L29

    #5572

    TGHepburn
    Participant

    Success! Sort of.

    There are At least TWO places to send emails from:

    1. From the Invoice Edit view where there are 4 buttons: Download PDF, Save Invoice, Email Invoice, More Actions^

    In this view, clicking on Email Invoice returns A) A prompt that says “Are You Sure?” [client name] [email address]; click yes and I get another prompt that says “There was an error saving your invoice Forbidden” with OK

    2. From the Invoice LIST VIEW you can select one (multiple?) invoices, then using the DD-Listbox (defaulted to show “Archive”), you can select “Email Invoice” which briefly shows “successfully emailed invoice” at the top of the webpage then disappears. No other prompt appears.

    Method 2 sends the email with an attached invoice!

    This I’d call a work-around. In the edit window I’m able to save the changes to an invoice. I can also download, save, and attach the pdf as an “attached document” which gets sent.

    Hope this helps.

    #5574

    Hillel Coren
    Keymaster

    Thanks, that’s helpful to know.

    #5984

    daniel_robinson
    Participant

    Same to me. Downgraded the php and problem gone. May be a bug.

    #5987

    Hillel Coren
    Keymaster

    Are you seeing the message “There was an error saving your invoice Forbidden”?

    You may want to check the database migrations completed by loading /update (or /public/update) in the your browser.

    #5990

    TGHepburn
    Participant

    This bug still persists in 3.1

    I have also noted that message is triggered when you add attachments to a quote. Remove attachments and msg goes away. This happens when “include attachments” in settings is unchecked. Have not dug further…yet (error log etc etc.)

    Which PHP version were you using and which did you downgrade to?

    #5991

    Hillel Coren
    Keymaster

    Thanks for the info! Can you please help clarify the problem, the thread includes a number of different points.

    I thought you were seeing this error with invoices, not quotes. Knowing that it’s related to documents should help us track down the problem.

    #5992

    TGHepburn
    Participant

    I now get the error on invoices AND quotes where quote has document attached.

    #5993

    Hillel Coren
    Keymaster

    I’m not sure, I’m not aware of other users seeing this problem.

    Have you tried testing a clean install on another server?

    #5994

    Hillel Coren
    Keymaster

    Re-reading the post…
    – There are a number of different issues here
    – It looks like you’ve already tried a clean install

    Can you confirm you’re seeing the exact same error: “There was an error saving your invoice Forbidden”. The word ‘Forbidden’ implies it’s an application permission issue, you can try adding return true; here:

    https://github.com/invoiceninja/invoiceninja/blob/master/app/Http/Requests/UpdateInvoiceRequest.php#L16

    #6010

    TGHepburn
    Participant

    I will get a chance to work on this in a couple of days. I will send you a screen shot of PHP modules I have active on host. Unfortunately I only have access to the one remote server right now.

    #6020

    TGHepburn
    Participant

    Yes, the message reads There was an error saving your invoice Forbidden

    I have updated to 3.1.1 then retested for bugs with no change; errors still appear when saving INVOICE and QUOTE with Document attached.

    THEN I followed your code edit suggestion. Message did NOT appear when saving a Quote with documents attached and with Invoices being saved.

    #6021

    Hillel Coren
    Keymaster

    Ok, that’s helpful. It’s clearly related to user permissions.

    I’m not sure why no one else is seeing this problem though…

    #6028

    TGHepburn
    Participant

    After installing Version 3.1.1, I am unable to consistently re-create this issue. It now seems that around one-in-10 attempts to send/save invoice/quote returns the error.

    This leads me to think it is my internet connection or something to do with the new feature which was added for editing the email (AWESOME, most loved feature yet). I do have very poor internet service (rural Canada). Possibly there is a Server/Client handshake for permissions that takes place which gets corrupted. There are large differences between upload and download speeds for me. Since nobody else is seeing this issue, It’s my best guess.

    No longer able to give a reliable way to re-create the error message, consider it solved. Thanks!

    #6029

    Hillel Coren
    Keymaster

    Great to hear!!

    #7687

    TGHepburn
    Participant

    This Bug is NOT DEAD. I am 100 percent sure this bug is related to documents being attached – Either to the invoice or documents attached to expenses which are then attached to invoices.

    I’ve noticed two things:

    When a document is attached to an invoice, the SQL statement reads:

    insert intodocuments(disk,user_id,account_id,public_id,preview,path,type,size,hash,name,width,height,updated_at,created_at) values (‘documents’, ‘1’, ‘1’, ‘4’, ‘b7bvxpderexsjfy0slbqpsbonebnednm/af7d5f4dd0338ed769c6dd3b90df857957608e8f.jpeg.x300.jpeg’, ‘b7bvxpderexsjfy0slbqpsbonebnednm/af7d5f4dd0338ed769c6dd3b90df857957608e8f.jpeg’, ‘jpeg’, ‘38801’, ‘af7d5f4dd0338ed769c6dd3b90df857957608e8f’, ‘IMG-03.jpg’, ‘320’, ‘240’, ‘2017-07-12 04:10:33’, ‘2017-07-12 04:10:33’)

    The ‘invoice_id’ is not given. I’m pretty sure this is an issue. Read on…

    At this point I cannot save the invoice without getting the error message So I click “remove file” under the thumbnail image.

    Using Laravals debug bar I cannot see any SQL asking for a delete or update to the document table. When I click on Save Draft I see this SQL

    select * fromdocumentswheredocuments.invoice_idin ('1') order byidasc

    However, a check of the ‘documents’ table reveals that nothing has changed. Also, the files are not deleted from the “Storage/documents” folder. When you view the front end it shows no attachments. That’s because every row in the documents table has the invoice_id value set to NULL.

    I have no idea how this causes the error, but I’m sure it’s doing it somehow.

    It is more complicated because the behavior changes after the very first insert of the document table. I simply wish I had more time to test.

    #7688

    Hillel Coren
    Keymaster

    The document is first saved (the insert query listed) and then when the invoice is saved the document should be linked to the invoice.

    – Are you saying this is a separate or the same issue to the one first reported?
    – Are you able to replicate the problem in a clean install?

    Until we’re able to replicate the problem it will be very hard for us to fix it.

    #7689

    TGHepburn
    Participant

    Same issue as first reported. “There was an error saving your invoice Forbidden” when either saving or sending, an invoice. I’ve narrowed it down to ONLY when a document is attached to the invoice, but not ALL WAYS. I have consistent repeatable fail with BRAND NEW install and First invoice and FIRST document attachment.

    With a brand new install and NO documents attached ANYWHERE in the DB it never happens.

    I’ve gone as far as making a completely separate CLEAN install with a test bed of known data that I import via CSV and jpeg files which are attached for test.

    I can give the front end log in for someone to try my install out.

    #7690

    Hillel Coren
    Keymaster

    I’m not sure, we still haven’t had this error reported by another user.

    If your clean install is on the same server it may be worth trying to test the app on a different server.

    #9248

    Samual
    Participant

    For future reference as this came up on google search for this error except it’ll say internal server error instead of forbidden..

    If you put a currency label on the “unit cost” table when writing a quote or invoice it will result in this error.

    For example a product being written as $50 vs 50 under the unit cost will result in an error.

    #16948

    Cyberone
    Participant

    Sorry to Bump this Thread, But this Error started occurring for me out of the blue in the last few week for two of my Installations.

    When I try to Save Draft, Mark sent, Email Invoice or Setup a Recurring Invoice I get the same error.

    There was an error saving your invoice
    Forbidden

    I have tried all of the suggestions above and it has not resolved.

    Running PHP 7, Invoice ninja 4.5.5.

    If anyone has any ideas ?

    Thanking you in advance

    Alex.

    #16949

    Hillel Coren
    Keymaster

    Are there any details in the web server error logs?

    #16950

    Cyberone
    Participant

    Hi Hillel..

    If you mean my Cpanel web server Error then Yes.. every time I try one of those functions that errors I get an error log entry as below.

    2018-11-13 00:18:25.437827 [INFO] [210.49.65.170:54554] File not found [/home/driveshare/portal.drivesharerentals.com.au/403.shtml]
    2018-11-13 00:00:59.491002 [INFO] [210.49.65.170:53989] File not found [/home/driveshare/portal.drivesharerentals.com.au/403.shtml]
    2018-11-12 23:57:39.959309 [INFO] [210.49.65.170:53963] File not found [/home/driveshare/portal.drivesharerentals.com.au/403.shtml]
    2018-11-12 22:51:58.643786 [INFO] [210.49.65.170:53343] File not found [/home/driveshare/portal.drivesharerentals.com.au/403.shtml]

    Thanks

    Alex.

    #16951

    Hillel Coren
    Keymaster

    Not sure… did anything change which caused the problem?

    #16952

    Cyberone
    Participant

    I did nothing.

    But it affected two of my Installations at the same time Different Domains, same host..

    could it be something my host has done ??

    Alex.

    #16953

    Hillel Coren
    Keymaster

    It’s possible, you may want to check with them.

    #16954

    Cyberone
    Participant

    ok

    I will check.

    Thanks

    Alex

    #17004

    Cyberone
    Participant

    Hi Again.

    I have run a few tests and this is what I have come up with.

    After Backing up to a JSON File. I did a clean install of Invoice ninja 4.5.5 via Softaculous.

    After installing a Vanilla Invoice Ninja install, everything works fantastic.

    Then I import my JSON FIle and same problem happen as above.

    So I did another Fresh install of Invoice Ninja and manually typed all of the settings into that fresh install (No Imports from Backups).

    All worked well until I went to email an invoice via the “Email Invoice” button.

    I got the same error as above and now I can not save new invoices again.

    So I think I have eliminated a problem on the web-hosts side as a fresh installation works fine.

    Do you have any other ideas I can look at as this has got me puzzled.

    Alex.

    #17005

    Hillel Coren
    Keymaster

    Sorry, not sure…

    #17006

    Cyberone
    Participant

    That’s really Disappointing..

    #17007

    Hillel Coren
    Keymaster

    What error are you seeing in the logs?

    #17013

    Cyberone
    Participant

    Web Error logs show the following error everytime the Invoice ninja error happens.

    2018-11-16 08:19:07.771369 [INFO] [210.49.65.170:63761-Q:391831817271783640-13] File not found [/home/akke/public_html/403.shtml]

    Thanks

    Alex.

    #17016

    Hillel Coren
    Keymaster

    You may want to test on a different web server

    #17031

    Cyberone
    Participant

    OK Hillel..

    You where right…. Again..

    I got this back from my webhost.

    —————————–
    I was able to replicate that error, thanks for the steps. It was hitting a 403 (forbidden) error on our end, which was most likely a false positive.

    I’ve whitelisted a security rule for you that was being tripped, and was successfully able to save the page now.
    —————————–

    My Webhost applied some security rules to all of my hosted domains.

    All works fine again…

    Thanks

    Alex.

    #17033

    Hillel Coren
    Keymaster

    Glad to hear it’s working, thanks for the update!

Viewing 83 posts - 1 through 83 (of 83 total)

You must be logged in to reply to this topic.

Posted in: