{"record":{"id":"ec5664fdffc16623","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-top-level-field-s","errorCode":null,"errorMessage":"WARNING: Ignoring invalid top-level field '%s'\n","messagePattern":"WARNING: Ignoring invalid top-level field '(.+?)'\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cc/src/core/config.h","lineNumber":219,"sourceCode":"  IndexConfig index_config;\n  HlogConfig hlog_config;\n  HlogCompactionConfig hlog_compaction_config;\n  ReadCacheConfig rc_config;\n  std::string filepath;\n\n  #ifdef TOML_CONFIG\n  template<typename... Ts>\n  static FasterKvConfig FromConfigString(const std::string& config, Ts... table_key_path) {\n    std::istringstream is(config, std::ios_base::binary | std::ios_base::in);\n    const auto data = toml::parse(is, \"std::string\");\n\n    // parse TOML config & validate top-level fields\n    const auto top_table = toml::find(data, table_key_path...);\n\n    const std::vector<std::string> VALID_TOP_LEVEL_FIELDS = { \"filepath\", \"hlog\", \"index\", \"read_cache\" };\n    for (auto& it : toml::get<toml::table>(top_table)) {\n      if (std::find(VALID_TOP_LEVEL_FIELDS.begin(), VALID_TOP_LEVEL_FIELDS.end(), it.first) == VALID_TOP_LEVEL_FIELDS.end()) {\n        fprintf(stderr, \"WARNING: Ignoring invalid top-level field '%s'\\n\", it.first.c_str());\n      }\n    }\n\n    // top-level\n    std::string filepath = toml::find<std::string>(top_table, \"filepath\");\n\n    // hlog\n    const auto hlog_table = toml::find(top_table, \"hlog\");\n    HlogConfig hlog_config = PopulateHlogConfig(hlog_table);\n    // hlog.compaction\n    HlogCompactionConfig hlog_compaction_config = PopulateHlogCompactionConfig(hlog_table);\n\n    // index\n    const auto index_table = toml::find(top_table, \"index\");\n    IndexConfig index_config{ index_table };\n\n    // Read cache\n    ReadCacheConfig rc_config = PopulateReadCacheConfig<IsColdStore>(top_table);","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/config.h#L201-L237","documentation":"FromConfigString validates that the top level of the parsed TOML table contains only known keys (filepath, hlog, index, read_cache). Any other top-level key triggers this warning and is ignored, so settings in a misspelled section never take effect.","triggerScenarios":"Calling F2Kv<K,V,D,HHI,CHI>::FromConfigString with a config whose top-level table contains an unrecognized key such as 'readcache', 'log', or a duplicated section name.","commonSituations":"Misspelled section headers ([read_cache] written as [read-cache] in the wrong place), legacy config keys from older FASTER releases, extra debug keys left in production configs.","solutions":["Restrict top-level keys to: filepath, hlog, index, read_cache","Fix the section name spelling (e.g. read_cache, not read-cache)","Remove stale/renamed sections and verify with the warning disappearing at startup"],"exampleFix":"// before\n[hlog-compaction]\nenabled = true\n[read-cache]\nenabled = true\n// after\n[hlog]\n[hlog-compaction] # must be nested under a recognized section per your version\n[read_cache]\nenabled = true","handlingStrategy":"validation","validationCode":"static const std::set<std::string> valid = {\"filepath\",\"hlog\",\"index\",\"read_cache\"};\nfor (const auto& [k, v] : topTable)\n  if (!valid.count(k)) throw std::invalid_argument(\"invalid top-level field: \" + k);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the four documented top-level keys","Version-gate config templates to the FASTER release in use","Fail fast in CI when unknown keys appear"],"tags":["config","toml","validation","top-level"],"backgroundTag":"invalid-config-value","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}