{"record":{"id":"1d927d2bbf4aff22","repo":"musistudio/claude-code-router","slug":"plugin-marketplace-failed-to-read-cached-marketp","errorCode":null,"errorMessage":"[plugin-marketplace] Failed to read cached marketplace: ${formatError(error)}","messagePattern":"\\[plugin-marketplace\\] Failed to read cached marketplace: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/plugins/marketplace.ts","lineNumber":78,"sourceCode":"    ensureMarketplaceCacheDir();\n    writeFileSync(marketplaceManifestCacheFile, source, \"utf8\");\n    return normalizeMarketplaceManifest(JSON.parse(source) as unknown, url);\n  } catch (error) {\n    console.warn(`[plugin-marketplace] Failed to fetch marketplace from ${url}: ${formatError(error)}`);\n    return readCachedMarketplace(url);\n  }\n}\n\nasync function readCachedMarketplace(url: string): Promise<PluginMarketplaceEntry[]> {\n  if (!existsSync(marketplaceManifestCacheFile)) {\n    return [];\n  }\n\n  try {\n    const source = readFileSync(marketplaceManifestCacheFile, \"utf8\");\n    return normalizeMarketplaceManifest(JSON.parse(source) as unknown, url, { offline: true });\n  } catch (error) {\n    console.warn(`[plugin-marketplace] Failed to read cached marketplace: ${formatError(error)}`);\n    return [];\n  }\n}\n\nasync function normalizeMarketplaceManifest(\n  value: unknown,\n  manifestUrl: string,\n  options: { offline?: boolean } = {}\n): Promise<PluginMarketplaceEntry[]> {\n  const items = marketplaceItems(value);\n  const entries: PluginMarketplaceEntry[] = [];\n  const seen = new Set<string>();\n\n  for (const item of items) {\n    let entry: PluginMarketplaceEntry | undefined;\n    try {\n      entry = await normalizeMarketplaceEntry(item, manifestUrl, options);\n    } catch (error) {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/plugins/marketplace.ts#L60-L96","documentation":"Emitted by readCachedMarketplace when the on-disk marketplace cache cannot be read or parsed: the file is missing is handled earlier, but a read error, truncated file, or invalid JSON lands here. The function then returns an empty list, so the marketplace shows no entries.","triggerScenarios":"The cache file exists but is corrupt — partial write from a crash, manual editing, disk corruption — or a normalizeMarketplaceManifest validation error in offline mode.","commonSituations":"Process killed while writeFileSync was updating the cache; user hand-edited the cache file; cache written by an older incompatible package version.","solutions":["Delete the cache file (marketplaceManifestCacheFile) so the next successful online fetch rewrites it.","Ensure at least one online run completes so a fresh valid cache is produced.","If it recurs, capture the formatted error — a normalize error may indicate a schema change requiring a package upgrade."],"exampleFix":"rm ~/.cache/<app>/marketplace/marketplace.json # path = marketplaceManifestCacheFile","handlingStrategy":"fallback","validationCode":"null","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Do not hand-edit the cache file","Delete the cache after crashes during marketplace fetch","Expect an empty marketplace on first offline run"],"tags":["marketplace","cache","offline","json-parse"],"backgroundTag":"cache-read-failed","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}