segfault job after upgrade from Freepbx15 to 17

I have restored my configuration backup was made on Freepbx15 on a Freepbx 17.
I resolved almost all the issues but there is still at least one:
I get a email in every minute: Subject: Cron asterisk@freepbx [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
Body: Segmentation fault

I get segmentation fault when I run it manually:

asterisk@freepbx:~$ /usr/sbin/fwconsole job --run
Running pagingpro :: scheduler ...
Done with scheduler
Running dashboard :: scheduler ...
Done with scheduler
Running calendar :: sync ...
Starting Calendar Sync...
Finished
Done with sync
Running pms :: wu_alert ...
Done with wu_alert
Running timeconditions :: schedtc ...
==Working with TimeCondition:Munkaszüneti-nap-van-e---Támogatás==
INVERTED BLF: false (NOT_INUSE = NOT_INUSE & INUSE = INUSE)
OVERRIDE MODE: not set
Szegmentálási hiba

Then I listed the jobs:

asterisk@freepbx:~$ /usr/sbin/fwconsole job --list
+----+----------------------+-----------------------------------+--------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+
| ID | Module               | Job                               | Cron         | Next Run            | Action                                                                                                                                 | Enabled |
+----+----------------------+-----------------------------------+--------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+
| 6  | pbxmfa               | checkUserTrustedDevicesAndLicense | 0 0 * * *    | 2024-08-16 00:00:00 | Class: FreePBX\modules\Pbxmfa\Job                                                                                                      | Yes     |
| 21 | cdrpro               | livecallsync                      | */5 * * * *  | 2024-08-15 13:20:00 | Class: FreePBX\modules\Cdrpro\Job                                                                                                      | Yes     |
| 49 | pagingpro            | scheduler                         | * * * * *    | 2024-08-15 13:18:00 | Class: FreePBX\modules\Pagingpro\Job                                                                                                   | Yes     |
| 9  | dashboard            | scheduler                         | * * * * *    | 2024-08-15 13:18:00 | Class: FreePBX\modules\Dashboard\Job                                                                                                   | Yes     |
| 16 | sangomaconnect       | sync                              | */5 * * * *  | 2024-08-15 13:20:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/keep_alive.php 2>&1 >/dev/null                                                 | Yes     |
| 17 | sangomaconnect       | checkSSL                          | 0 2 * * *    | 2024-08-16 02:00:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/check_certificates_sc.php 2>&1 >/dev/null                                      | Yes     |
| 18 | sangomaconnect       | checkLicense                      | 0 1 * * *    | 2024-08-16 01:00:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/check_license_sc.php                                                           | Yes     |
| 19 | sangomaconnect       | clean                             | @daily       | 2024-08-16 00:00:00 | Command: /usr/sbin/fwconsole sc cleanGarbageDeviceData 2>&1 > /dev/null                                                                | Yes     |
| 20 | sangomaconnect       | cleanupOldChats                   | @daily       | 2024-08-16 00:00:00 | Command: /var/www/html/admin/modules/sangomaconnect/bin/cleanup_sangoma_phone_chats.php 2>&1 >/dev/null                                | Yes     |
| 28 | vqplus_callback_logs | sync                              | 59 23 * * *  | 2024-08-15 23:59:00 | Command: /usr/sbin/fwconsole vqplus daemonlog -q 2>&1 > /dev/null                                                                      | Yes     |
| 33 | sysadmin             | checkportal                       | @daily       | 2024-08-16 00:00:00 | Command: [ -e /var/www/html/admin/modules/sysadmin/bin/check_portal.php ] && /var/www/html/admin/modules/sysadmin/bin/check_portal.php | Yes     |
| 34 | sysadmin             | ddnsupdate                        | @daily       | 2024-08-16 00:00:00 | Class: FreePBX\modules\Sysadmin\Job\DdnsUpdate                                                                                         | Yes     |
| 35 | sysadmin             | checkstorage                      | @hourly      | 2024-08-15 14:00:00 | Command: [ -x /var/lib/asterisk/bin/storage.php ] && /var/lib/asterisk/bin/storage.php                                                 | Yes     |
| 36 | calendar             | sync                              | * * * * *    | 2024-08-15 13:18:00 | Class: FreePBX\modules\Calendar\Job                                                                                                    | Yes     |
| 37 | endpoint             | clearcdr                          | 5 * * * *    | 2024-08-15 14:05:00 | Class: FreePBX\modules\Endpoint\Job                                                                                                    | Yes     |
| 38 | firewall             | firewall                          | */15 * * * * | 2024-08-15 13:30:00 | Command: [ -e /etc/asterisk/firewall.enabled ] && touch /var/spool/asterisk/incron/firewall.firewall                                   | Yes     |
| 39 | firewall             | syncIDetection                    | */5 * * * *  | 2024-08-15 13:20:00 | Command: [ -e /usr/sbin/fwconsole ] && /usr/sbin/fwconsole firewall sync                                                               | Yes     |
| 40 | pms                  | wu_alert                          | * * * * *    | 2024-08-15 13:18:00 | Class: FreePBX\modules\Pms\Job                                                                                                         | Yes     |
| 41 | pms                  | mk_dirty                          | @daily       | 2024-08-16 00:00:00 | Command: /usr/sbin/fwconsole pms mk_dirty > /dev/null 2>&1                                                                             | Yes     |
| 42 | qxact_reports        | sync                              | */5 * * * *  | 2024-08-15 13:20:00 | Command: /usr/sbin/fwconsole qxactreports --sync -q 2>&1 > /dev/null                                                                   | Yes     |
| 43 | qxact_reports        | queuelogretention                 | 1 0 * * *    | 2024-08-16 00:01:00 | Class: FreePBX\modules\Qxact_reports\Job                                                                                               | Yes     |
| 44 | recording_report     | clean                             | 30 22 * * *  | 2024-08-15 22:30:00 | Command: /sbin/fwconsole recordingreports -s -c                                                                                        | Yes     |
| 45 | recording_report     | backup                            | 0 0 1 * *    | 2024-09-01 00:00:00 | Command: php /var/lib/asterisk/agi-bin/backuprecordings.php                                                                            | Yes     |
| 46 | sipstation           | check                             | @daily       | 2024-08-16 00:00:00 | Command: [ -x /var/lib/asterisk/bin/freepbx_sipstation_check ] && /var/lib/asterisk/bin/freepbx_sipstation_check 2>&1 > /dev/null      | Yes     |
| 47 | restapps             | deletesymlinks                    | 0 1 * * *    | 2024-08-16 01:00:00 | Command: /usr/sbin/fwconsole phoneapps --deletesymlinks                                                                                | Yes     |
| 48 | timeconditions       | schedtc                           | * * * * *    | 2024-08-15 13:18:00 | Class: FreePBX\modules\Timeconditions\Job                                                                                              | Yes     |
| 50 | sysadmin             | updatelicense                     | @daily       | 2024-08-16 00:00:00 | Command: [ -x /var/lib/asterisk/agi-bin/update_license.php ] && /var/lib/asterisk/agi-bin/update_license.php --delay                   | Yes     |
+----+----------------------+-----------------------------------+--------------+---------------------+----------------------------------------------------------------------------------------------------------------------------------------+---------+

It seems the “schedtc” makes the issue.

asterisk@freepbx:~$ /usr/sbin/fwconsole job --run=schedtc -vvv
asterisk@freepbx:~$

Let’s disable it:

asterisk@freepbx:~$ /usr/sbin/fwconsole job --disable=schedtc
No jobs found

If I disable it via sql then segfault is gone on run

root@freepbx:~/scripts# mysql asterisk -e "UPDATE cron_jobs set enabled=0 where jobname='schedtc'"

How can I investigate further what’s wrong with the schedtc?

It seems one of the calendars was wrong.
Created a new one and the issue is gone.