[Selfhosted] When sending invoice => error saving invoice

Hello,

Since 2-3 weeks can’t send invoices anymore.

When click on send invoice, then an error shows ‘ERROR: Can’t save invoice’ and the mails doesnt delivered.

My setup:

App Version: v4.5.16 White Label: No - olbihhweyypsorri6xoogscznvy8i0sl Server OS: Linux 2.6.32-954.3.5.lve1.4.64.el6.x86_64 PHP Version: 7.3.8 MySQL Version: 10.2.26-MariaDB-cll-lve

Here the last logs:

[2019-11-16 18:54:14] production.ERROR: ***Illuminate\Contracts\Filesystem\FileNotFoundException*** [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {"context":"PHP","user_id":2,"account_id":"2","user_name":"Christophe Hollebeke","method":"PUT","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36","locale":"nl","ip":"94.111.85.138","count":6,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices/73"} []

[2019-11-16 18:54:14] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“PUT”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:5,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices/73”} []

[2019-11-16 18:45:43] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“PUT”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:4,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices/73”} []

[2019-11-16 18:45:43] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“PUT”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:3,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices/73”} []

[2019-11-16 18:39:43] production.ERROR: Failed to authenticate on SMTP server with username “c.hollebeke@gmail.com” using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials w11sm18912765wra.83 - gsmtp ". Authenticator PLAIN returned Expected response code 235 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials w11sm18912765wra.83 - gsmtp ". Authenticator XOAUTH2 returned Expected response code 250 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials w11sm18912765wra.83 - gsmtp ". {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“setup”} []

[2019-11-16 18:39:23] production.ERROR: Failed to authenticate on SMTP server with username “webkust@gmail.com” using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials f17sm12936357wmj.40 - gsmtp ". Authenticator PLAIN returned Expected response code 235 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials f17sm12936357wmj.40 - gsmtp ". Authenticator XOAUTH2 returned Expected response code 250 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials f17sm12936357wmj.40 - gsmtp ". {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“setup”} []

[2019-11-14 22:15:19] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices”} []

[2019-11-14 22:15:19] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:1,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices”} []

[2019-11-03 17:37:06] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/webkust/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:6,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/olbihhweyypsorri6xoogscznvy8i0sl”} []

[2019-11-03 17:36:25] production.ERROR: Illuminate\Contracts\Encryption\DecryptException [0] : /home/webkust/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php [Line 195] => The MAC is invalid. {“context”:“PHP”,“user_id”:0,“account_id”:0,“user_name”:"",“method”:“POST”,“user_agent”:“Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:5,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“validate_two_factor/olbihhweyypsorri6xoogscznvy8i0sl”} []

Did anything change/was the app moved?

Hi Hillel,

Yes, i update the core files to the latest version.
And last week, change to antoher domain, but when see the logs, the ERROR is since 03/11/19, so i think the domain /hosting change is not the issue.

What i found yesterday, is that my company-logo was disappeared. I don’t know why, but maybe this gives the error? Upload it and now the logo is back in the invoices.
In the next 2-3 weeks have not plannend sent out invoices, so hope when sending again invoices the problem is solved with uploading the company logo.

My workflow for moving to another hosting incl. domain:

  • download all the IN files and upload on the new hosting
  • export the IN database and made a new empty database on the new hosting, import all the tables.
  • edit the env-file and adding the new database credentials.
    All this without problem.
    I can access all the things, see all my archived invoices, … so IN works perfectly, only the outgoing mails doesn’t work, but i think this is trough the error when generate the invoice.

PS: send myself test-email in settings -> Email settings in IN without problem.

Did you also copy over your documents from storage/documents?

In the future it would be helpful to mention that you’ve moved servers…

Okay,
Sorry that i not mention this info.
I copy all the files.
When looking in /storage/documents this dir is empty.

Gotcha, it could just be from the company logo. It needs to be copied over or uploaded if you move the app.

Hi Hillel Coren,
Sorry for the delay.
Today try sending a new invoice to a client, now the logo works perfect (show in the generated invoice) but don’t send the email.
Again shows error:
There was an error saving your invoice ( error in dutch: Er was een fout bij het opslaan van uw factuur
T)

Log:

[2019-11-24 10:12:32] production.ERROR: Illuminate\Contracts\Filesystem\FileNotFoundException [0] : /home/u14701p11712/domains/webkust.be/private_html/invoice/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php [Line 109] => olbihhweyypsorri6xoogscznvy8i0sl/70cf08de93973e9545b421b02f6bd928877ed686.pdf {“context”:“PHP”,“user_id”:2,“account_id”:“2”,“user_name”:“Christophe Hollebeke”,“method”:“POST”,“user_agent”:“Mozilla/5.0 (X11; CrOS aarch64 12499.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.106 Safari/537.36”,“locale”:“nl”,“ip”:“94.111.85.138”,“count”:2,“is_console”:“no”,“is_api”:“no”,“db_server”:“mysql”,“url”:“invoices”} []

PS: sending test-mail works perfect!

Tomorrow, i try re-upload the latest IN version, maybe this helps.

Enable debug mode, here the error in
debug mode

Does disabling attach PDF on Settings > Email Settings help?

Nope, it was disabled.
Now enabled, but the same error.

Sorry, not sure… I’ve found a similar issue but the cause was not copying over their documents.

https://github.com/invoiceninja/invoiceninja/issues/2005#issuecomment-379220431

Hi,

Found the problem!
In the invoice settings, there was a ‘broken’ link to an attached document ‘Terms and Conditions’. Re-upload and now all works fine!!!

Appreciate a lot your help and happy it works again.

(The 2 files probably disappeared during down/uploading to other hosting)