Hi, there! I maintain an instance of osTicket for a college's HelpDesk at a public university. We've been using the ticketing system for several years and I can usually fix any problem I've encountered (there have only been a few, to be honest) but I have been receiving an error message lately after updating to 1.16.1 that perplexes me and I'm hoping to get assistance.
This message is sent via email:
[INSERT INTO `ost_session` SET `session_id` = 'dha5t21ktf4taf54cmldnvq4s1', `session_data` = 'csrf|a:2:{s:5:\"token\";s:40:\"9e90b9faeacc98974c5bf45452c58d5babf9e215\";s:4:\"time\";i:1649958821;}', `session_expire` = (NOW() + INTERVAL 86400 SECOND), `user_ip` = '5.62.57.45', `user_agent` = 'Mozilla/5.0 (compatible; Konqueror/4.3; Linux) KHTML/4.3.1 (like Gecko) Fedora/4.3.1-3.fc11']
Duplicate entry 'dha5t21ktf4taf54cmldnvq4s1' for key 'PRIMARY'<br />
<br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(201): osTicket->logDBError()<br />
#1 (root)/include/class.orm.php(3468): db_query()<br />
#2 (root)/include/class.orm.php(658): MySqlExecutor->execute()<br />
#3 (root)/include/class.ostsession.php(234): VerySimpleModel->save()<br />
#4 (root)/include/class.ostsession.php(159): DbSessionBackend->update()<br />
#5 [internal function]: SessionBackend->write()<br />
#6 [internal function]: session_write_close()<br />
#7 {main}
My searching has found a few threads over the years regarding this message, and most indicate that it is harmless and can be ignored because it just means the database is trying to create a session that already exists and can be cleared out. That would be sufficient if this were rare and the logs indicated it was a staff member, But here's the kicker - we've been getting hundreds of these emails in short bursts (sometimes 700 at a time within a few minutes) and the user IP address is always foreign and does not match any campus IP addresses. Furthermore, the user agent (detected browser and OS) changes frequently between messages.
I'm hoping to get clarification on what activity counts as a "session" that warrants entry into the database? Visiting the site landing page? Visiting the "open a ticket" page? Attempting to login to the staff panel? I can see about 37 entries in the session table, despite there being significantly fewer employees that use the site.
Currently, our staff panel is locked via .htaccess to limit visitors to on campus IP addresses so no one off campus should be able to access the /SCP/ directory.
The frequency of these messages and wild variety of detected browsers leads me to believe the site is being spammed by a bot, but I don't know exactly what they are doing or how to limit it.
Server Information
osTicket Version v1.16.1 (b42ddc7) — Up to date
Web Server Software Apache
MySQL Version 5.7.37
PHP Version 8.0.17
OS Version Ubuntu 18.04