Increase error logging to diagnose server conking (#15662)

* Increase error logging to diagnose server conking

* more logging and db retry

* whoops

* rename error() to log_error() to better reflect what it does
Move a bunch of world.log messages to log_error

* Fix compile error

---------

Co-authored-by: Werner <Arrow768@users.noreply.github.com>
This commit is contained in:
Wildkins
2023-03-13 21:51:39 +00:00
committed by GitHub
co-authored by Werner
parent 62e25f5890
commit c369124fe9
42 changed files with 94 additions and 91 deletions
+1 -1
View File
@@ -527,7 +527,7 @@ var/list/asset_datums = list()
icon_states_string = "[json_encode(s)](\ref[s])"
else
icon_states_string += ", [json_encode(s)](\ref[s])"
error("[O] has an invalid icon state, icon=[icon_file], icon_state=[json_encode(icon_state)](\ref[icon_state]), icon_states=[icon_states_string]")
log_error("[O] has an invalid icon state, icon=[icon_file], icon_state=[json_encode(icon_state)](\ref[icon_state]), icon_states=[icon_states_string]")
I = icon('icons/turf/floors.dmi', "", SOUTH)
var/imgid = ckey("[path]")
+1 -1
View File
@@ -61,7 +61,7 @@ var/list/localhost_addresses = list(
//search the href for script injection
if( findtext(href,"<script",1,0) )
world.log << "Attempted use of scripts within a topic call, by [src]"
log_error("Attempted use of scripts within a topic call, by [src]")
message_admins("Attempted use of scripts within a topic call, by [src]")
//del(usr)
return
@@ -124,8 +124,7 @@
if(config.ipc_timelock_active)
pref.can_edit_ipc_tag = FALSE
else
error("SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have.")
log_debug("SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have. Character ID: [pref.current_character].")
log_error("SQL CHARACTER LOAD: Logic error, general/basic/load_special() didn't return any rows when it should have. Character ID: [pref.current_character].")
/datum/category_item/player_setup_item/general/basic/sanitize_character()
if(!pref.species)
@@ -25,7 +25,7 @@
act.deleted_at IS NULL;
"})
if (!ccia_action_query.Execute(list("char_id" = pref.current_character)))
error("Error CCIA Actions for character #[pref.current_character]. SQL error message: '[ccia_action_query.ErrorMsg()]'.")
log_error("Error CCIA Actions for character #[pref.current_character]. SQL error message: '[ccia_action_query.ErrorMsg()]'.")
while(ccia_action_query.NextRow())
var/list/action = list(
@@ -97,8 +97,7 @@
var/DBQuery/query = dbcon.NewQuery(query_text)
query.Execute(arg_list)
if (query.ErrorMsg())
error("SQL CHARACTER LOAD: SQL query error: [query.ErrorMsg()]")
log_debug("SQL CHARACTER LOAD: SQL query error: [query.ErrorMsg()]")
log_error("SQL CHARACTER LOAD: SQL query error: [query.ErrorMsg()]")
log_debug("SQL CHARACTER LOAD: query args: [json_encode(arg_list)]")
continue
@@ -119,8 +118,7 @@
else
cc.preferences.vars[layers[1]][layers[2]] = query.item[i]
catch(var/exception/e)
error("SQL CHARACTER LOAD: bad variable name: [e.name]")
log_debug("SQL CHARACTER LOAD: bad variable name: [e.name]")
log_error("SQL CHARACTER LOAD: bad variable name: [e.name]")
log_debug("SQL CHARACTER LOAD: var name: [var_names[i]]")
/datum/category_group/player_setup_category/proc/gather_load_parameters()
@@ -217,8 +215,7 @@
query.Execute(arg_list)
if (query.ErrorMsg())
error("SQL CHARACTER SAVE: SQL query error: [query.ErrorMsg()]")
log_debug("SQL CHARACTER SAVE: SQL query error: [query.ErrorMsg()]")
log_error("SQL CHARACTER SAVE: SQL query error: [query.ErrorMsg()]")
log_debug("SQL CHARACTER SAVE: query args: [json_encode(arg_list)]")
continue
@@ -244,11 +241,9 @@
#endif
else
error("SQL CHARACTER SAVE: New ID was not recovered.")
log_debug("SQL CHARACTER SAVE: New ID was not recovered.")
log_error("SQL CHARACTER SAVE: New ID was not recovered.")
if (query.ErrorMsg())
error("SQL CHARACTER SAVE: SQL query error from last_insert_id: [query.ErrorMsg()]")
log_debug("SQL CHARACTER SAVE: SQL query error from last_insert_id: [query.ErrorMsg()]")
log_error("SQL CHARACTER SAVE: SQL query error from last_insert_id: [query.ErrorMsg()]")
/datum/category_group/player_setup_category/proc/gather_save_parameters()
var/list/arg_list = list()
@@ -161,7 +161,7 @@
return null
if (!establish_db_connection(dbcon))
error("Error initiatlizing database connection while getting notifications.")
log_error("Error initiatlizing database connection while getting notifications.")
return null
var/DBQuery/query = dbcon.NewQuery({"SELECT
@@ -215,7 +215,7 @@
return null
if (!establish_db_connection(dbcon))
error("Error initiatlizing database connection while counting CCIA actions.")
log_error("Error initiatlizing database connection while counting CCIA actions.")
return null
var/DBQuery/prep_query = dbcon.NewQuery("SELECT id FROM ss13_characters WHERE ckey = :ckey:")