Skip to content

[BUG] Gateway fails to connect to services behind CDNs/load balancers due to DNS resolution #744

@crivetimihai

Description

@crivetimihai

Problem

When adding a gateway with a domain name (e.g., https://example-service.cloud-provider.com/sse), the gateway service resolves the domain to its IP address and then tries to connect directly to that IP. This fails for services behind CDNs, load balancers, or reverse proxies where the IP address doesn't accept direct connections.

Error Example

Failed to initialize gateway at https://[RESOLVED_IP]/sse
ERROR - GatewayConnectionError in group: (GatewayConnectionError('Failed to initialize gateway at https://[RESOLVED_IP]/sse'),)

Root Cause

The normalize_url() method in gateway_service.py uses socket.gethostbyname() to resolve domain names to IP addresses. This was introduced in PR #712.

Solution

Remove the DNS resolution logic and preserve the original domain names in URLs.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions