General Diagnostics: NATS Module Readiness and Connectivity ​
Symptom ​
- The NATS module is not in a
Readystate. - The Eventing module reports that it cannot connect to the NATS backend.
- NATS Pods are in a
CrashLoopBackOfforPendingstate.
Cause ​
Issues with the NATS module can stem from misconfigurations in the NATS custom resource (CR), problems with the underlying Kubernetes nodes, or storage issues with Persistent Volume Claims (PVCs).
Solution ​
1. Check the NATS CR Status ​
To verify the health of the NATS cluster, check the NATS CR.
bashkubectl get nats -n kyma-systemLook for
STATE: Ready. If the state isErrororProcessing, inspect the CR for detailed error messages.bashkubectl get nats {NATS_CR_NAME} -n kyma-system -o yamlReview the
status.conditionsto understand the root cause.
2. Check the NATS Pods ​
Ensure all NATS Pods are running correctly.
bashkubectl get pods -n kyma-system -l nats_cluster=eventing-natsIf any Pods are not in the
Runningstate, usekubectl describe podandkubectl logsto investigate further.
3. Check the Persistent Volume Claims (PVCs) ​
If you use file storage, a common issue is a problem with the PVCs.
bashkubectl get pvc -n kyma-system -l nats_cluster=eventing-natsCheck the
STATUScolumn. If a PVC isPending, there may be no available Persistent Volume that satisfies its request. If it isBound, check if it is full by referring to the "NATS Backend Storage Is Full" guide.
4. Inspect the NATS JetStream ​
If the cluster appears healthy, you can inspect the JetStream components directly using the NATS CLI.
Ensure that you have access to the NATS server (see Accessing the NATS Server Using CLI).
Port-forward to a NATS Pod.
bashkubectl -n kyma-system port-forward svc/eventing-nats 4222Verify that the
kymastream exists.bash$ nats stream ls â•────────────────────────────────────────────────────────────────────────────╮ │ Streams │ ├──────┬─────────────┬─────────────────────┬──────────┬───────┬──────────────┤ │ Name │ Description │ Created │ Messages │ Size │ Last Message │ ├──────┼─────────────┼─────────────────────┼──────────┼───────┼──────────────┤ │ sap │ │ 2022-05-03 00:00:00 │ 0 │ 318 B │ 5.80s │ ╰──────┴─────────────┴─────────────────────┴──────────┴───────┴──────────────╯If the stream exists, check the timestamp of the
Last Messagethat the stream received. A recent timestamp would mean that the event was published correctly.Check if the consumers were created and have the expected configurations.
bashnats consumer infoTo correlate the consumer to the Subscription and the specific event type, check the
descriptionfield of the consumer.If the PVC storage is fully consumed and matches the stream size as shown above, the stream can no longer receive messages. Either increase the PVC storage size (see NATS Backend Storage Is Full) or set the
MaxBytesproperty which removes the old messages.