Runbook: PolarisAPIExceptions¶
Alerte : PolarisAPIExceptions (PrometheusRule, severity critical)
Symptôme :
Apache Polaris (Iceberg catalog) retourne des exceptions > 2% des requêtes. Les queries Trino, Spark et dbt écrivent/lisent des tables Iceberg échouent.
Severity : 🔴 critical — impacts TOUT le data lakehouse
Diagnostic¶
1. État des pods Polaris¶
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl get pod -n akko -l app.kubernetes.io/name=polaris
kubectl describe pod -n akko -l app.kubernetes.io/name=polaris | tail -30
2. Logs serveur¶
kubectl logs -n akko -l app.kubernetes.io/name=polaris --tail=200 | \
grep -iE "error|exception|stack" | head -30
3. Health endpoint¶
kubectl port-forward -n akko svc/akko-polaris 8181:8181 &
curl -f http://localhost:8181/q/health
# Attendu : {"status": "UP"}
4. Backend PostgreSQL¶
kubectl exec -n akko akko-postgresql-0 -- \
psql -U postgres -d polaris -c "SELECT count(*) FROM public.tables;"
5. Backend object storage¶
Causes fréquentes + fix¶
| Cause | Symptôme | Fix |
|---|---|---|
| Postgres pool épuisé | unable to acquire JDBC connection |
Bump quarkus.datasource.jdbc.max-size (default 20) |
| object storage credentials expirés | AccessDenied, InvalidAccessKeyId |
Régénérer creds + kubectl rollout restart Polaris |
| S3 bucket not found | NoSuchBucket |
Recréer : mc mb local/akko-warehouse |
| OPA policy bloque | 403 Forbidden, user not authorized |
Vérifier bundle OPA: kubectl logs -n akko opa --tail=50 |
| Namespace PII supprimé en cours de query | namespace not found |
Vérifier DROP NAMESPACE n'est pas en cours |
| DB migration manquée | column X does not exist |
Relancer polaris-init job |
| Keycloak JWT mal validé | 401 Unauthorized |
Vérifier quarkus.oidc.auth-server-url correct (L04) |
Fix d'urgence (< 5 min)¶
Rolling restart¶
kubectl rollout restart deploy/akko-polaris -n akko
kubectl rollout status deploy/akko-polaris -n akko --timeout=180s
Test Trino → Polaris end-to-end¶
kubectl exec -n akko deploy/akko-trino -- \
trino --execute="SHOW SCHEMAS FROM iceberg"
# Doit retourner au moins : default, banking
Vérifier object storage writable¶
kubectl exec -n akko akko-minio-0 -- \
mc cp /etc/hostname local/akko-warehouse/healthcheck.txt && \
mc cat local/akko-warehouse/healthcheck.txt
Fix pérenne (R02)¶
Augmenter le pool DB¶
# helm/akko/charts/akko-polaris/values.yaml
env:
- name: QUARKUS_DATASOURCE_JDBC_MAX_SIZE
value: "50" # was 20
- name: QUARKUS_DATASOURCE_JDBC_INITIAL_SIZE
value: "5"
HA multi-replicas¶
Polaris est stateless (état en DB+object storage), donc scalable horizontalement :
Monitoring OPA cohabitation¶
OPA bloque silencieusement. Vérifier dans Dashboards le dashboard "OPA decisions" (ratio allow/deny par principal).
Prévention¶
- PrometheusRule granulaire :
- Smoke test hebdomadaire :
CREATE TABLE → INSERT → SELECT → DROPdepuis Trino - Backup DB polaris + object storage warehouse via CronJob S8-D
- OPA bundle versioning pour rollback rapide si une policy bloque
Lessons learned¶
- Polaris + Keycloak backchannel-dynamic (L04) est critique en k3d ou lorsque pod-to-pod DNS différent de user DNS.
polaris-initDOIT être idempotent — voir l'architecture sidecar (R06).
Liens utiles¶
- Services / Polaris
- Keycloak SSO broken — parfois lié
- logs layer :
{namespace="akko", app="polaris"} |= "error"