iberianpig/fusuma · error · InvalidFileError

Invalid config.yml: #{path}

Error message

Invalid config.yml: #{path}

What it means

Error "Invalid config.yml: #{path}" thrown in iberianpig/fusuma.

Source

Thrown at lib/fusuma/config.rb:112

        end
      end
      {}
    end

    # @return [Hash] If check passes
    # @raise [InvalidFileError] If check does not pass
    #: (String) -> Array[Hash[Symbol, untyped]]
    def validate(path)
      duplicates = []
      YAMLDuplicationChecker.check(File.read(path), path) do |ignored, duplicate| # steep:ignore UnexpectedBlockGiven
        MultiLogger.error "#{path}: #{ignored.value} is duplicated"
        duplicates << duplicate.value
      end
      raise InvalidFileError, "Detect duplicate keys #{duplicates}" unless duplicates.empty?

      yamls = YAML.load_stream(File.read(path)).compact # steep:ignore NoMethod
      yamls.map do |yaml|
        raise InvalidFileError, "Invalid config.yml: #{path}" unless yaml.is_a? Hash

        yaml.deep_symbolize_keys
      end
    rescue Psych::SyntaxError => e
      raise InvalidFileError, "Invalid syntax: #{path} #{e.message}"
    end

    # @param index [Index]
    #: (Fusuma::Config::Index) -> (String | Hash[untyped, untyped] | Integer | Float)?
    def search(index)
      return nil if index.nil? || index.keys.empty?
      @searcher.search_with_cache(index, location: keymap)
    end

    # @param index [Config::Index]
    # @return Symbol
    def find_execute_key(index)
      @execute_keys ||= Plugin::Executors::Executor.plugins.map do |executor|

View on GitHub (pinned to 43a7eb04fe)

Solutions

  1. Check that the config.yml at the reported path contains a YAML mapping (key: value pairs) at the top level, not a plain string, array, or empty document.
  2. Validate the file with ruby -ryaml and fix any non-Hash documents.
  3. Remove any stray YAML documents separated by --- lines that do not contain mappings.

When it happens

Trigger: Thrown at lib/fusuma/config.rb:112 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of iberianpig/fusuma@43a7eb04fe (2026-08-23). Data as JSON: /api/errors/3d8acf2689c6669d. Report an issue: GitHub.