Jump to content

Cron Error


DesComm

Recommended Posts

When the CRON job runs the following error happens:

 A non well formed numeric value encountered in ..........VMS/core/common/StatsData.class.php on line 171

It continues running and does the following"

  • Reset PIREP Counts
  • Updating Total Hours Count (question is always shows "found 1 flight hours for number" regardless of number of hours a pilot has - is this correct?)
  • Now counting from PIREPS - Found 125774:08:00 total hours, updated

Any fixes for the error?

 

Link to comment
Share on other sites

167      * Get all of the months since a certain date
168     */
169    public static function getMonthsSinceDate($start) {
170 
171      $key_month = date('MY', $start);
172        $key = 'months_since_' . $key_month;
173        $months = CodonCache::read($key);

Link to comment
Share on other sites

  • 2 weeks later...
1 hour ago, Nabeel said:

It's best to keep it here in case it helps anyone else. Was there an output from the $start? What if you run the script "by hand" on the command line?

Output is the same with and w/o $start

 

When run manually here is what shows:

  1. in /var/www/vhosts/,,,,,,.com/test.,,,,,,,.com/core/common/StatsData.class.php on line 171
  2. Reset PIREP Counts - list of pilots
  3. Updating Total Hours Count - calculating hours this OK
  4. Now counting from PIREPS - OK  Found 127473:46:00 total hours, updated

When CRON is run this is the message that system sends:

Notice: A non well formed numeric value encountered in /var/www/vhosts/,,,,,,.com/test.,,,,,,,.com/core/common/StatsData.class.php on line 171
        <div id="codon_crit_error"
            style="font-family: 'Lucida Sans',Verdana;border:#999 1px solid;background-color:#fff;padding:20px 20px 12px 20px;">
            <h1 style="font-family: verdana; font-weight:16px;font-size:18px;color:#6B001B;margin:0 0 4px 0;">An Error Was Encountered</h1>
            <p style="font-size: 16px; color: #001B6B">Unauthorized access - Invalid Permissions.</p>
            <p style="font-size: 10px;"><center><a href="http://test.,,,,,,,,.com">Return to Homepage</a></p>
        </div>

 

 

Link to comment
Share on other sites

  • Administrators

Ok, so it's not passing in the start date. Find out where that's being called from and see if you can trace the call from there. Also, it's a notice error, so you can probably just hide it. Does the thing you're trying to do actually work, though? There's also this...

            <p style="font-size: 16px; color: #001B6B">Unauthorized access - Invalid Permissions.</p>
 

Check the permissions of your files

Link to comment
Share on other sites

This from the original file StatsData.Class.php  Here is the section w/ Line 171

 

    /**
     * Get all of the months since a certain date
     */
    public static function getMonthsSinceDate($start) {
        
        $key_month = date('MY', $start);   (note this is Line 171)
        $key = 'months_since_' . $key_month;
        $months = CodonCache::read($key);

        if ($months === false) {
            if (!is_numeric($start)) {
                $start = strtotime($start);
            }

            $end = date('Ym');

            do {
                # Get the months
                $month = date('M Y', $start);
                $months[$month] = $start; # Set the timestamp
                $start = strtotime('+1 month +1 day', strtotime($month));

                # Convert to YYYYMM to compare
                $check = intval(date('Ym', $start));

            } while ($check <= $end);

            CodonCache::write($key, $months, 'long');
        }

        return $months;
    }

    /**

Link to comment
Share on other sites

  • 2 months later...

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.   Restore formatting

  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.

Loading...
×
×
  • Create New...