Open invidian opened 2 years ago
We have the same problem on loki 2.2.0, loki 2.2.1, loki 2.3.0, 2.4.2 Any workaround to skip the corrupted gzipped files?
We also face this issue on loki 2.4.2. Any update so far?
same here
stack trace:
panic: EOF
goroutine 386 [running]:
github.com/grafana/loki/pkg/storage/stores/shipper/util.getGzipReader(0x2b0e4e0, 0xc012635730, 0xc012635730, 0x2b0e4e0)
/src/loki/pkg/storage/stores/shipper/util/util.go:44 +0x119
github.com/grafana/loki/pkg/storage/stores/shipper/util.GetFileFromStorage(0x2b52dc0, 0xc000c00b40, 0x7f7dbbd8a7c8, 0xc0005a5a60, 0xc008f50db0, 0xb, 0xc016e82f8c, 0x28, 0xc016e830e0, 0x5c, ...)
/src/loki/pkg/storage/stores/shipper/util/util.go:98 +0x7a7
github.com/grafana/loki/pkg/storage/stores/shipper/downloads.(*Table).downloadFile(0xc008f27720, 0x2b52dc0, 0xc000c00b40, 0xc016e82f8c, 0x28, 0x6ff2b40, 0xed9a609dd, 0x3c26ea0, 0x0, 0x0)
/src/loki/pkg/storage/stores/shipper/downloads/table.go:437 +0x377
github.com/grafana/loki/pkg/storage/stores/shipper/downloads.(*Table).Sync(0xc008f27720, 0x2b52dc0, 0xc000c00b40, 0x0, 0x0)
/src/loki/pkg/storage/stores/shipper/downloads/table.go:376 +0x5d9
github.com/grafana/loki/pkg/storage/stores/shipper/downloads.(*TableManager).syncTables(0xc00061e5a0, 0x2b52dc0, 0xc000c00b40, 0x0, 0x0)
/src/loki/pkg/storage/stores/shipper/downloads/table_manager.go:210 +0x255
github.com/grafana/loki/pkg/storage/stores/shipper/downloads.(*TableManager).loop(0xc00061e5a0)
/src/loki/pkg/storage/stores/shipper/downloads/table_manager.go:99 +0x20d
created by github.com/grafana/loki/pkg/storage/stores/shipper/downloads.NewTableManager
/src/loki/pkg/storage/stores/shipper/downloads/table_manager.go:82 +0x245
config:
auth_enabled: false
server:
http_listen_port: 3100
grpc_listen_port: 9096
common:
path_prefix: /home1/xuning/loki
storage:
filesystem:
chunks_directory: /home1/xuning/loki/chunks
rules_directory: /home1/xuning/loki/rules
replication_factor: 1
ring:
instance_addr: 10.10.10.88
kvstore:
store: inmemory
schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
ruler:
alertmanager_url: http://localhost:9093
chunk_store_config:
max_look_back_period: 2160h
table_manager:
retention_deletes_enabled: true
retention_period: 2160h
Another Stacktrace from (Docker) Loki 2.4.2 (revision=525040a32)
level=info ts=2022-03-29T08:49:43.751674205Z caller=util.go:109 msg="downloaded file compactor-1648529261.gz from table index_19080"
panic: EOF
goroutine 2873 [running]:
github.com/grafana/loki/pkg/storage/stores/shipper/util.getGzipReader({0x26b50e0, 0xc002194018})
/src/loki/pkg/storage/stores/shipper/util/util.go:38 +0xbc
github.com/grafana/loki/pkg/storage/stores/shipper/util.GetFileFromStorage({0x26f8640, 0xc000816f00}, {0x7ff6e8cef9a0, 0xc0000346c0}, {0xc0036dfc74, 0xb}, {0xc00348dd64, 0x17}, {0xc0036d29b0, 0x47}, ...)
/src/loki/pkg/storage/stores/shipper/util/util.go:98 +0x22e
github.com/grafana/loki/pkg/storage/stores/shipper/compactor.(*table).compactFiles.func1()
/src/loki/pkg/storage/stores/shipper/compactor/table.go:199 +0x2a5
created by github.com/grafana/loki/pkg/storage/stores/shipper/compactor.(*table).compactFiles
/src/loki/pkg/storage/stores/shipper/compactor/table.go:184 +0x545
Config /etc/loki/loki.yaml
auth_enabled: false
chunk_store_config:
max_look_back_period: 0s
compactor:
shared_store: filesystem
working_directory: /data/loki/boltdb-shipper-compactor
ingester:
chunk_block_size: 262144
chunk_idle_period: 3m
chunk_retain_period: 1m
lifecycler:
ring:
kvstore:
store: inmemory
replication_factor: 1
max_transfer_retries: 0
wal:
dir: /data/loki/wal
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
schema_config:
configs:
- from: "2020-10-24"
index:
period: 24h
prefix: index_
object_store: filesystem
schema: v11
store: boltdb-shipper
server:
http_listen_port: 3100
storage_config:
boltdb_shipper:
active_index_directory: /data/loki/boltdb-shipper-active
cache_location: /data/loki/boltdb-shipper-cache
cache_ttl: 24h
shared_store: filesystem
filesystem:
directory: /data/loki/chunks
table_manager:
retention_deletes_enabled: true
retention_period: 168h
Deployed to k8s using Helm chart loki-stack
(v2.6.1) where the values for Loki are the following ones
loki:
enabled: true
config:
table_manager:
retention_deletes_enabled: true
retention_period: 168h # 7d
resources:
limits:
cpu: 300m
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
persistence:
enabled: true
accessModes:
- ReadWriteOnce
size: 20Gi
ingress:
enabled: false
Further info:
A really worst thing is: when LOKI crash, it leaves a file like this
10001 10001 397M Apr 4 02:54 1649034126
inside the loki/boltdb-shipper-compactor/index_
Happening also on Loki 2.5.0
I finally realized all errors were referencing the same file compactor-1648529261.gz
, which has a timestamp around 2 months ago. I bet it was corrupted. I've solved the crashes by deleting the storage and recreating it again (dev env, no problem).
@juan-vg have you removed everything or just compactor-1648529261.gz?
@rlio the entire pvc. I bet removing just that file could fix it, but it was a dev deployment so I saved time.
I will try, but I'm not in dev env. Removing everything can't be a workaround :-(
I have the same issue. Looks like a bug
I encounter similar issue, any update here? @rlio did removing just compactor file helped?
@dorinand nothing helped. At the end, I create a new empty folder and the old as a history storage. Nothing helped me to solve the problem
Describe the bug Observed a panic when loki tries to read corrupted gzip file. I don't know why the file got corrupted, perhaps because I run out of inodes on my storage on this day.
Expected behavior Don't panic, perhaps skip corrupted files or handle error gracefully.
Environment:
Screenshots, Promtail config, or terminal output If applicable, add any output to help explain your problem.
My config: