Skip to content

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

@leon1298

Description

@leon1298

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions