Home Forums Support Emails not sending

This topic contains 30 replies, has 6 voices, and was last updated by  billyggla 4 weeks, 1 day ago.

Viewing 31 posts - 1 through 31 (of 31 total)
  • Author
    Posts
  • #15174

    inspirednz
    Participant

    Hi folks,

    This is with v4.5, although it’s been happening for months (so with earlier versions).

    It is self-hosted.

    Mailgun is correctly configured, and the test email goes out fine.

    Recurring invoice reminders are not sending out.

    I have cron set up as per instructions here.

    This error shows up every day in the laravel-error.log file:

    [2018-07-13 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/app/Console/Commands/SendReminders.php 
    [Line 210] => Undefined property: stdClass::$rates  {"context":"PHP","user_id":0,"account_id":0,"user_name":"",
    "method":"GET","user_agent":"","locale":"en","ip":"127.0.0.1","count":1,
    "is_console":"yes","is_api":"no","db_server":"mysql","url":"/"} []

    (carriage returns in above output were added by me, as the forum is not displaying CODE or BLOCKQUOTE correctly. It runs off the screen)

    When I look up the invoices in the system, they are in a Draft status. That makes no sense to me. I can manually make them send out (“Email Invoice” button), and they go out.

    Please advise what the issue is.

    Thanks very much,

    Jonathan

    • This topic was modified 5 months, 1 week ago by  inspirednz.
    • This topic was modified 5 months, 1 week ago by  inspirednz.
    • This topic was modified 5 months, 1 week ago by  inspirednz.
    • This topic was modified 5 months, 1 week ago by  inspirednz.
    • This topic was modified 5 months, 1 week ago by  inspirednz.
    #15178

    Hillel Coren
    Keymaster

    Can you check the auto-send workflow checkbox on Settings > Invoice Settings

    #15181

    inspirednz
    Participant

    Hi Hillel.
    It was checked.
    Please see the update in my question. I’ve included an error that occurs daily.

    #15182

    Hillel Coren
    Keymaster

    Are you still seeing the error with v4.5?

    #15183

    inspirednz
    Participant

    I couldn’t say. I just updated about 30 minutes ago.

    #15184

    Hillel Coren
    Keymaster

    I don’t believe that error is related, it should be fixed with v4.5.

    Sorry, I’m not sure why the emails aren’t being sent…

    #15185

    inspirednz
    Participant

    I just ran send-invoices and send-reminders manually. Send-invoices reported back with:

    Fri, 13 Jul 2018 09:57:33 +0000 Running SendRecurringInvoices…
    Fri, 13 Jul 2018 09:57:33 +0000 2 recurring invoice(s) found
    Fri, 13 Jul 2018 09:57:33 +0000 0 due recurring invoice instance(s) found
    Fri, 13 Jul 2018 09:57:33 +0000 0 recurring expenses(s) found
    Fri, 13 Jul 2018 09:57:33 +0000 Done

    However, the two invoices that were generated (last month) as still sitting there in Draft status, unsent. The error did not occur in the log after doing this manual send-invoices command.

    #15186

    Hillel Coren
    Keymaster

    I’d suggest trying to create a new test recurring invoice and then run the script.

    #15187

    inspirednz
    Participant

    I set up a new recurring invoice. Due for sending out today.

    Running the send-invoices script manually, I get this output

    Fri, 13 Jul 2018 10:03:27 +0000 Running SendRecurringInvoices...
    Fri, 13 Jul 2018 10:03:27 +0000 3 recurring invoice(s) found
    Fri, 13 Jul 2018 10:03:27 +0000 Processing Invoice: 14
    Fri, 13 Jul 2018 10:03:28 +0000 Not billed - Sending Invoice
    Fri, 13 Jul 2018 10:03:28 +0000 0 due recurring invoice instance(s) found
    Fri, 13 Jul 2018 10:03:28 +0000 0 recurring expenses(s) found
    Fri, 13 Jul 2018 10:03:28 +0000 Done

    So it detected the new invoice, and indicates sending it. But it is still sitting there as a draft. Not sent.

    #15188

    inspirednz
    Participant

    Also, when I view the newly created Recurring invoice editor, it shows, “Sent Last: 13-Jul-2018”. So the system seems to think it’s sending them. But it’s generating an invoice, and leaving it in Draft, and not sending it.

    • This reply was modified 5 months, 1 week ago by  inspirednz.
    #15190

    Hillel Coren
    Keymaster

    One thought is maybe the CLI version isn’t getting the correct .env parameters.

    You can check it by running: php artisan tinker

    And then: env('__parameter_name__');

    #15191

    inspirednz
    Participant

    It returns null

    #15192

    inspirednz
    Participant

    I just noticed the owner permissions on the content of htdocs folder was all over the place. Many were correct, many were not. Including the .env files, had incorrect ownership.

    I’ve set them all to what the server requries.

    Is there anything I need to do to get the environment parameters read into where there are needed?

    #15193

    Hillel Coren
    Keymaster

    I’m not sure, you may need to ask your webhost for help.

    #15194

    inspirednz
    Participant

    I am the web host.

    It’s a VM with WordPress and Invoice Ninja running on it.
    WP is running fine. Invoice Ninja is running mostly fine, except for the emails not going out.

    If I was to ask the web host for help, what would I be asking them to do? I’ll need to do those things myself.

    #15195

    Hillel Coren
    Keymaster

    I can help with the app but it seems like the problem is related to your specific server configuration.

    I’m a developer not a systems person, maybe someone else will have more advice.

    #15196

    inspirednz
    Participant

    Okay. Thanks for trying.

    It seems odd to me that I can send test emails, and can manually send payment notices.
    I notice, however, that when I manually send one of the recurring invoices (which is sitting there in Draft status), it appears to have sent, but then it remains in Draft status, and Mailgun does not show it was sent (so it’s not being sent).

    Could all that be environment related? Seems more likely to be something with the app. Does it not?

    #15197

    Hillel Coren
    Keymaster

    Have you run config:cache, if yes you’d need to run config:clear

    #15198

    inspirednz
    Participant

    I am not sure where I’d be running that. Is it a command for ../artisan ?

    #15199

    inspirednz
    Participant

    I figured out it’s an artisan command. I’ve run it. Came back with ‘Configuration cache cleared!’

    How would I know if this worked? By trying to send an invoice?

    #15200

    Hillel Coren
    Keymaster

    Yes, that’s the best way.

    #15249

    ccall48
    Participant

    I am having the exact same problem on self hosted – the test email sends fine, email and invoice and it says sent successfully however it doesn’t send.

    I have ran all the commands from above

    $php artisan tinker
    >>>env(‘__parameter_name__’);
    = NULL

    $php artisan config:cache
    >Configuration cache cleared!
    >Configuration cached successfully!

    $php artisan config:clear
    >Configuration cache cleared!

    Logged out and logged back in, back to invoice and email goes through and says sent successfully however it doesn’t go.

    I’m running LAMP stack on a (raspbian stretch) on an rpi3, using php version 7.0.

    I’m probably at my limit for checking on possible causes, if you think of anything I can try please let me know.

    Cheers Cory.

    #15250

    Hillel Coren
    Keymaster

    Have you checked for any errors in storage/logs/laravel-error.log

    #15257

    ccall48
    Participant

    Hi Hillel,

    There was only 2 or 3 timeouts for the mail server so I’m not sure where all the other emails went…

    I think the issue may have something to do with my web hosting providers email settings, as I plugged my ISP email credentials and it seems to work fine with them.

    I’m not even sure who I would contact to see the logs on my web host’s end…

    #15258

    Hillel Coren
    Keymaster

    You can also see the error in the app when logged in by viewing /errors

    #15310

    inspirednz
    Participant

    @ccall48
    I’ve be grateful to hear if you find a solution to this.

    I was not able to, which is rather annoying, as it makes Invoice Ninja rather useless as an automated invoicing system.

    By the way… is your server stack a Bitnami stack, by chance?

    Cheers,

    Jonathan

    • This reply was modified 5 months ago by  inspirednz.
    #15311

    inspirednz
    Participant

    Hillel,

    I am seeing these errors (using the /errors view)

    [2018-07-19 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-18 08:00:01] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-17 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-16 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-15 08:00:01] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-14 08:00:02] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/cache/eb/de/ebdea3620f4144a57de2a68a23251f5df5b471a7): failed to open stream: Permission denied {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","user_agent":"","locale":"en","ip":"52.175.232.124","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"/"} []
    
    [2018-07-13 11:23:32] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"api/invoices"} []
    
    [2018-07-13 11:23:31] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices"} []
    
    [2018-07-13 11:22:12] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"GET","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices/17/edit"} []
    
    [2018-07-13 11:22:11] production.ERROR: ***ErrorException*** [0] : /opt/bitnami/apps/invoicing/htdocs/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php [Line 122] => file_put_contents(/opt/bitnami/apps/invoicing/htdocs/storage/framework/sessions/X8cwQ3jtoFgFCE9Zfm9JRjZbn9cf0CQmbw0vOtod): failed to open stream: Permission denied {"context":"PHP","user_id":1,"account_id":1,"user_name":"Jonathan Evatt","method":"PUT","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:61.0) Gecko/20100101 Firefox/61.0","locale":"en","ip":"122.57.248.122","count":1,"is_console":"no","is_api":"no","db_server":"mysql","url":"invoices/17"} [] 

    Looks like there are permissions errors.

    What are the correct file and folder permissions for InvN?

    #15313

    ccall48
    Participant

    @inspirednz

    It works with my isp smtp ssl email settings, just not my domain web host who hosts my FQDN – which I don’t exactly understand why yet as no error logs on my end flag a problem – if I hosted the site with them the sendmail option would probably work through their server however I’m currently running invoice ninja in parallel with my current system to see if it is beneficial to change over.

    I’m not using a bitnami stack, I’m using LAMP stack (Linux, Apache2, Mysql/MariaDB, PHP) directly on one of my raspberry pi 3’s.

    I’m not a macintosh user which it looks like you are? It looks like you’re having a few problems there looking at your error logs above make sure your ninja files and folders are all owned by the web server with I think it was permissions of 755. Check the link below for for information on permissions.

    https://invoice-ninja.readthedocs.io/en/latest/install.html

    I don’t know how computer proficient you are but failing that, can you back up your database and try a docker version?

    #16744

    anristudio
    Participant

    I had same issue on self hosted v4.5.5 Log was showing email sent however there was no email received. Changed the following: System Settings > Email Settings > from Sendmail to Mail and I was able to send emails again. I hope this helps someone.

    • This reply was modified 1 month, 4 weeks ago by  anristudio.
    #17000

    Hansp
    Participant

    Did you guys have any luck figuring this out?

    Still having the exact same issue.
    All recurrent invoices remain as Draft

    #17040

    billyggla
    Participant

    Have you enabled proc_open?

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

You must be logged in to reply to this topic.

Posted in: