Envoy 503 Service Unavailable

The upstream server is not available or not responding.

Understanding Envoy Proxy

Envoy is a high-performance open-source edge and service proxy designed for cloud-native applications. It is used to manage network traffic, providing features like load balancing, service discovery, and observability. Envoy is often deployed as a sidecar in microservices architectures to handle communication between services.

Identifying the 503 Service Unavailable Error

When using Envoy, you might encounter the 503 Service Unavailable error. This error indicates that the proxy is unable to connect to the upstream server, resulting in a failure to process the request.

What You See

Clients attempting to connect through Envoy receive a 503 error, often accompanied by messages like "upstream connect error" or "connection failure."

Root Cause of the 503 Error

The primary cause of the 503 error is that the upstream server is either down or not responding. This can happen due to various reasons such as server crashes, network issues, or misconfigurations.

Common Scenarios

  • The upstream service is not running.
  • Network connectivity issues between Envoy and the upstream server.
  • Misconfigured Envoy routes or clusters.

Steps to Resolve the 503 Error

1. Verify Upstream Server Health

Ensure that the upstream server is running and healthy. You can use tools like curl to check the server's status:

curl -I http://upstream-server-address

If the server is not responding, restart it and check the logs for any errors.

2. Check Network Connectivity

Ensure that there are no network issues preventing Envoy from reaching the upstream server. Use ping or traceroute to diagnose connectivity problems:

ping upstream-server-address

3. Review Envoy Configuration

Check the Envoy configuration files to ensure that the routes and clusters are correctly set up. Pay attention to the cluster configuration and ensure that the service discovery settings are correct.

static_resources:
clusters:
- name: my_service
connect_timeout: 0.25s
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: my_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: upstream-server-address
port_value: 80

Conclusion

By following these steps, you can diagnose and resolve the 503 Service Unavailable error in Envoy. Ensuring that the upstream server is healthy, network connectivity is intact, and configurations are correct will help maintain a smooth operation of your services. For more detailed information, refer to the Envoy documentation.

Never debug

Envoy

manually again

Let Dr. Droid create custom investigation plans for your infrastructure.

Book Demo
Automate Debugging for
Envoy
See how Dr. Droid creates investigation plans for your infrastructure.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid