Key error while sending data to AWS s3 from loki

"failed to read cluster seed file" err="failed to get s3 object: NoSuchKey: The specified key does not exist.\n\tstatus code: 404, request id: YJK8G8Q59PFQX49M, host id: 3IWUZ96OPIWdYJ9p8+zMRoSCGT4bd872+HCZpubM04PSKxPR2d5WHekPW7ZKJbX70xeMTX3LBSs=" 

This is the error I am getting…But its uploaded one file with name loki_cluster_seed.json and with the contents

{"UID":"246af642-19c5-4dd7-9e41-a30155126a0a","created_at":"2024-09-10T10:50:31.869013055+05:30","version":{"version":"2.9.10","revision":"7664eda07b","branch":"HEAD","buildUser":"root@98f97496e533","buildDate":"2024-08-09T18:28:28Z","goVersion":"go1.22.5"}}

Blockquote

And my loki config file is

auth_enabled: false

server:
  http_listen_port: 3100
  log_level: debug

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

schema_config:
  configs:
  - from: 2020-05-15
    store: tsdb
    object_store: s3
    schema: v13
    index:
      prefix: index_
      period: 24h

storage_config:
  tsdb_shipper:
    active_index_directory: /loki/index
    cache_location: /loki/index_cache
  aws:
    bucketnames: loki-new
    region: us-west-2
    access_key_id: ****************************
    secret_access_key: ***********************
    insecure: false
    http_config:
      idle_conn_timeout: 90s
      response_header_timeout: 0s
      insecure_skip_verify: false
    s3forcepathstyle: true

It automatically uploads that json file but gives an error…What might be the issue!

The seed file is for the analytics collection by Grafana (see Grafana Loki configuration parameters | Grafana Loki documentation). If you accidentally deleted it then it’ll error but doesn’t actually break anything. You can either ignore it, or disable analytics to not create the file.

1 Like

What are the changes need to do to store the logs to my AWS s3 bucket…I refer the documentation also and configured exact what it has in the documentation but its not stored the logs to s3.Can you suggest the loki config file to store the logs to s3.

There are examples here: Storage | Grafana Loki documentation

Essentially you want to:

  1. Specify a storage configuration for AWS S3.
  2. Reference that AWS S3 storage from your index schema configuration.