Loki ready but index/stats returns syntax error

I installed Loki on raspberry pi os (Debian 12) and added the configuration file from git (loki/cmd/loki/loki-local-config.yaml at main · grafana/loki · GitHub )

I changed the location of the storage and deactivated the alert manager and the multivariate querier engine as it created an error during startup.

The files are stored under owner loki:staff

Now Loki starts fine and after a couple of seconds /ready returns ready.

Unfortunately api/v1/index/stats returns a strange error:

# curl localhost:3100/loki/api/v1/index/stats                  parse error : syntax error: unexpected $endroot@

Activating a docker log driver does not work, it returns a 301 so Loki does not accept any data.

Any idea how to fix this or troubleshoot?

Loki 3.5.0

Here’s my config for loki:

auth_enabled: false

server:
  http_listen_port: 3100
  grpc_listen_port: 9096
  log_level: info
  grpc_server_max_concurrent_streams: 1000

common:
  instance_addr: 0.0.0.0
  path_prefix: /var/local/loki
  storage:
    filesystem:
      chunks_directory: /var/local/loki/chunks
      rules_directory: /var/local/loki/rules
  replication_factor: 1
  ring:
    kvstore:
      store: inmemory

query_range:
  results_cache:
    cache:
      embedded_cache:
        enabled: true
        max_size_mb: 100

limits_config:
  metric_aggregation_enabled: true

schema_config:
  configs:
    - from: 2020-10-24
      store: tsdb
      object_store: filesystem
      schema: v13
      index:
        prefix: index_
        period: 24h

pattern_ingester:
  enabled: true
  metric_aggregation:
    loki_address: localhost:3100

frontend:
  encoding: protobuf


# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
#
# Statistics help us better understand how Loki is used, and they show us performance
# levels for most users. This helps us prioritize features and documentation.
# For more information on what's sent, look at
# https://github.com/grafana/loki/blob/main/pkg/analytics/stats.go
# Refer to the buildReport method to see what goes into a report.
##
# If you would like to disable reporting, uncomment the following lines:
#analytics:
#  reporting_enabled: false

I don’t see anything obviously wrong. The stats API does require a query (see Loki HTTP API | Grafana Loki documentation), so it’s possible your Loki instance is working just fine.

Perhaps try GET /loki/api/v1/labels API and see if it returns anything. You should also do a push then query to verify as well.

1 Like

Thank you, you are right. The labels endpoint returns some labels but the push from docker seems to be missing still.

Now I will try to debug this or switch to Alloy for docker log ingestion.

Thanks!