{"record":{"id":"15d8bb8c116312d2","repo":"xai-org/grok-build","slug":"marketplace-sources-is-not-an-array-of-tables-15d8bb","errorCode":null,"errorMessage":"[[marketplace.sources]] is not an array of tables","messagePattern":"\\[\\[marketplace\\.sources\\]\\] is not an array of tables","errorType":"error_code","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-shell/src/extensions/marketplace.rs","lineNumber":988,"sourceCode":"            format!(\"invalid TOML: {e}\"),\n        )\n    })?;\n\n    let marketplace_item = doc\n        .entry(\"marketplace\")\n        .or_insert_with(|| toml_edit::Item::Table(toml_edit::Table::new()));\n    let marketplace = marketplace_item.as_table_mut().ok_or_else(|| {\n        std::io::Error::new(\n            std::io::ErrorKind::InvalidData,\n            \"[marketplace] is not a table\",\n        )\n    })?;\n\n    let sources_item = marketplace\n        .entry(\"sources\")\n        .or_insert_with(|| toml_edit::Item::ArrayOfTables(toml_edit::ArrayOfTables::new()));\n    let sources = sources_item.as_array_of_tables_mut().ok_or_else(|| {\n        std::io::Error::new(\n            std::io::ErrorKind::InvalidData,\n            \"[[marketplace.sources]] is not an array of tables\",\n        )\n    })?;\n\n    // Skip if the normalized URL / path already exists: the pre-lock dup check\n    // in handle_add_source can let two serialized adds reach here.\n    use crate::plugin::MarketplaceAddInput;\n    let already_present = match source {\n        MarketplaceAddInput::GitUrl(git_url) => {\n            let normalized = git_url.trim_end_matches(\".git\");\n            sources.iter().any(|t| {\n                t.get(\"git\")\n                    .and_then(|v| v.as_str())\n                    .is_some_and(|u| u.trim_end_matches(\".git\") == normalized)\n            })\n        }\n        MarketplaceAddInput::LocalPath(path) => {","sourceCodeStart":970,"sourceCodeEnd":1006,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-shell/src/extensions/marketplace.rs#L970-L1006","documentation":"Error \"[[marketplace.sources]] is not an array of tables\" thrown in xai-org/grok-build.","triggerScenarios":"Thrown at crates/codegen/xai-grok-shell/src/extensions/marketplace.rs:988 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}