Hello-
I inherited a bunch of servers and website on a good sized community (original person got tired of it and I didn't want to see it die, so yay, more things for me to do.) I have extensive server exp and have run his for a long time, but not into modding at all.
I moved all his servers off his old box (dedicated, I think he was on redhat 6.5 or something) to a new baremetal box I put Ubuntu 18.04.1 on because, it's 2018 and RH annoys me (use it and centos at work all day, don't like the slow update schedule and this isn't production, so whatever.)
And possibly this isn't strictly an amxmodx problem as opposed to mysql.
Anyway, Custom/non-puiblic script from someone who's on this site but hasn't logged in for a long time, but basically keeps an SQL DB of a group of servers, players, open slot etc. and will give a popup menu in game with /servers to move between member servers.
Somewhere along the line, apparently the SQL NOW() function is broken in newer flavors of linux/mysql. Looking at the table redirects_data, everything is updating except for this datetime NOW() function.
This worked fine for years before the OS modernizing, and all other scripts and mods work, some very DB intensive.
Chunks of script (Every place NOW() Appears):
Code:
formatex(cache, sizeof(cache)-1, "SELECT * FROM `redirects_data` WHERE unix_timestamp(NOW())-unix_timestamp(update_time)<22 LIMIT %d, %d;", g_p_start_num[id], g_p_start_num[id]+9)
pos += formatex(cache[pos], sizeof(cache)-1-pos, "('%s', '%s', '%d', '%d', '%s', 'NOW()')", g_ip_port, quoted_hostname, pl, maxpl, map)
pos += formatex(cache[pos], sizeof(cache)-1-pos, " ON DUPLICATE KEY UPDATE `pl`='%d', `maxpl`='%d', `map`='%s', `update_time`=NOW();", pl, maxpl, map)
Chunks of log:
Code:
[mysql_redirect.amxx] SQL Error (qh_update_data): Incorrect datetime value: 'NOW()' for column 'update_time' at row 1
Chunks of mysql log:
Brackets to hide use and db name, because I'm mental, but valid and correct/expected
Code:
2018-09-28T05:39:46.254913Z 134224 [Note] Aborted connection 134224 to db: '[VALID DB]' user: '[VALID USER]' host: 'localhost' (Got an error reading communication packets)
I'm hoping can shed some light on why this is broken and mitigations. I have some ideas based on 2 weeks of googling, but yeah, it's still broken. Thanks in advance!