tonhowtf/omniget · error

account not found

Error message

account not found: {slug}

What it means

After the bucket lookup succeeds, rename_account searches bucket.accounts for an entry whose slug matches; a miss fails with 'account not found: {slug}'. The bucket exists but contains no account with that slug identifier.

Solutions

  1. Fetch the current account list for the domain (e.g. via the registry/bucket listing) and verify the slug exists before renaming.
  2. Check slug spelling/case and that it belongs to the same domain passed as the first argument.
  3. Refresh any cached account lists after deletions so stale slugs aren't used.
  4. If the intended fix is renaming by display name, look up the slug by alias first, then call rename_account with the slug.

Example fix

// before
storage::rename_account(".youtube.com", "work-acount", "Work"); // typo slug

// after
let bucket = storage::get_bucket(".youtube.com")?;
let slug = bucket.accounts.iter()
    .find(|a| a.slug == "work-account" || a.alias == "Work")
    .map(|a| a.slug.clone())
    .ok_or_else(|| anyhow::anyhow!("account not found in .youtube.com bucket"))?;
storage::rename_account(".youtube.com", &slug, "Work")?;
Defensive patterns

Strategy: validation

Validate before calling

// Rust
let bucket = cookie_storage::load_registry().buckets.get(domain)
    .ok_or_else(|| anyhow::anyhow!("bucket not found: {domain}"))?;
if !bucket.accounts.iter().any(|a| a.slug == slug) {
    let known: Vec<_> = bucket.accounts.iter().map(|a| a.slug.clone()).collect();
    anyhow::bail!("slug '{slug}' not in {domain}; known: {:?}", known);
}

Prevention

When it happens

Trigger: Calling rename_account(domain, slug, new_alias) where the domain bucket exists but the slug does not: account was deleted earlier, slug is case-mismatched or misspelled, slug belongs to a different domain's bucket, or the caller passed an alias/display name instead of the stored slug.

Common situations: UI caches account slugs that were deleted in another window; developer confuses alias (rename target) with slug (lookup key); slug from a stale list after re-importing cookies re-generated slugs; multiple domains share similar slugs and the wrong domain was used.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/600bf7279f73e722. Report an issue: GitHub.

Appendix: source

Thrown at src-tauri/src/cookies/storage.rs:472

        cookie_count: count,
        last_used_at_ms: None,
    });

    save_registry(&registry)?;
    Ok((final_slug, count))
}

pub fn rename_account(domain: &str, slug: &str, new_alias: &str) -> anyhow::Result<()> {
    let mut registry = load_registry();
    let bucket = registry
        .buckets
        .get_mut(domain)
        .ok_or_else(|| anyhow::anyhow!("bucket not found: {domain}"))?;
    let account = bucket
        .accounts
        .iter_mut()
        .find(|a| a.slug == slug)
        .ok_or_else(|| anyhow::anyhow!("account not found: {slug}"))?;
    account.alias = new_alias.to_string();
    save_registry(&registry)?;
    Ok(())
}

pub fn account_path_for_consumer(domain: &str, slug: Option<&str>) -> Option<PathBuf> {
    let slug = slug.unwrap_or(DEFAULT_SLUG);
    let path = account_file(domain, slug);
    if path.exists() {
        Some(path)
    } else {
        None
    }
}

pub fn touch_last_used(domain: &str, slug: &str) {
    let mut registry = load_registry();
    let now = current_unix_ms();

View on GitHub (pinned to 8600b91f42)