The “upstream status 500” in Kong Gateway means that Kong successfully forwarded the client request to the upstream service (your backend/API), but the upstream service itself responded with a 500 Internal Server Error.
🔍 What this typically indicates:
- The issue is with the upstream service, not Kong.
- Kong acted as a proxy and did its job correctly; the 500 came from your backend application.
🔁 Common causes on the upstream (backend) side:
- Unhandled exceptions (e.g., null pointer, syntax errors).
- Backend server crashed or restarted.
- Database connection failures.
- Application logic bug.
- Timeouts or memory issues in the backend.
🧪 How to troubleshoot:
- Check upstream (backend) logs at the time of the 500.
- Use curl directly on the backend API to verify behavior:
curl -i http://<upstream_host>:<port>/<path> - Enable debug logging in Kong if you want to trace the request:
kong reload exit --conf kong.conf --vv - Look in Kong logs:
/usr/local/kong/logs/error.log- See if Kong shows errors related to the upstream or if it just reports the 500.
🧩 Helpful Kong log fields:
If using Splunk or another log aggregator:
status: final status returned to clientupstream_status: status from upstream (i.e. 500)upstream_uri: target path Kong used to reach the servicelatencies.proxy,latencies.kong,latencies.request: for performance analysis
Let me know if you’d like a diagram of the request flow or want help decoding a specific log line.