crowdsecurity/crowdsec · error

cannot parse: %s

Error message

cannot parse: %s

What it means

ConfigurationFromYAML for the kubernetesaudit source unmarshals the acquisition YAML in strict mode; invalid YAML or unknown configuration keys cause this parse failure, propagated by UnmarshalConfig.

Source

Thrown at pkg/acquisition/modules/kubernetesaudit/config.go:31

	"github.com/crowdsecurity/crowdsec/pkg/metrics"
)

// defaultMaxBodySize is the maximum size of a request body, in bytes.
const defaultMaxBodySize = int64(10 * 1024 * 1024)

type Configuration struct {
	ListenAddr                        string `yaml:"listen_addr"`
	ListenPort                        int    `yaml:"listen_port"`
	WebhookPath                       string `yaml:"webhook_path"`
	MaxBodySize                       *int64 `yaml:"max_body_size"`
	configuration.DataSourceCommonCfg `yaml:",inline"`
}

func ConfigurationFromYAML(y []byte) (Configuration, error) {
	var cfg Configuration

	if err := yaml.UnmarshalWithOptions(y, &cfg, yaml.Strict()); err != nil {
		return cfg, fmt.Errorf("cannot parse: %s", yaml.FormatError(err, false, false))
	}

	cfg.SetDefaults()
	cfg.Normalize()

	err := cfg.Validate()
	if err != nil {
		return cfg, err
	}

	return cfg, nil
}

func (c *Configuration) SetDefaults() {
	if c.Mode == "" {
		c.Mode = configuration.TAIL_MODE
	}

View on GitHub (pinned to 909b515798)

Solutions

  1. Fix the YAML syntax error indicated after 'cannot parse'
  2. Remove unknown or misspelled keys from the source config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/acquisition/modules/kubernetesaudit/config.go:31 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of crowdsecurity/crowdsec@909b515798 (2026-09-06). Data as JSON: /api/errors/8e74c89133c51089. Report an issue: GitHub.