weaviate/weaviate · error

autoSchema.defaultDate must be either 'date' or 'string' or

Error message

autoSchema.defaultDate must be either 'date' or 'string' or 'text

What it means

AutoSchema.Validate requires autoSchema.defaultDate to be "date", "string", or "text"; it decides how date-looking values are typed when auto-schema ingests objects. Any other value aborts startup with this message (which omits a closing quote after 'text).

Source

Thrown at usecases/config/config_handler.go:839

type AutoSchema struct {
	Enabled       *runtime.DynamicValue[bool] `json:"enabled" yaml:"enabled"`
	DefaultString string                      `json:"defaultString" yaml:"defaultString"`
	DefaultNumber string                      `json:"defaultNumber" yaml:"defaultNumber"`
	DefaultDate   string                      `json:"defaultDate" yaml:"defaultDate"`
}

func (a AutoSchema) Validate() error {
	if a.DefaultNumber != "int" && a.DefaultNumber != "number" {
		return fmt.Errorf("autoSchema.defaultNumber must be either 'int' or 'number")
	}
	if a.DefaultString != schema.DataTypeText.String() &&
		a.DefaultString != schema.DataTypeString.String() {
		return fmt.Errorf("autoSchema.defaultString must be either 'string' or 'text")
	}
	if a.DefaultDate != "date" &&
		a.DefaultDate != schema.DataTypeText.String() &&
		a.DefaultDate != schema.DataTypeString.String() {
		return fmt.Errorf("autoSchema.defaultDate must be either 'date' or 'string' or 'text")
	}

	return nil
}

// QueryDefaults for optional parameters
type QueryDefaults struct {
	Limit        int64 `json:"limit" yaml:"limit"`
	LimitGraphQL int64 `json:"limitGraphQL" yaml:"limitGraphQL"`
}

// DefaultBackupMinChunkSize is the default minimum size for backup chunks
const DefaultBackupMinChunkSize = 1024 * 1024 // 1MB

// DefaultBackupChunkTargetSize is the default target size for packing small files into chunks
const DefaultBackupChunkTargetSize = 10 * 1024 * 1024 // 10MB

// DefaultBackupSplitFileSize is the default size for splitting large files during backup

View on GitHub (pinned to 75aa4b6d11)

Solutions

  1. Set autoSchema.defaultDate to "date" to keep native date typing (recommended).
  2. Use "string" or "text" if dates should be ingested as plain text properties.
  3. Remove the key to fall back to the code default.

Example fix

// before (yaml)
autoSchema:
  defaultDate: timestamp
// after
autoSchema:
  defaultDate: date
Defensive patterns

Strategy: validation

Validate before calling

v := cfg.AutoSchema.DefaultDate
if v != "date" && v != "string" && v != "text" {
  return fmt.Errorf("autoSchema.defaultDate must be 'date', 'string' or 'text', got %q", v)
}

Prevention

When it happens

Trigger: Setting autoSchema.defaultDate to an unsupported value such as "datetime", "timestamp", "iso8601", or an empty string, then starting the server or running config validation.

Common situations: Using ISO/timestamp vocabulary from other databases; wanting dates stored as text but writing "date-string" or similar; hand-merged YAML files introducing invalid values.

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 weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/0579ddd3efe85e04. Report an issue: GitHub.