sds/overcommit · error · Overcommit::Exceptions::ConfigurationError

Unable to load configuration from '#{file}': #{e}

Error message

Unable to load configuration from '#{file}': #{e}

What it means

Error "Unable to load configuration from '#{file}': #{e}" thrown in sds/overcommit.

Source

Thrown at lib/overcommit/configuration_loader.rb:85

      end
    end

    # Loads a configuration, ensuring it extends the default configuration.
    def load_file(file, local_file = nil)
      overcommit_config = self.class.load_from_file(file, default: false, logger: @log)
      l_config = self.class.load_from_file(local_file, default: false, logger: @log) if local_file
      config = self.class.default_configuration.merge(overcommit_config)
      config = config.merge(l_config) if l_config

      if @options.fetch(:verify) { config.verify_signatures? }
        verify_signatures(config)
      end

      config
    rescue Overcommit::Exceptions::ConfigurationSignatureChanged
      raise
    rescue StandardError => e
      raise Overcommit::Exceptions::ConfigurationError,
            "Unable to load configuration from '#{file}': #{e}",
            e.backtrace
    end

    private

    def verify_signatures(config)
      if !config.previous_signature?
        raise Overcommit::Exceptions::ConfigurationSignatureChanged,
              "No previously recorded signature for configuration file.\n" \
              'Run `overcommit --sign` if you trust the hooks in this repository.'

      elsif config.signature_changed?
        raise Overcommit::Exceptions::ConfigurationSignatureChanged,
              "Signature of configuration file has changed!\n" \
              "Run `overcommit --sign` once you've verified the configuration changes."
      end
    end

View on GitHub (pinned to fee0cd74b2)

Solutions

  1. Read the appended exception message for the exact failure (missing file, permission denied, YAML syntax error) and correct it.
  2. Check that the configuration file exists at the reported path and is readable.
  3. Validate the YAML syntax of the configuration file (e.g. with a YAML linter) and fix parse errors.

When it happens

Trigger: Thrown at lib/overcommit/configuration_loader.rb:85 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sds/overcommit@fee0cd74b2 (2026-08-23). Data as JSON: /api/errors/33b1bcf9f0d64f43. Report an issue: GitHub.