JustArchiNET/ArchiSteamFarm · warning · InvalidOperationException

Received unknown value for {0}, please report this: {1}

Error message

Received unknown value for {0}, please report this: {1}

What it means

Thrown in Bot.GetAccessPermissions when a value read from BotConfig.SteamUserPermissions does not match any known BotConfig.EAccess case (None/FamilySharing/Operator/Master). The default arm of the switch reports it as an unknown value, signalling corruption or a forward-incompatible enum value. It is explicitly a 'please report' error, meaning ASF expects it to be unreachable under normal use.

Source

Thrown at ArchiSteamFarm/Steam/Bot.cs:498

	}

	[PublicAPI]
	public EAccess GetAccess(ulong steamID) {
		if ((steamID == 0) || !new SteamID(steamID).IsIndividualAccount) {
			throw new ArgumentOutOfRangeException(nameof(steamID));
		}

		if (ASF.IsOwner(steamID)) {
			return EAccess.Owner;
		}

		if (BotConfig.SteamUserPermissions.TryGetValue(steamID, out BotConfig.EAccess permission)) {
			return permission switch {
				BotConfig.EAccess.None => EAccess.None,
				BotConfig.EAccess.FamilySharing => EAccess.FamilySharing,
				BotConfig.EAccess.Operator => EAccess.Operator,
				BotConfig.EAccess.Master => EAccess.Master,
				_ => throw new InvalidOperationException(Strings.FormatWarningUnknownValuePleaseReport(nameof(permission), permission))
			};
		}

		return SteamFamilySharingIDs.Contains(steamID) ? EAccess.FamilySharing : EAccess.None;
	}

	[PublicAPI]
	public static Bot? GetBot(string botName) {
		ArgumentException.ThrowIfNullOrEmpty(botName);

		if (Bots == null) {
			throw new InvalidOperationException(nameof(Bots));
		}

		if (Bots.TryGetValue(botName, out Bot? targetBot)) {
			return targetBot;
		}

View on GitHub (pinned to fe57c4129f)

Solutions

  1. Open the bot's JSON and fix the offending SteamUserPermissions entry to a valid access value (0=None, 1=FamilySharing, 2=Operator, 3=Master per the enum or its documented numeric mapping).
  2. Re-enter Steam user permissions through ASF's command/UI rather than manual editing.
  3. Align ASF versions if the config came from a newer build that introduced a new EAccess member.
  4. Report upstream with the value if it came from a legitimately produced config (the message asks for this).

Example fix

// before (bot JSON, invalid numeric access)
"SteamUserPermissions": { "76561198000000000": 30 }
// after
"SteamUserPermissions": { "76561198000000000": 3 }
Defensive patterns

Strategy: validation

Validate before calling

// Validate access values before relying on the switch.
foreach (var kv in botConfig.SteamUserPermissions) {
    if (!Enum.IsDefined(typeof(BotConfig.EAccess), kv.Value))
        throw new InvalidOperationException($"Unknown EAccess {kv.Value} for {kv.Key}");
}

Type guard

static bool IsKnownAccess(BotConfig.EAccess a) =>
    a is BotConfig.EAccess.None or BotConfig.EAccess.FamilySharing
       or BotConfig.EAccess.Operator or BotConfig.EAccess.Master;

Try / catch

try { EAccess access = bot.GetAccessPermissions(steamID); }
catch (InvalidOperationException ex) when (ex.Message.Contains("please report")) {
    // log the offending value and treat as EAccess.None
}

Prevention

When it happens

Trigger: SteamUserPermissions dictionary (from bot config) contains an EAccess byte value outside {0,10,50,100} (the enum's defined members). Because EAccess is backed by byte, any literal number 0–255 can round-trip from JSON; an unmapped number hits the default case.

Common situations: Hand-editing bot JSON and typing an invalid access number (e.g. 30 or 255) under SteamUserPermissions; a config produced by a newer ASF version that added an access level the running build does not recognize; a third-party tool writing config with an out-of-range value.

Related errors


AI-assisted analysis of JustArchiNET/ArchiSteamFarm@fe57c4129f (2026-08-13). Data as JSON: /api/errors/0697d5b1225f1c8b. Report an issue: GitHub.