Why am I frequently encountering 504 errors when calling Google Ads via Connect Proxy?

This topic was automatically generated from Slack. You can find the original thread here.

Hi all, good day! I’m running into frequent 504 errors when calling Google Ads via Connect Proxy, and the error message indicates the connection fails during the connection open phase (not during request processing):
Error
Component: Connect Proxy
HTTP status: 504
• Message: Connection timed out while opening the connection.
• Observed behavior: failures often occur quickly (connection/open phase), followed by retries with exponential backoff (e.g., 2s / 4s / 8s / 16s / 30s).
dose anybody also meet this error?

I use python sdk, version is pipedream = "^1.0.8"

Google Ads is a bit unique since we have to send Pipedream’s developer token in every request: https://pipedream.com/docs/connect/api-proxy#google-ads

Hi , thank you for your reply. I think currently we do meet this requirements, we found pipedream return following error message:

headers: {
  'date': 'Sun, 01 Mar 2026 23:57:40 GMT',
  'content-type': 'application/json; charset=utf-8',
  'content-length': '62',
  'connection': 'keep-alive',
  'x-pd-proxy-error': 'request never sent to proxy'
}, status_code: 504, body: {
  'error': 'Connection timed out while opening the connection.'
}

The header indicate pipedream may not sent reqeuset to proxy

That’s how I read that too. My guess is maybe something is wrong with how you’re initializing the SDK client or forming the payload.

ok, let me check our payload again

Hi , I checked again and we still meet this error, like below

pd.proxy.post(
  url="https://googleads.m.pipedream.net",
  account_id="google_ads_account",
  external_user_id="tenant...",
  body={
    "method": "post",
    "url": "/v22/customers/accountId:generateKeywordIdeas",
    "headers": {
      "login-customer-id": "accountId"
    },
    "data": {
      "geoTargetConstants": ["geoTargetConstants/2840"],
      "keywordPlanNetwork": "GOOGLE_SEARCH",
      "includeAdultKeywords": "False",
      "keywordSeed": {...},
      "language": "languageConstants/1000",
      "pageSize": "60"
    }
  }
}

sdk client init:

AsyncPipedream(
            project_id=config.pipedream.project_id,
            project_environment=config.pipedream.environment,
            client_id=config.pipedream.client_id,
            client_secret=config.pipedream.client_secret,
        )

still meet

headers: {
  'date': 'Mon, 02 Mar 2026 07:02:05 GMT',
  'content-type': 'application/json; charset=utf-8',
  'content-length': '62',
  'connection': 'keep-alive',
  'x-pd-proxy-error': 'request never sent to proxy'
}, status_code: 504, body: {
  'error': 'Connection timed out while opening the connection.'
}, 

and after retry may succeed, but not every time retry can solve issue

@U03EGTE5WC8 can you guys help? ^

Yes, I’ll check it!

,
After analyzing and attempting to reproduce the scenarios, I was able to validate the behavior and everything is working as expected. Since you mentioned that this issue doesn’t happen consistently, it could be related to some intermittent instability on the Google Ads side.
Which actions were you testing that most frequently triggered the 504 error?

Have you already tried reproducing this through the Demo app?

Dm you as there are some sensitive information