Skip to content

[DPE-10235] fix: bypass HTTP proxy for intra-cluster Patroni API calls#132

Draft
marceloneppel wants to merge 3 commits into
16/edgefrom
fix/proxy-bypass-patroni-api
Draft

[DPE-10235] fix: bypass HTTP proxy for intra-cluster Patroni API calls#132
marceloneppel wants to merge 3 commits into
16/edgefrom
fix/proxy-bypass-patroni-api

Conversation

@marceloneppel

@marceloneppel marceloneppel commented May 27, 2026

Copy link
Copy Markdown
Member

Issue

When deployed behind an HTTP proxy (configured via cloudinit-userdata writing to /etc/environment), parallel_patroni_get_request picks up HTTPS_PROXY and routes intra-cluster Patroni API calls through the proxy. Unlike requests/urllib3, httpx does not honor CIDR ranges in no_proxy (e.g. 10.0.0.0/8), so Squid receives the CONNECT request and returns httpx.ProxyError: 403 Forbidden. This causes cluster_status() and get_primary() to fail, leaving the charm stuck in "awaiting start of the primary".

Solution

Set trust_env=False on httpx.AsyncClient in parallel_patroni_get_request so proxy environment variables are ignored for intra-cluster Patroni communication.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Set trust_env=False on httpx.AsyncClient in parallel_patroni_get_request
so proxy environment variables are ignored for intra-cluster Patroni
communication.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Verify that AsyncClient is created with trust_env=False to prevent
proxy environment variables from intercepting intra-cluster Patroni
API calls.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel marceloneppel changed the title fix: bypass HTTP proxy for Patroni REST API calls fix: bypass HTTP proxy for intra-cluster Patroni API calls May 28, 2026
@marceloneppel marceloneppel added the bug Something isn't working label May 28, 2026
@marceloneppel marceloneppel changed the title fix: bypass HTTP proxy for intra-cluster Patroni API calls [DPE-10235] fix: bypass HTTP proxy for intra-cluster Patroni API calls Jun 1, 2026
@marceloneppel marceloneppel deleted the fix/proxy-bypass-patroni-api branch June 2, 2026 12:18
@marceloneppel marceloneppel restored the fix/proxy-bypass-patroni-api branch June 2, 2026 19:54
@marceloneppel marceloneppel reopened this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant