Jump to content

Health & Updates : Warnings and Failures


Recommended Posts

I recently reinstalled my server after a hdd failure and after I restored everything, I checked WHMCS and I get the following 1 Warning and 1 Failure:

 

System Cron Tasks

The system cron does not appear to have completed successfully within the last 24 hours. Check your activity logs or learn more about enabling the cron in our documentation.

 

Cron directory: /home/username/whmcs_files/crons.

All files are ok.

Cron jobs in cPanel are ok (like before) and email reports are ok in time, everyday.

I dont know why is this keeps comming up.

 

Website SSL

A Certificate Authority verified SSL certificate was not detected on https://clients.cubric.gr. This will prevent some features, such as OpenID Connect, from functioning. This may also affect your ability to receive PCI or other accreditation.

 

I got my SSL reinstalled. Settings for WHMCS are ok. URL is running with https and this keeps comming up. Why ?

Edited by priestakos
Link to comment
Share on other sites

Hi priestakos,

 

Thanks for getting in touch via the community forums.

 

Regarding the Cron not completing heres a few things to start with:

 

Invoice generation, payment reminders and account suspension/termination are some of the tasks handled by the daily cron job in accordance with your Automation Settings. Begin by reviewing Utilities > Logs > Activity Log and ensure you see a number of entries beginning "Cron Job" each day. The final entry every day should be "Cron Job: Completed".

 

* If you see no Cron Job entries at-all this means you have not configured your automation cron correctly, you must do this per our installation instructions. The relevant documentation can be found at http://docs.whmcs.com/Crons

 

* If you see some Cron Job entries but none after "Cron Job: Running Usage Stats Update" your cron is getting stuck at the Usage Stats Update stage. The most likely cause of this error is that you have an old server in Setup > Servers that is no longer available.

To resolve this, you should update or remove any inactive or offline servers from Setup > Servers so that they can all be connected to successfully. Or alternatively Update Usage Statistics can be disabled under Setup > Automation Settings.

 

* Finally, if you see some Cron Job entries but no "Cron Job: Completed" entry this suggests the cron is being terminated prematurely by your server. Please increase the memory_limit setting in your server's php.ini to 64M or 128MB which should easily be sufficient. Then see if things improve and you start getting the cron job report again over the next few days.

 

If the cron still doesn't complete with the increased memory limit please ensure display_errors is enabled in the server's PHP configuration and enable the Setup > General Settings > Other tab > Display Errors option, then run the cron manually by visiting the cron.php file in your browser. You should now see an error output to the screen. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:

 

*http://docs.whmcs.com/Server_Modules

*http://docs.whmcs.com/Domain_Registrars

*http://docs.whmcs.com/Common_Troubleshooting_Tips#Server_Errors

 

If all this is fine please open a ticket with your server login details so we're able to dig into this a bit further there are a couple of other things we can check but need access to your org to check it

 

Regarding SSL your client area is not loading with SSL for me could you please ensure that your system URL is set to https under Setup -> General Settings -> WHMCS System URL

Link to comment
Share on other sites

Hi Priestakos,

 

For the Health and Updates to show the cron not running successfully it does indicate there is an issue its possible that something is causing it not to complete please open a ticket with our team so we can check out the logs and your SSL isssue

 

If you can post the ticket ID In this thread I can take a look later today for you.

Link to comment
Share on other sites

  • WHMCS Support Manager

Hi,

That shows the cron completing successfully, so the Health & Updates page should get updated. There's two more things to check:

 

  1. Please enable the Setup > General Settings > Other tab > MySQL Debug option.
    Then when the cron next runes, let me know if any extra errors are logged in the activity log
    After the cron has run, please switch the MySQL Debug option off.
     
  2. Add this line to your configuration.php file:
    $disable_hook_loading = true;
    


    Run the cron.php script, and let me know if that helps. If it does- it means an after-market customised or action hook using the AfterCronJob action hook point is failing or causing an error, which means the Health & Updates page doesn't get updated. You'd need to contact the vendor of the customisation for a fix.
     
    Please then remove the line from your configuration.php file.

Link to comment
Share on other sites

John, after I did step 2 "All 18 health checks passed!", but Im wondering why my hook is not running.

 

I added 4 functions with AfterCronJob. I tried to run them and I get PHP Fatal error: Call to undefined function add_hook()

 

No further error logs or activity logs for this hook.

 

<?php

if (!defined("WHMCS")) die("This file cannot be accessed directly");

use Illuminate\Database\Capsule\Manager as Capsule;

function dailycron_clients()
{
   global $return;

   $clients = Capsule::table('tblclients')->where('status', 'Closed')->get();

   $pdo = Capsule::connection()->getPdo();
   $pdo->beginTransaction();

   try {
       $statement = $pdo->prepare(
           'CREATE TABLE IF NOT EXISTS `tblclients_backup` LIKE `tblclients`'
       );
       $statement->execute();
       $pdo->commit();

       Capsule::table('tblclients_backup')->insert($clients);

       $return['success']['clients'] = $clients->count() . 'Clients transferred';
       logActivity($return['success']['clients']);
   } catch (\Exception $e) {
       echo "Uh oh! {$e->getMessage()}";
       $pdo->rollBack();
   }
}

function dailycron_domains()
{
   global $return;

   $domains = Capsule::table('tbldomains')->where('status', 'Expired')->get();

   $pdo = Capsule::connection()->getPdo();
   $pdo->beginTransaction();

   try {
       $statement = $pdo->prepare(
           'CREATE TABLE IF NOT EXISTS `tbldomains_backup` LIKE `tbldomains`'
       );
       $statement->execute();
       $pdo->commit();

       Capsule::table('tbldomains_backup')->insert($domains);

       $return['success']['domains'] = $domains->count() . 'Domains transferred';
       logActivity($return['success']['domains']);
   } catch (\Exception $e) {
       echo "Uh oh! {$e->getMessage()}";
       $pdo->rollBack();
   }
}

function dailycron_hosting()
{
   global $return;

   $hosting = Capsule::table('tblhosting')->where('domainstatus', 'Terminated')->whereIn('packageid', [1,2,3,4,5])->get();

   $pdo = Capsule::connection()->getPdo();
   $pdo->beginTransaction();

   try {
       $statement = $pdo->prepare(
           'CREATE TABLE IF NOT EXISTS `tblhosting_backup` LIKE `tblhosting`'
       );
       $statement->execute();
       $pdo->commit();

       Capsule::table('tblhosting_backup')->insert($hosting);

       $return['success']['hosting'] = $hosting->count() . 'Hosting accounts transferred';
       logActivity($return['success']['hosting']);
   } catch (\Exception $e) {
       echo "Uh oh! {$e->getMessage()}";
       $pdo->rollBack();
   }
}

function dailycron_sendAdminEmail() {
   global $return;

   $command = "sendadminemail";
   $adminuser = "System";
   $values["customsubject"] = 'Daily Cron Report';
   $values["custommessage"] = $return;
   $values["type"] = "support";
   $values["deptid"] = 2;

   $results = localAPI($command,$values,$adminuser);

   if ($results['result'] == 'success') {
       logActivity('Daily Cron Report '.$results['message']);
	return true;
   } else if ($results['result'] == 'error'){
       logActivity('Daily Cron Report Failed.'.$results['message']);
   }
}

add_hook('AfterCronJob', 1, 'dailycron_clients');
add_hook('AfterCronJob', 2, 'dailycron_domains');
add_hook('AfterCronJob', 3, 'dailycron_hosting');
add_hook('AfterCronJob', 4, 'dailycron_sendAdminEmail');

Link to comment
Share on other sites

  • 4 months later...

Hi WHMCS ChrisD,

 

do you know if WHMCS is looking for a particular CA?

 

I'm having the same problem as above with a Health & Update warning: A Certificate Authority verified SSL certificate was not detected.

 

I have a valid CA installed and I have my system URL set to https under Setup -> General Settings -> WHMCS System URL and all pages show https in the status bar.

 

Apparently, WHMCS was requesting to manually install the CA bundle for the SSL certificate on my site. We've done that and have successfully re-installed the SSL certificate and full CA bundle but still get the warning. Are they looking for a particular CA like an EV certificate?

Link to comment
Share on other sites

  • 5 weeks later...
Hi,

WHMCS is checking this by making a cURL connection to the WHMCS System URL and looking for a 200 response:

 

curl -I https://domainhere.com

 

Any response code other than 200 will produce this error on the Health Status page.

 

OK, after seeing this, and now testing, I see where the issue is. Your example states that it looks for https://domainhere.com to verify. However, for the WHMCS System URL setting, you have the following instructions for this field: The URL to your WHMCS installation (SSL Recommended) eg. https://www.example.com/members/.

 

My guess is that everyone seeing this issue, much like myself, has always had that field filled with https://www.mydomain.com/whmcsdirectory/'>https://www.mydomain.com/whmcsdirectory/ as you instruct. Once I removed the directory from this setting to just have https://www.mydomain.com there, the check for Website SSL passes. So, either you need to update the Website SSL option to account for people following your instructions for that setting, or update the instructions for that page, assuming not having the full URL to the WHMCS directory doesn't cause some other issue.

Link to comment
Share on other sites

OK, after seeing this, and now testing, I see where the issue is. Your example states that it looks for https://domainhere.com to verify. However, for the WHMCS System URL setting, you have the following instructions for this field: The URL to your WHMCS installation (SSL Recommended) eg. https://www.example.com/members/.

 

My guess is that everyone seeing this issue, much like myself, has always had that field filled with https://www.mydomain.com/whmcsdirectory/'>https://www.mydomain.com/whmcsdirectory/ as you instruct. Once I removed the directory from this setting to just have https://www.mydomain.com there, the check for Website SSL passes. So, either you need to update the Website SSL option to account for people following your instructions for that setting, or update the instructions for that page, assuming not having the full URL to the WHMCS directory doesn't cause some other issue.

 

Following up on this, after testing, as expected, I think this is something you need to address and fix with the way it does the Website SSL Health Check. Changing the WHMCS System URL to not include the directory where WHMCS is installed just ends up breaking the site, such as the LiveHelp integration, among other functions.

Link to comment
Share on other sites

  • 2 weeks later...

For info, I've got a bug filed against this (#CORE-10834) - the reason this is often being seen is that the curl command is triggering a mod security rule due to no useragent being passed with the curl connection, therefore as WHMCS does not see a 200 response it shows as an SSL issue.

Link to comment
Share on other sites

  • 3 years later...
On 27/01/2017 at 12:04 PM, WHMCS John said:

Hi,

WHMCS is checking this by making a cURL connection to the WHMCS System URL and looking for a 200 response:

 


curl -I https://domainhere.com
 

Any response code other than 200 will produce this error on the Health Status page.

I have tried this and i get the status code of 200 and i still get the error in the health status page

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated