Loki invalid schema config: invalid schema version

  • What Grafana version and what operating system are you using? 9.5.18, openSUSE Leap 15.2

  • What are you trying to achieve? Get Loki running as a service.

  • How are you trying to achieve it? By installing Loki, editing the config file, and the service file.

  • What happened? Starting the service fails with error: “invalid schema config: invalid schema version”.

  • What did you expect to happen? Running Loki service.

  • Can you copy/paste the configuration(s) that you are having problems with?

  • The Loki configuration file:
auth_enabled: false

server:
  http_listen_port: 3100

common:
  ring:
    instance_addr: 127.0.0.1
    kvstore:
      store: inmemory
  replication_factor: 1
  path_prefix: /tmp/loki

schema_config:
  configs:
    # Old boltdb-shipper schema. Included in example for reference but does not need changing.
    - from: "2023-01-03" # <---- A date in the past
      index:
        period: 24h
        prefix: index_
      object_store: gcs
      schema: v12
      store: boltdb-shipper
    # New TSDB schema below
    - from: "2023-01-05" # <---- A date in the future
      index:
        period: 24h
        prefix: index_
      object_store: gcs
      schema: v13
      store: tsdb

storage_config:
  # Old boltdb-shipper configuration. Included in example for reference but does not need changing.
  boltdb_shipper:
    active_index_directory: /data/index
    build_per_tenant_index: true
    cache_location: /data/boltdb-cache
  # New tsdb-shipper configuration
  tsdb_shipper:
    active_index_directory: /data/tsdb-index
    cache_location: /data/tsdb-cache

query_scheduler:
  # the TSDB index dispatches many more, but each individually smaller, requests. 
  # We increase the pending request queue sizes to compensate.
  max_outstanding_requests_per_tenant: 32768

querier:
  # Each `querier` component process runs a number of parallel workers to process queries simultaneously.
  # You may want to adjust this up or down depending on your resource usage
  # (more available cpu and memory can tolerate higher values and vice versa),
  # but we find the most success running at around `16` with tsdb
  max_concurrent: 16
  • The Loki service file:
[Unit]
Description=Loki
After=network.target

[Service]
Type=simple
User=loki

ExecStart=/usr/bin/loki --config.file=/etc/loki/loki.yaml
Restart=always

NoNewPrivileges=true
PrivateTmp=yes

[Install]
WantedBy=multi-user.target
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    In the journal:
Dec 05 17:57:32 monitoring systemd[1]: Started Loki.
Dec 05 17:57:32 monitoring loki[16982]: level=error ts=2024-12-05T16:57:32.262903362Z >
Dec 05 17:57:32 monitoring systemd[1]: loki.service: Main process exited, code=exited,>
Dec 05 17:57:32 monitoring systemd[1]: loki.service: Failed with result 'exit-code'.