Hello, I'm running into an issue upgrading one of my helpdesks.
I have ran the update on another helpdesk that was exactly the same base files successfully, so I am stumped why this other helpdesk is not working.

System Info:
Running on Server 2019, IIS 10.0.17763.1
PHP7.3.21 - migrating to 8.1.16
MySQL 8.0.19

When doing the upgrade there are no plugins as I have disabled them, then deleted them from the web interface, then physically removed the files after uploading the new files to the web folder.

I get green check boxes on the upgrade page, however I get the following stack trace:

[19-Apr-2023 19:56:35 UTC] PHP Fatal error: Uncaught InconsistentModelException: Unable to prepare query: SELECT A1.* FROMost_email_accountA1 WHERE A1.type= 'smtp' AND A1.type= 'smtp' AND A1.email_id= 1 in C:\inetpub\wwwroot\helpdesk\include\class.orm.php:3483
Stack trace:
#0 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(3529): MySqlExecutor->execute()
#1 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(2010): MySqlExecutor->getArray()
#2 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(2054): ModelInstanceManager->{closure}()
#3 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(2033): CallbackSimpleIterator->next()
#4 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(2042): CallbackSimpleIterator->rewind()
#5 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(1713): CallbackSimpleIterator->valid()
#6 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(1723): CachedResultSet->fillTo()
#7 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(1337): CachedResultSet->asArray()
#8 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(1360): QuerySet->all()
#9 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(606): QuerySet->one()
#10 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(381): VerySimpleModel::lookup()
#11 C:\inetpub\wwwroot\helpdesk\include\class.orm.php(417): VerySimpleModel->get()
#12 C:\inetpub\wwwroot\helpdesk\include\class.email.php(210): VerySimpleModel->__get()
#13 C:\inetpub\wwwroot\helpdesk\include\class.mailer.php(35): Email->getSmtpAccount()
#14 C:\inetpub\wwwroot\helpdesk\include\class.email.php(231): osTicket\Mail\Mailer->__construct()
#15 C:\inetpub\wwwroot\helpdesk\include\class.email.php(245): Email->send()
#16 C:\inetpub\wwwroot\helpdesk\include\class.upgrader.php(204): Email->sendAlert()
#17 C:\inetpub\wwwroot\helpdesk\include\class.setup.php(115): StreamUpgrader->onError()
#18 C:\inetpub\wwwroot\helpdesk\include\class.setup.php(69): SetupWizard->abort()
#19 C:\inetpub\wwwroot\helpdesk\include\class.setup.php(44): SetupWizard->load_sql()
#20 C:\inetpub\wwwroot\helpdesk\include\class.upgrader.php(379): SetupWizard->load_sql_file()
#21 C:\inetpub\wwwroot\helpdesk\include\class.upgrader.php(112): StreamUpgrader->upgrade()
#22 C:\inetpub\wwwroot\helpdesk\include\ajax.upgrader.php(42): Upgrader->upgrade()
#23 C:\inetpub\wwwroot\helpdesk\include\class.dispatcher.php(153): UpgraderAjaxAPI->upgrade()
#24 C:\inetpub\wwwroot\helpdesk\include\class.dispatcher.php(40): UrlMatcher->dispatch()
#25 C:\inetpub\wwwroot\helpdesk\scp\ajax.php(327): Dispatcher->resolve()
#26 {main}
thrown in C:\inetpub\wwwroot\helpdesk\include\class.orm.php on line 3483

Thank you in advance for any assistance you may provide.

  • KevinTheJedi replied to this.
  • After looking at further log files I found the issue:
    [CREATE TABLEost_plugin_instance(idint(11) unsigned NOT NULL AUTO_INCREMENT,plugin_idint(11) unsigned NOT NULL,flagsint(10) NOT NULL DEFAULT 0,namevarchar(128) NOT NULL DEFAULT '',configtext DEFAULT NULL,notestext DEFAULT NULL,createddatetime NOT NULL,updateddatetime DEFAULT NULL, PRIMARY KEY (id), KEYplugin_id(plugin_id) ) DEFAULT CHARSET=utf8] Table 'ost_plugin_instance' already exists

    I ended up making my backups, disabling all plugins that I had, followed by deleting them from the web interface.
    I then dropped the ost_plugin_instance from my database and ran the update.

    Successful on the first try.

    Just wanted to make sure I answered my own issue with the resolution.

    dburson

    Upgrade has an error and trying to send an email to the admin letting them know but since it isn’t upgraded the database tables don’t match so it’s failing. You can look at the system logs to see if it logged any upgrader errors.

    Cheers.

    Thank you, I'll look back through the log files and see if I can find anything logged. The admin console shows several completed updates up to 1.17.3, then the fatal error that isn't really listed, just the stack trace.

    Hopefully I can get this done before we migrate our systems to Microsoft 365.

    5 days later

    After looking at further log files I found the issue:
    [CREATE TABLEost_plugin_instance(idint(11) unsigned NOT NULL AUTO_INCREMENT,plugin_idint(11) unsigned NOT NULL,flagsint(10) NOT NULL DEFAULT 0,namevarchar(128) NOT NULL DEFAULT '',configtext DEFAULT NULL,notestext DEFAULT NULL,createddatetime NOT NULL,updateddatetime DEFAULT NULL, PRIMARY KEY (id), KEYplugin_id(plugin_id) ) DEFAULT CHARSET=utf8] Table 'ost_plugin_instance' already exists

    I ended up making my backups, disabling all plugins that I had, followed by deleting them from the web interface.
    I then dropped the ost_plugin_instance from my database and ran the update.

    Successful on the first try.

    Just wanted to make sure I answered my own issue with the resolution.

    Write a Reply...