Netflix/chaosmonkey · error
%s not specified
Error message
%s not specified
What it means
NewFromConfig builds a MySQL store from the monkey configuration. It requires a database host; if cfg.DatabaseHost() is empty it immediately returns an error '<param.DatabaseHost> not specified'. The library refuses to construct a MySQL client without knowing which host to connect to.
Source
Thrown at mysql/mysql.go:67
// See: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html#error_er_lock_deadlock
return err.Number == 1213
default:
return false
}
}
// ViolatesMinTime returns true if the error violates min time between
// terminations
func ViolatesMinTime(err error) bool {
_, ok := errors.Cause(err).(chaosmonkey.ErrViolatesMinTime)
return ok
}
// NewFromConfig creates a new MySQL taking config parameters from cfg
func NewFromConfig(cfg *config.Monkey) (MySQL, error) {
if cfg.DatabaseHost() == "" {
return MySQL{}, errors.Errorf("%s not specified", param.DatabaseHost)
}
encryptedPassword := cfg.DatabaseEncryptedPassword()
decryptor, err := deps.GetDecryptor(cfg)
if err != nil {
return MySQL{}, err
}
password, err := decryptor.Decrypt(encryptedPassword)
if err != nil {
return MySQL{}, err
}
return New(cfg.DatabaseHost(), cfg.DatabasePort(), cfg.DatabaseUser(), password, cfg.DatabaseName())
}
// New creates a new MySQLView on GitHub (pinned to eaa28fb761)
Solutions
- Set the database host in the monkey config (the key matching param.DatabaseHost, e.g. database.host)
- Set the corresponding environment variable the config loader reads for the host
- Verify the config file being loaded is the intended one and keys are spelled correctly
- Add a startup config validation step that fails fast when required DB params are empty
Example fix
// before (config yaml) database: encrypted_password: "..." // after database: host: "chaosmonkey-db.example.com" encrypted_password: "..."
Defensive patterns
Strategy: validation
Validate before calling
if cfg.DatabaseHost() == "" {
return errors.New("database.host must be set before constructing the MySQL store")
}
if cfg.DatabaseEncryptedPassword() == "" {
return errors.New("database.encrypted_password must be set")
} Try / catch
mysql, err := mysql.NewFromConfig(cfg)
if err != nil {
log.Fatalf("mysql config incomplete: %v", err)
} Prevention
- List required DB config keys and check them at process startup
- Use config templates/linting so required keys are never missing
- Set the host via a documented environment variable in deployments
- Fail fast in CI by loading config with a dry-run step
When it happens
Trigger: Calling NewFromConfig (indirectly from Execute) with a config whose database.host (param.DatabaseHost) is empty or unset.
Common situations: Missing database.host key in the config file; environment variable supplying the host not set in the deployment environment; typos in the config key so the value never reaches cfg.DatabaseHost().
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- unknown group: %v
- schedule already exists
- FATAL: no spinnaker endpoint specified in config
- retrieve cloud provider failed
- unsupported error counter: %s
AI-assisted analysis of Netflix/chaosmonkey@eaa28fb761 (2026-09-03).
Data as JSON: /api/errors/a66838b758517828.
Report an issue: GitHub.