microsoft/FASTER · warning

WARNING: Ignoring invalid top-level field

Error message

WARNING: Ignoring invalid top-level field '%s'

What it means

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.

Solutions

  1. Restrict top-level keys to: filepath, hlog, index, read_cache
  2. Fix the section name spelling (e.g. read_cache, not read-cache)
  3. Remove stale/renamed sections and verify with the warning disappearing at startup

Example fix

// before
[hlog-compaction]
enabled = true
[read-cache]
enabled = true
// after
[hlog]
[hlog-compaction] # must be nested under a recognized section per your version
[read_cache]
enabled = true
Defensive patterns

Strategy: validation

Validate before calling

static const std::set<std::string> valid = {"filepath","hlog","index","read_cache"};
for (const auto& [k, v] : topTable)
  if (!valid.count(k)) throw std::invalid_argument("invalid top-level field: " + k);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/ec5664fdffc16623. Report an issue: GitHub.

Appendix: source

Thrown at cc/src/core/config.h:219

  IndexConfig index_config;
  HlogConfig hlog_config;
  HlogCompactionConfig hlog_compaction_config;
  ReadCacheConfig rc_config;
  std::string filepath;

  #ifdef TOML_CONFIG
  template<typename... Ts>
  static FasterKvConfig FromConfigString(const std::string& config, Ts... table_key_path) {
    std::istringstream is(config, std::ios_base::binary | std::ios_base::in);
    const auto data = toml::parse(is, "std::string");

    // parse TOML config & validate top-level fields
    const auto top_table = toml::find(data, table_key_path...);

    const std::vector<std::string> VALID_TOP_LEVEL_FIELDS = { "filepath", "hlog", "index", "read_cache" };
    for (auto& it : toml::get<toml::table>(top_table)) {
      if (std::find(VALID_TOP_LEVEL_FIELDS.begin(), VALID_TOP_LEVEL_FIELDS.end(), it.first) == VALID_TOP_LEVEL_FIELDS.end()) {
        fprintf(stderr, "WARNING: Ignoring invalid top-level field '%s'\n", it.first.c_str());
      }
    }

    // top-level
    std::string filepath = toml::find<std::string>(top_table, "filepath");

    // hlog
    const auto hlog_table = toml::find(top_table, "hlog");
    HlogConfig hlog_config = PopulateHlogConfig(hlog_table);
    // hlog.compaction
    HlogCompactionConfig hlog_compaction_config = PopulateHlogCompactionConfig(hlog_table);

    // index
    const auto index_table = toml::find(top_table, "index");
    IndexConfig index_config{ index_table };

    // Read cache
    ReadCacheConfig rc_config = PopulateReadCacheConfig<IsColdStore>(top_table);

View on GitHub (pinned to 321d872eab)