CRON Configuration

The cron is running as the user alltbilling@server, that is great, however i suspect the content of /home/alltbilling/public_html has wrong file permissions/owner because it was setup by root.

Try loggin in -as root this time- and perform both commands: “cd /home/alltbilling/public_html” then “ls -l” if you see root somewhere there I think that is the problem. Might look into commands as “chmod” and “chown” to fix that, but setting up from 0 (I guess the app doesn’t have usable data yet because the cron never worked) via the alltbilling user would be the way to go as described above.

Thanks for your patience on this.
I logged into WHM as root and ran the commands in terminal, here’s the response. No email received for the task that ran though.

I also went into the directory and no root.

Screenshot_19

I also tried this from the terminal and no error but also no email.

/home/alltbilling/public_html/artisan && php artisan schedule:run

Hello infowhatnowebsite-co,

First of some basic understanding: The email is not generated by the command you perform but by the cron deamon spitting out the output of the command.

/usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run is the correct command for your setup INSIDE the cron, wich will spit out the ERROR 500 when performed via the cron to your email. Performing the command manually will spit the output in your terminal.

/usr/bin/ea-php81 -d register_argc_argv=On /home/alltbilling/public_html/artisan schedule:run is correct, inside your cron, you may remove the other one there.

As to why you are getting the ERROR 500, your screenshot does not show the user owning the files, I still believe your file permissions are wrong because you unzipped the app via the root user (I can not be sure because the screenshot does not show everything) and that is why your cPanel interface does not list all the app files and the command performed gives the ERROR 500 because it cannot access all files needed.

Again, to assist you, because you obviously have root access to the server, create a test account via WHM “testninja” give in terminal access via the WHM interface. From now on, LEAVE the WHM and root terminal. Login to cPanel as the testninja account, go to the File manager, upload the invoiceninja.zip to the public_html directory, unzip it (extract it) via the cPanel file manager, rename the example.env to .env from within the cPanel file manager. This way you will make sure all permissions are correct. Then inside the cPanel interface go to MySQL Database wizard en create a database testninja_testdb and testninja_testdb user and give it a password, granting all rights from the testninja_testdb user to the testninha_testdb database. Again inside cPanel go to cron manager and setup * * * * * /usr/bin/ea-php81 -d register_argc_argv=On /home/testninja/public_html/artisan schedule:run – Now you can go to https://thedomain-u-use.for-the-test.account/setup and give in the database information you created via the MySQL Database wizard.

All should work fine this way and if that does, we are sure the initial setup, extracting and editing on the alltbilling was done incorrectly giving those errors. Please follow every step carefully.

Hope it works!

Kind regards

1 Like

Can’t tell you how grateful I am for your time on this.

Something that is clearly obvious to you looking from the outside in I had never considered.

So, with your instructions in hand I terminated the account on WHM and set a new one back up, same name etc

I then logged in to cPanel as that user

Installed SSL
Created a MySQL DB
Set the PHP version to 8.1

I then uploaded the ZIP archive for Invoice Ninja 5.5.24
I unzipped these to a temp folder
Went in, checked I could see artisan (bingo)
Then I copied these files to the public_html folder
Renamed the file .env.example to .env
Setup the cron job

Then tried to access the setup through a browser and nada.

I’ve asked the server admins to look into this and will update you as soon as I have any news.

I checked the error logs and the memory_limit was set too low so I increase dthis.

Now I have it all setup, the cron job set but I get that niggly warning triangle telling me that crons are not setup.

The cron should be set in cPanel of the newly created account, not as root obviously, having

          • /usr/bin/ea-php81 -d register_argc_argv=On /home/NEWACCOUNTNAME/public_html/artisan schedule:run

Change NEWACCOUNTNAME to the user you (re)created. After making any changes to your cron setup you’ll want to force a recheck of the cron setting. To do this navigate to http://url/update?secret=

Example: https://your.app.url/update?secret=

Good luck!

Thanks.

I did that but still I have the triangle. Very odd.

Could you please try to set the cron again and force a reset again using steps above with cron set as this path (including local):

          • /usr/local/bin/ea-php81 -d register_argc_argv=On /home/ACCOUNTNAME/public_html/artisan schedule:run

Make sure on the cron settings page inside cPanel an email is set, you should be getting mails each minute to the email address set there, if not there realy is a configuration error with the cPanel server itself rendering me out if idea’s.

If it works remember to add >> /dev/null 2>&1 after the command to stop receiving the email every minute.

          • /usr/local/bin/ea-php81 -d register_argc_argv=On /home/ACCOUNTNAME/public_html/artisan schedule:run >> /dev/null 2>&1

PS: Offcourse again edit ACCOUNTNAME to the account the invoice ninja app is on

Hope you finally will get it working now!

Kind regards

Thanks once again.

I added that cron job and waited patiently for mails, nothing.

I checked the error log, nothing.

I ran it through terminal in WHM, no error.

I’ve passed this back to the server admins, it’s so frustrating.

I have been logging into cPanel as the user so shouldn’t have any permission issue.

Let’s see what they come back with.

I heard back from the server admins and they noticed the account did not have shell access so I provided this.

The cron job does not throw up any errors.
As there are no outputs from manually running this it suggests the command is fine.
I enabled the debug mode in the Laravel software at app/config/app.php but this did not trigger any new entries to show within the storage/logs/laravel.log file suggesting the script is running without issue.

However, the little red triangle was still there.

I logged out and back in
I then ran the “/setup” again but still the triangle was there.

Still I have the warning triangle.

Can we look into this please, it’s been months now.

In addition…

Every time I view an invoice and click “Send Email” it forces me to download the invoice. What’s all that about?

Then when I click “Send” it does this again

BUT NO INVOICE IS SENT.

Are you using Firefox? It may be related.

@david do you have any suggestions for the cron issue?

I am using Firefox yes. Are you telling me that in the 21st Century you’re still designing platforms that are browser specific?

I tested in Chrome and no download was forced but I suggest you fix this bug with Firefox, it’s kind of a popular browser.

The CRON warning and jobs are still not running, months later.

You can fix this by enabling the PDF viewer in Firefox, we’re looking into making it work correctly without requiring this change.

Not sure why you’re having so much trouble with the cron, you may want to try using a different server/webhost.

Sorry Hillel but I have various installations of Invoice Ninja running on this server (v4) and to suggest using another host sounds a bit like a copout.

I’ve installed, reinstalled, tested, reinstalled as cPanel user and followed everything suggested in this post and still it refuses to work.