{"record":{"id":"a056cd51ddbf467f","repo":"JustArchiNET/ArchiSteamFarm","slug":"steamid-is-invalid","errorCode":null,"errorMessage":"SteamID is invalid!","messagePattern":"SteamID is invalid!","errorType":"exception","errorClass":"NLogConfigurationException","httpStatus":null,"severity":"error","filePath":"ArchiSteamFarm/NLog/Targets/SteamTarget.cs","lineNumber":62,"sourceCode":"\t// This is NLog config property, it must have public get() and set() capabilities\n\t[UsedImplicitly]\n\tpublic ulong ChatGroupID { get; set; }\n\n\t// This is NLog config property, it must have public get() and set() capabilities\n\t[UsedImplicitly]\n\tpublic ulong SteamID { get; set; }\n\n\t// This parameter-less constructor is intentionally public, as NLog uses it for creating targets\n\t// It must stay like this as we want to have our targets defined in our NLog.config\n\t// Keeping date in default layout also doesn't make much sense (Steam offers that), so we remove it by default\n\t[UsedImplicitly]\n\tpublic SteamTarget() => Layout = \"${level:uppercase=true}|${logger}|${message}\";\n\n\tprotected override void InitializeTarget() {\n\t\tbase.InitializeTarget();\n\n\t\tif ((SteamID == 0) || ((ChatGroupID == 0) && !new SteamID(SteamID).IsIndividualAccount)) {\n\t\t\tthrow new NLogConfigurationException(Strings.FormatErrorIsInvalid(nameof(SteamID)));\n\t\t}\n\t}\n\n\tprotected override async Task WriteAsyncTask(LogEventInfo logEvent, CancellationToken cancellationToken) {\n\t\tArgumentNullException.ThrowIfNull(logEvent);\n\n\t\tWrite(logEvent);\n\n\t\tif ((Bot.Bots == null) || Bot.Bots.IsEmpty) {\n\t\t\treturn;\n\t\t}\n\n\t\tstring message = Layout.Render(logEvent);\n\n\t\tif (string.IsNullOrEmpty(message)) {\n\t\t\treturn;\n\t\t}\n","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/JustArchiNET/ArchiSteamFarm/blob/fe57c4129f4ce02d452318cabc525eb49a087255/ArchiSteamFarm/NLog/Targets/SteamTarget.cs#L44-L80","documentation":"Thrown during SteamTarget.InitializeTarget() (an NLog custom target). NLog calls this when the target starts; ASF validates that SteamID is a real, individual Steam account ID (and that a group target, if ChatGroupID==0, is not being misconfigured). An invalid setup raises NLogConfigurationException. This is NLog-configuration-time validation, not a runtime log call.","triggerScenarios":"The NLog.config defines a SteamTarget whose SteamID is 0 (unset), or ChatGroupID is 0 while the SteamID does not resolve to an individual account (e.g. a clan/group ID was supplied where a personal account is required).","commonSituations":"Deploying NLog.config without filling in SteamID; pasting a steamID3/SteamID64 of a group instead of a personal account; using ${...} layout renderers in SteamID which NLog evaluates to a non-numeric or 0; running ASF under a user whose logging target was never configured.","solutions":["Set SteamID in NLog.config to a valid personal-account SteamID64 (the bot owner's ID).","If targetting a chat group, also set ChatGroupID to the non-zero group ID.","Verify the SteamID64 with a tool like steamid.io; ensure it is an 'Individual' (type 1) account.","Remove the SteamTarget block from NLog.config if you do not need Steam log delivery."],"exampleFix":"// before (NLog.config)\n<target xsi:type=\"Steam\" name=\"steam\" />\n// after\n<target xsi:type=\"Steam\" name=\"steam\" SteamID=\"76561198000000000\" />","handlingStrategy":"validation","validationCode":"ulong steamID = 76561198000000000UL;\nvar sid = new SteamKit2.SteamID(steamID);\nbool valid = steamID != 0 && (chatGroupID != 0 || sid.IsIndividualAccount);\nif (!valid) throw new NLogConfigurationException(\"SteamID invalid for SteamTarget\");","typeGuard":"static bool IsValidSteamTargetId(ulong steamID, ulong chatGroupID) {\n    if (steamID == 0) return false;\n    if (chatGroupID != 0) return true;\n    return new SteamKit2.SteamID(steamID).IsIndividualAccount;\n}","tryCatchPattern":"try { /* NLog loads config and initializes targets */ }\ncatch (NLogConfigurationException ex) when (ex.Message.Contains(nameof(SteamTarget.SteamID))) {\n    // fix NLog.config SteamID / ChatGroupID, then restart logging\n}","preventionTips":["Validate SteamID64 is an individual account before putting it in NLog.config.","Keep SteamID/ChatGroupID as literal numbers, not layout renderers.","Drop the SteamTarget block if Steam log delivery is not needed."],"tags":["nlog","configuration","steam","logging","validation"],"backgroundTag":null,"analyzedSha":"fe57c4129f4ce02d452318cabc525eb49a087255","analyzedAt":"2026-08-13T17:26:20.146Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}