beemdevelopment/Aegis · error · SlotException
unrecognized slot type
Error message
unrecognized slot type
What it means
Slot.fromJson reads the slot's 'type' integer from the vault JSON and instantiates the matching Slot subclass (Raw, Password, Biometric). Any type value not matching a known TYPE_* constant throws SlotException('unrecognized slot type'). This guards against corrupted vaults or vault files written by newer Aegis versions that introduced new slot types.
Solutions
- Open the vault with the same or newer Aegis version that wrote it (update the app)
- Re-export the vault from a working installation and verify it unlocks there before transferring
- Restore an earlier known-good vault backup; discard the corrupted one
- Check that any vault-processing scripts preserved the integer 'type' field exactly
Example fix
// before
// slot JSON: {"type": 99, "uuid": ...} from newer app version
Slot slot = Slot.fromJson(obj); // SlotException: unrecognized slot type
// after
int type = obj.getInt("type");
if (type > Slot.TYPE_BIOMETRIC) {
notifyUserToUpdateApp(); // newer slot type needs newer build
} else {
Slot slot = Slot.fromJson(obj);
} Defensive patterns
Strategy: validation
Validate before calling
int type = obj.optInt("type", -1);
boolean known = type == Slot.TYPE_RAW || type == Slot.TYPE_PASSWORD || type == Slot.TYPE_BIOMETRIC;
if (!known) { promptAppUpdateOrRejectVault(); } Type guard
boolean isKnownSlotType(JSONObject slotObj) {
int t = slotObj.optInt("type", -1);
return t == Slot.TYPE_RAW || t == Slot.TYPE_PASSWORD || t == Slot.TYPE_BIOMETRIC;
} Try / catch
try {
Slot slot = Slot.fromJson(obj);
} catch (SlotException e) {
if (e.getMessage().contains("unrecognized slot type")) {
suggestNewerAegisVersion();
}
} Prevention
- Never hand-edit vault slot JSON; transfer exports verbatim
- Move vaults only between same-or-newer Aegis versions
- Keep verified backups so a corrupted export can be replaced
When it happens
Trigger: Vault JSON contains a slot whose 'type' field is outside the known set (corruption, manual edit, or a newer app version's new slot type); the 'type' field is missing/garbled so getInt returns a wrong value.
Common situations: Restoring a vault from a newer Aegis onto an older build; partial/failed vault export or truncated copy; user-edited or third-party-processed vault files; bit rot in backups.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- unsupported version
- Unable to decode stream to bitmap
- Unable to find pack.json in the root of the ZIP file
- Unable to create directories
- Unable to find relative to the root of the ZIP file
AI-assisted analysis of beemdevelopment/Aegis@d6f4e5925a (2026-09-08).
Data as JSON: /api/errors/40642c54ad22a1b8.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/main/java/com/beemdevelopment/aegis/vault/slots/Slot.java:150
case Slot.TYPE_RAW:
slot = new RawSlot(uuid, key, keyParams);
break;
case Slot.TYPE_PASSWORD:
SCryptParameters scryptParams = new SCryptParameters(
obj.getInt("n"),
obj.getInt("r"),
obj.getInt("p"),
Hex.decode(obj.getString("salt"))
);
boolean repaired = obj.optBoolean("repaired", false);
boolean isBackup = obj.optBoolean("is_backup", false);
slot = new PasswordSlot(uuid, key, keyParams, scryptParams, repaired, isBackup);
break;
case Slot.TYPE_BIOMETRIC:
slot = new BiometricSlot(uuid, key, keyParams);
break;
default:
throw new SlotException("unrecognized slot type");
}
} catch (JSONException | EncodingException e) {
throw new SlotException(e);
}
return slot;
}
public abstract byte getType();
}
View on GitHub (pinned to d6f4e5925a)