Hi there,
I’ve done a fair bit of searching around but simply couldn’t find a solution and am at my wits end.
As per the title, I’m having issues getting my recurrig invoices to send out - sending them directly through the Send Invoice button works completely fine.
The cron is currently setup under the correct user as follows (with the correct path, obviously):
* * * * * cd /path/to/ninja && /usr/bin/php7.4 artisan schedule:run >> /path/to/log/cronlog 2>&1
The log file looks as follows:
No scheduled commands are ready to run.
[2021-06-28T14:55:02+00:00] Running scheduled command: App\Jobs\Util\SchedulerCheck
No scheduled commands are ready to run.
No scheduled commands are ready to run.
No scheduled commands are ready to run.
No scheduled commands are ready to run.
[2021-06-28T15:00:01+00:00] Running scheduled command: App\Jobs\Util\ReminderJob
[2021-06-28T15:00:01+00:00] Running scheduled command: App\Jobs\Cron\RecurringInvoicesCron
[2021-06-28T15:00:01+00:00] Running scheduled command: App\Jobs\Util\SchedulerCheck
No scheduled commands are ready to run.
No scheduled commands are ready to run.
No scheduled commands are ready to run.
No scheduled commands are ready to run.
[2021-06-28T15:05:01+00:00] Running scheduled command: App\Jobs\Util\SchedulerCheck
No scheduled commands are ready to run.
No scheduled commands are ready to run.
No scheduled commands are ready to run.
And no errors in the /storage/logs/laravel.log
I’ve tried various cron permutations as explained
here
and here
with absolute paths, just using php7.4, etc.
I’m self hosting on Ubuntu 20.04 on the google cloud on a billing.example subdomain - this requires using the smtp-relay, which is configured to allow emails being sent from my server’s ip address (and are known to work, as long as they are sent manually and not through cron).
When the cronjob fires I’ll receive this error:
System failed to email invoice x
Expected Response code 250 but got an empty response
which happens on smpt relay without the SERVER_NAME= variable being set in the .env file.
At first I didn’t know what to put inside this variable, so I tried leaving it blank as well as using the domain I’m hosting it on, to no avail. I suspect this could be where my troubles are coming from.
Every google search has led me to believe there is something wrong with either my .env or relay email configuration, but I’m completely stumped as the emails work fine when being sent manually from the invoice ninja interface.
These are my settings, which I have checked over and over:
the ip address is correct and I have attempted it with TLS Require Encryption - the variables MAIL_USERNAME and MAIL_PASSWORD are blank as Require SMTP Authentication is disabled in my relay settings. And again, these all work just fine when manually sending emails through Invoice Ninja.
Am I missing something glaringly obvious here or does anyone have any ideas?