tonhowtf/omniget · error
bucket not found
Error message
bucket not found: {domain} What it means
rename_account loads the cookie account registry and looks up the bucket keyed by the cookie domain; if no bucket exists for that domain it fails with 'bucket not found: {domain}'. A bucket is only present for domains that have had accounts saved before, so the domain must exist in the registry.
Solutions
- Confirm the exact domain key stored in the registry (dump load_registry output) and pass it verbatim, including any leading dot.
- List available buckets/accounts first and let the user pick from real keys instead of free-typing a domain.
- Normalize the domain (lowercase, strip scheme/www, keep leading-dot convention) before calling rename_account.
- If the bucket genuinely should exist, check the registry file path/permissions — it may have been deleted or a different storage dir is in use.
- Create the bucket first (save at least one account for the domain) before renaming.
Example fix
// before
storage::rename_account("https://youtube.com", "work", "Work account")?; // wrong key form
// after
let domain = normalize_cookie_domain("https://youtube.com"); // -> ".youtube.com"
if storage::list_buckets().contains(domain) {
storage::rename_account(&domain, "work", "Work account")?;
} Defensive patterns
Strategy: validation
Validate before calling
// Rust
fn normalize_cookie_domain(url_or_domain: &str) -> String {
let d = url_or_domain.trim_start_matches("https://").trim_start_matches("http://");
let d = d.split('/').next().unwrap_or(d);
let d = d.trim_start_matches("www.");
format!(".{}", d.to_lowercase())
}
// call only if registry already lists this domain Prevention
- Normalize domains (lowercase, no scheme/www, consistent leading dot) before registry calls
- Enumerate existing buckets and let users pick rather than typing domains
- Keep the registry path/config consistent so the expected buckets actually exist
- Save at least one account for a domain before attempting renames
When it happens
Trigger: Calling rename_account(domain, slug, new_alias) with a domain string that has no entry in the registry: never-saved domain, domain spelled differently than stored (e.g. '.example.com' vs 'example.com', leading dot or scheme/leading 'www' mismatch), or registry file reset/deleted.
Common situations: Frontend passes the URL host while the registry stores the cookie domain with a leading dot; user renames an account after the registry was wiped or before any cookies for that site were saved; case mismatch ('.YouTube.com' vs '.youtube.com'); rename called with a placeholder/empty domain.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- account not found
- Target domain is required for Cookie header import.
- invalid domain
- no cookies in payload match domain
- No valid cookies found in file (expected Netscape format)
AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12).
Data as JSON: /api/errors/cdccb71f7e22b8ed.
Report an issue: GitHub.
Appendix: source
Thrown at src-tauri/src/cookies/storage.rs:467
slug: final_slug.clone(),
alias,
source_url,
source_label: Some(source.source_label.clone()),
captured_at_ms: now,
cookie_count: count,
last_used_at_ms: None,
});
save_registry(®istry)?;
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(®istry)?;
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
}View on GitHub (pinned to 8600b91f42)