jebit
April 18, 2023, 3:19pm
1
I am trying to figure out why I can’t get the Cron job to work for this app.
I am hosting via WHC and used their one click creator to load up invoiceninja 5. The system works fine, but emails have never worked and the Cron job error is there.
Here is the cron job
cd /home/PATH/invoice.domain.com && /opt/alt/php81/usr/bin/php -d register_argc_argv=On artisan schedule:run >> /dev/null 2>&1
It’s pointed directly to the proper path. It was self created as well as I manually added one.
Here is also a portion of the email settings in the .env
MAIL_MAILER=“smtp”
MAIL_HOST=“mail.server. com”
MAIL_PORT=“587”
MAIL_USERNAME=“name @domain.com ”
MAIL_PASSWORD=“PASSWORD”
MAIL_ENCRYPTION=“tls”
MAIL_FROM_ADDRESS=“name @domain . com”
MAIL_FROM_NAME=“name”
Any help would be greatly appreciated. So far the rest seems to work, but unfortunately I can’t deply with this current setup…
Thanks!
Added space in the email .com etc so I can post “more than 2 links”
hillel
April 18, 2023, 3:28pm
2
Hi,
Are you able to try running the command from the CLI without the >> part?
david
April 18, 2023, 10:42pm
3
You may want to change QUEUE_CONNECTION=database to QUEUE_CONNECTION=sync
jebit
April 20, 2023, 12:25am
4
It was already set to sync. I’ll switch it over to database to see if that makes a difference.
@hillel I ran it without but had no luck.
Is there a way to clear out the queue in case there is something blocking it?
Edit:
I changed it to database and it went from error to install app for better performance. So maybe that worked…
But when I try and send emails. I still get item queued and nothing goes out.
david
April 20, 2023, 12:39am
5
Are there any errors in the log files? storage/logs/laravel.log
jebit
April 20, 2023, 2:29pm
6
This is what I get in the logs:
laravel.log ( ASCII text )
[2023-04-13 13:14:05] production.INFO: Broadcasting [App\Events\Invoice\InvoiceWasCreated] on channels [simple-channel] with payload:
{
“id”: “value”,
“socket”: null
}
[2023-04-20 06:20:02] production.INFO: Performing Autobilling 2023-04-20 06:20:02
I have no auto billing. Not sure if this could be it?
I have gone through the app and used the health check. Made sure everything was OK.
It appears emails do not go out still. I did however clear the cache and tried again. In case there was a backlog or something.
I’ll take a peek at my V4 config see if there is something I’m missing…
Thanks
david
April 21, 2023, 7:14am
7
can you try changing in your .env file
MAIL_MAILER=smtp
to
MAIL_MAILER=log
If you are using < 5.5.104 you’ll need to update the cache. Then try sending the emails again. This time your emails will log to the error log file, if they appear there, it means that the problem is your SMTP configuration to your mail host.