Skip to content

Commit 8d6260f

Browse files
committed
Add MongoDB debug logging step to deploy action
Dump pod status, container logs (current + previous), init-container logs, events and binary checks for all mongodb-related pods. Runs with if: always() and continue-on-error: true so it never blocks the pipeline but captures crash details. Temporary — remove once mongodb image stability is confirmed. issue:ZENKO-5110
1 parent 6803995 commit 8d6260f

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/actions/deploy/action.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,53 @@ runs:
8585
run: ./deploy-metadata.sh
8686
working-directory: ./.github/scripts/end2end
8787
if: ${{ inputs.deploy_metadata == 'true' }}
88+
- name: '[DEBUG] Dump MongoDB pod status and logs'
89+
if: always()
90+
shell: bash
91+
run: |
92+
set -x
93+
NAMESPACE="${NAMESPACE:-default}"
94+
echo "=== MongoDB pod status ==="
95+
kubectl get pods -n "$NAMESPACE" -l app.kubernetes.io/component=mongodb -o wide 2>/dev/null || true
96+
kubectl get pods -n "$NAMESPACE" -l app.kubernetes.io/name=mongodb-sharded -o wide 2>/dev/null || true
97+
kubectl get pods -n "$NAMESPACE" | grep -i mongo || true
98+
99+
echo ""
100+
echo "=== MongoDB pod descriptions ==="
101+
for pod in $(kubectl get pods -n "$NAMESPACE" -o name 2>/dev/null | grep mongo); do
102+
echo "--- $pod ---"
103+
kubectl describe -n "$NAMESPACE" "$pod" 2>/dev/null | tail -40
104+
done
105+
106+
echo ""
107+
echo "=== MongoDB container logs ==="
108+
for pod in $(kubectl get pods -n "$NAMESPACE" -o name 2>/dev/null | grep mongo); do
109+
podname=$(basename "$pod")
110+
for container in $(kubectl get -n "$NAMESPACE" "$pod" -o jsonpath='{.spec.containers[*].name}' 2>/dev/null); do
111+
echo "--- $podname / $container (current) ---"
112+
kubectl logs -n "$NAMESPACE" "$podname" -c "$container" --tail=80 2>/dev/null || echo "(no current logs)"
113+
echo "--- $podname / $container (previous) ---"
114+
kubectl logs -n "$NAMESPACE" "$podname" -c "$container" --previous --tail=80 2>/dev/null || echo "(no previous logs)"
115+
done
116+
for container in $(kubectl get -n "$NAMESPACE" "$pod" -o jsonpath='{.spec.initContainers[*].name}' 2>/dev/null); do
117+
echo "--- $podname / init:$container ---"
118+
kubectl logs -n "$NAMESPACE" "$podname" -c "$container" --tail=40 2>/dev/null || echo "(no init logs)"
119+
done
120+
done
121+
122+
echo ""
123+
echo "=== MongoDB events ==="
124+
kubectl get events -n "$NAMESPACE" --sort-by='.lastTimestamp' 2>/dev/null | grep -i mongo || true
125+
126+
echo ""
127+
echo "=== Binary check (if pod is running) ==="
128+
mongos_pod=$(kubectl get pods -n "$NAMESPACE" -o name 2>/dev/null | grep mongos | head -1 | xargs basename 2>/dev/null) || true
129+
if [ -n "$mongos_pod" ]; then
130+
kubectl exec -n "$NAMESPACE" "$mongos_pod" -c mongos -- ls -la /opt/bitnami/mongodb/bin/ 2>/dev/null || true
131+
kubectl exec -n "$NAMESPACE" "$mongos_pod" -c mongos -- /opt/bitnami/mongodb/bin/mongod --version 2>/dev/null || true
132+
kubectl exec -n "$NAMESPACE" "$mongos_pod" -c mongos -- ldd /opt/bitnami/mongodb/bin/mongod 2>/dev/null || true
133+
fi
134+
continue-on-error: true
88135
- name: End-to-end configuration
89136
shell: bash
90137
run: bash configure-e2e.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "default"

0 commit comments

Comments
 (0)