Menu

Couple of issues since upgrading to 2.7.7

2022-09-22
2022-10-06
  • Mark McElhenny

    Mark McElhenny - 2022-09-22

    Morning,

    In order to use OAUTH2.0 we have upgrade out iTop server both the iTop to 2.7.7 and also the OS Ubuntu from 16.04 to 20.04 (PHP7.0 to PHP7.4)

    Everything is working fine including the OAUTH part except for 2 Cron Jobs. The first is the one that sends out a daily report of contracts that are nearing the end. When I run the cron job manually it fails with the below error:

    PHP Fatal error: Uncaught Error: Cannot instantiate abstract class AbstractWeeklyScheduledProcess in /var/www/html/itop2.7.7/cron/cronprovidercontract.php:234
    Stack trace:
    #0 {main}
    thrown in /var/www/html/itop2.7.7/cron/cronprovidercontract.php on line 234

    Fatal error: Uncaught Error: Cannot instantiate abstract class AbstractWeeklyScheduledProcess in /var/www/html/itop2.7.7/cron/cronprovidercontract.php:234
    Stack trace:
    #0 {main}
    thrown in /var/www/html/itop2.7.7/cron/cronprovidercontract.php on line 234
    iTop: An error occurred, check server error log for more information.

    Now looking at line 234 in the php file it has the following line:

        $oExecInstance = new $sPHPClass;
    

    Is this an iTop error or is it due to us upgrading the server and in turn moving to PHP7.4 either way does anyone know how to correct this?

    Thanks in advance

     

    Last edit: Mark McElhenny 2022-09-22
  • Mark McElhenny

    Mark McElhenny - 2022-09-22

    Ok update, if I run the above cron job from my old 2.4.1 itop folder it works, so something within the iTop 2.7.7 version has changed

     
  • Mark McElhenny

    Mark McElhenny - 2022-09-22

    I've attached the cron job php file

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-10-06

    Hello,

    When updating iTop read very carefully all of the migration notes ! Sometimes customization needs to be updated...

    In your case, I understand your cronprovidercontract.php is a customized copy of webservices/cron.php ? Am I right ?
    This is a very wrong idea to do that...
    If you want to create your own background task, implement one of the children classes of iProcess.

    Here, your script is crashing because in 2.7.0 we added a new abstract class AbstractWeeklyScheduledProcess. It implements iProcess but cannot be instanciated.
    The cron.php script was modified accordingly, but of course your copy didn't.

    I strongly advise you get rid of your outdated cron.php copy and use the standard extension mechanism instead !

     

Log in to post a comment.