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

DB Error #1062 in System Logs osTicket (v1.17.3) #51

Open
leon1298 opened this issue May 17, 2023 · 1 comment
Open

DB Error #1062 in System Logs osTicket (v1.17.3) #51

leon1298 opened this issue May 17, 2023 · 1 comment

Comments

@leon1298
Copy link

When the plugin is active, it generates a "Duplicate entry" error in the osTicket system logs every time it runs (every cron which i have setup to run every 2 min).

The error message is as follows:

DB Error #1062
[INSERT INTO ost_config SET key = 'last-run', value = 1684269962, updated = NOW()] Duplicate entry 'last-run' for key 'ost_config.namespace'

---- Backtrace ----
#0 (root)/include/mysqli.php(211): osTicket->logDBError()
#1 (root)/include/class.orm.php(3482): db_query()
#2 (root)/include/class.orm.php(658): MySqlExecutor->execute()
#3 (root)/include/class.config.php(181): VerySimpleModel->save()
#4 (root)/include/class.config.php(114): ConfigItem->save()
#5 (root)/include/class.config.php(124): Config->create()
#6 (root)/include/class.config.php(89): Config->update()
#7 (root)/include/plugins/plugin-autocloser-master/class.CloserPlugin.php(188): Config->set()
#8 (root)/include/plugins/plugin-autocloser-master/class.CloserPlugin.php(79): CloserPlugin->is_time_to_run()
#9 (root)/include/plugins/plugin-autocloser-master/class.CloserPlugin.php(68): CloserPlugin->logans_run_mode()
#10 (root)/include/class.signal.php(98): CloserPlugin->{closure}()
#11 (root)/include/class.cron.php(122): Signal::send()
#12 (root)/include/api.cron.php(15): Cron::run()
#13 (root)/include/api.cron.php(45): CronApiController->run()
#14 (root)/api/cron.php(23): LocalCronApiController::call()
#15 {main}

I've tried modifying the plugin code to update the last-run key instead of inserting a new entry, but the error still persists.

The issue seems to be related to the last-run key in the ost_config table. Clearing the entry in the database temporarily resolves the issue, but the error reappears after the plugin runs again.

Any guidance on modifying the plugin code or other suggestions would be greatly appreciated.

image

@franz-dev
Copy link

Hi,
refer to #44 (comment)

Worked for me.

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

2 participants