Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught Error: Call to a member function set() on null in include/class.schedule.php:370 #6167

Open
tarekfellah opened this issue May 16, 2022 · 8 comments

Comments

@tarekfellah
Copy link

tarekfellah commented May 16, 2022

Prerequisites

[] Do you have any errors in the PHP error log, or javascript console? Yes
[
] Did you check the osTicket forums? Yes
[*] Did you perform a cursory search to see if your bug or enhancement is already reported? Yes

Description

I tried to upgrade Osticket from 1.12 to 15.7, i followed all steps in this docs link but the upgrade failed.
The PHP Error
PHP Fatal error: Uncaught Error: Call to a member function set() on null in /public_html/include/class.schedule.php:370
Stack trace:
#0 /include/upgrader/streams/core/00c949a6-8b923d61.task.php(9): Schedule::create(Array)
#1 /include/class.upgrader.php(348): ScheduleCreator->run(30)
#2 /include/class.upgrader.php(121): StreamUpgrader->doTask()
#3 /include/ajax.upgrader.php(35): Upgrader->call('doTask', Array)
#4 /include/class.dispatcher.php(145): UpgraderAjaxAPI->upgrade()
#5 /include/class.dispatcher.php(38): UrlMatcher->dispatch('/upgrader', NULL)
#6 /scp/ajax.php(316): Dispatcher->resolve('/upgrader')
#7 {main}
thrown in /include/class.schedule.php on line 370

The database size is big about 50G

Steps to Reproduce

  1. Upload backup files
  2. Add database
  3. change ost-config.php
  4. click upgrade button
  5. The process tooke some time (3-4 minutes)
  6. The upgrade failed

Expected behavior: Upgrade successfully made

Actual behavior: Upgrade failed

Versions

image

OS: Centos 7.9
WHM/Cpanel v102.0.15
Firefox 99.0 (64-bit)

@protich
Copy link
Member

protich commented May 16, 2022

Looks like the issue happens when importing default schedules. Did you get any SQL errors related to schedule table?

@tarekfellah
Copy link
Author

Where can i find this errors?

@JediKev
Copy link
Contributor

JediKev commented May 16, 2022

@tarekfellah

In your MySQL error logs. You can check your MySQL config or consult the MySQL documentation to find the path to your MySQL error logs.

You can also check the osTicket System Logs to see if any SQL Errors were logged there as well.

Cheers.

@tarekfellah
Copy link
Author

I found this error
[ERROR] /usr/sbin/mysqld: Table './dev8_osticket_30_04_22/ost_file_chunk' is marked as crashed and last (automatic?) repair failed

@tarekfellah
Copy link
Author

I increased the max_execution_time and for 2 times the upgrade works successfully!

@tarekfellah
Copy link
Author

@JediKev @protich
I repeated the upgrade on production, now i got DB Error #1062
[INSERT INTO ost_scheduleSETid= 1,flags= 1,name= 'Monday - Friday 8am - 5pm with U.S. Holidays',created= NOW(),updated= NOW()] Duplicate entry '1' for key 'PRIMARY'<br /> <br /> ---- Trace ----<br /> #0 (racine)/include/mysqli.php(201): osTicket-&gt;logDBError('DB Error #1062', '[INSERT INTOo...')
#1 (racine)/include/class.orm.php(3466): db_query('INSERT INTO os...', true, true)<br /> #2 (racine)/include/class.orm.php(658): MySqlExecutor-&gt;execute()<br /> #3 (racine)/include/class.schedule.php(319): VerySimpleModel-&gt;save(false)<br /> #4 (racine)/include/class.schedule.php(364): Schedule-&gt;save()<br /> #5 (racine)/include/class.schedule.php(369): Schedule::create(Array)<br /> #6 (racine)/include/upgrader/streams/core/00c949a6-8b923d61.task.php(9): Schedule::__create(Array)<br /> #7 (racine)/include/class.upgrader.php(348): ScheduleCreator-&gt;run(30)<br /> #8 (racine)/include/class.upgrader.php(121): StreamUpgrader-&gt;doTask()<br /> #9 (racine)/include/ajax.upgrader.php(35): Upgrader-&gt;__call('doTask', Array)<br /> #10 (racine)/include/class.dispatcher.php(145): UpgraderAjaxAPI-&gt;upgrade()<br /> #11 (racine)/include/class.dispatcher.php(38): UrlMatcher-&gt;dispatch('/upgrader', NULL)<br /> #12 (racine)/scp/ajax.php(316): Dispatcher-&gt;resolve('/upgrader')<br /> #13 {main}

What i noticed is that cron job was executing, it can be the cause of the problem?

@tarekfellah
Copy link
Author

Any solution?

@tarekfellah
Copy link
Author

I fixed the problem by migrating to new server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants