flanksource / canary-checker

Kubernetes Native Health Check Platform
https://canarychecker.io
Apache License 2.0
183 stars 32 forks source link

[Bug] Status history and spec not working #1979

Closed DanielCastronovo closed 1 month ago

DanielCastronovo commented 1 month ago

I use the latest helm chart.

Steps I've deployed the Helm chart, with external DB & Ingress for UI only.

image:
  type: minimal
disablePostgrest: true
serviceMonitor: true
grafanaDashboards: true

db:
  embedded:
    persist: false
  external:
    enabled: true
    secretKeyRef:
      name: canary-checker-postgres
      key: DB_URL

data:
  defaultSearchWindow: 1h
  cacheTimeoutDays: 90
  checkStatusRetentionDays: 365
  checkRetentionDays: 15
  canaryRetentionDays: 15

ingress:
  enabled: false

flanksource-ui:
  fullnameOverride: "canary-checker-ui"
  ingress:
    enabled: true
    className: "alb"
    host: ${hostname}
    annotations:
      alb.ingress.kubernetes.io/tags: Project=monitoring,Team=infra,Stack=canary-checker
      alb.ingress.kubernetes.io/scheme: "internet-facing"
      alb.ingress.kubernetes.io/target-type: "ip"
      alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
    tls:
      - hosts:
        - ${hostname}
        paths:
        - path: /*
          pathType: Prefix
extra:
  nodeSelector:
    role: monitoring

The database are fulfilled : OK Backend connection to DB : OK Frontend connection to Backend : OK

No error log related to a missconfiguration.

But, i've got lot of 404 on the UI (status history & spec). {"time":"2024-07-10T08:56:01.494873956Z","id":"","remote_ip":"XX.XX.XX.XX","host":"canary-checker:8080","method":"GET","uri":"/db/canaries?id=eq.ca4925b7-4b84-4b13-ab02-bf57979d8466","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36","status":404,"error":"code=404, message=Not Found","latency":44930,"latency_human":"44.93µs","bytes_in":0,"bytes_out":24} image

nextjs@canary-checker-ui-b654869df-f8bkl:/app$ curl http://localhost:3000/api/canary/api/summary
{"duration":1,"runnerName":"local","checks_summary":[{"id":"019098b4-e144-b19d-8375-7816f50fd72b","canary_id":"ca4925b7-4b84-4b13-ab02-bf57979d8466","canary_name":"http-check","canary_namespace":"canary-checker","labels":{"app.kubernetes.io/instance":"infra-canary-checker-sandbox"},"last_transition_time":"2024-07-09T18:15:39.403818Z","latency":{"p99":30001,"p95":30001,"rolling1h":0},"name":"basic-check","namespace":"canary-checker","status":"unhealthy","type":"http","uptime":{"passed":0,"failed":12,"last_fail":"2024-07-10T06:45:39Z"},"last_runtime":"2024-07-10T06:45:39.011428Z","created_at":"2024-07-09T18:15:09.380118Z","updated_at":"2024-07-10T06:45:39.011768Z"}]}

i've checked in local deployment with the same helm Chart, it's works (with no DB, no ingress)

DanielCastronovo commented 1 month ago

When i try to directly curl the url from the backend or the frontend, nothing is worked. But on DB, the data exist with the ID ca4925b7-4b84-4b13-ab02-bf57979d8466

DanielCastronovo commented 1 month ago
curl http://localhost:3000/api/canary/api/graph?check=***
{"duration":1,"runnerName":"local","status":null,"latency":{"rolling1h":0},"uptime":{"passed":0,"failed":0}}
curl http://localhost:3000/api/db/checks?check=***       
{"message":"Not Found"}
curl http://172.20.65.193:8080/api/summary
{"duration":2,"runnerName":"local","checks_summary":[{"id":"019098b4-e144-b19d-8375-7816f50fd72b","canary_id":"ca4925b7-4b84-4b13-ab02-bf57979d8466","canary_name":"http-check","canary_namespace":"canary-checker","labels":{"app.kubernetes.io/instance":"infra-canary-checker-sandbox"},"last_transition_time":"2024-07-10T07:02:01.773178Z","latency":{"p99":500,"p95":500,"rolling1h":0},"name":"basic-check","namespace":"canary-checker","status":"healthy","type":"http","uptime":{"passed":12,"failed":0,"last_pass":"2024-07-10T14:12:51Z"},"last_runtime":"2024-07-10T14:12:51.103382Z","created_at":"2024-07-09T18:15:09.380118Z","updated_at":"2024-07-10T14:12:51.103646Z"}]}
DanielCastronovo commented 1 month ago

Resolved with this parameter : disablePostgrest: false But, it could be nice to rework the helm chart to set this parameter to false, if external db is true