FujiwaraChoki/MoneyPrinterV2 · error · PostBridgeClientError

Request to Post Bridge failed

Error message

Request to Post Bridge failed: {last_exception}

What it means

Raised by PostBridgeClient._request when every retry attempt fails with a transport-level exception (connection error, timeout, TLS failure) so there is no HTTP response to inspect. The last underlying exception is chained into the message for diagnosis.

Solutions

  1. Check basic connectivity: curl the API base URL from the same machine
  2. Inspect the chained last_exception (DNS? TLS? timeout?) to narrow the cause
  3. Increase timeout / max_retries for large uploads that time out on slow links
  4. Configure proxy settings if a corporate network intercepts traffic

Example fix

// before
raise PostBridgeClientError(f"Request to Post Bridge failed: {last_exception}")

// after
raise PostBridgeClientError(
    f"Request to Post Bridge failed after {self._max_retries} attempts: "
    f"{type(last_exception).__name__}: {last_exception}"
) from last_exception
Defensive patterns

Strategy: retry

Try / catch

try:
    client.create_post(...)
except PostBridgeClientError as exc:
    if "Request to Post Bridge failed" in str(exc):
        # transport-level failure: back off and retry once after connectivity check
        time.sleep(10)
        client.create_post(...)
    else:
        raise

Prevention

When it happens

Trigger: Network offline, DNS resolution failure for the API host, connection refused (service down), TLS certificate errors, or read timeouts exceeding the retry budget across all attempts.

Common situations: Local machine loses connectivity, corporate proxy blocking the API host, DNS misconfiguration, the API endpoint temporarily down, or an over-aggressive timeout on large media uploads.

Related errors


AI-assisted analysis of FujiwaraChoki/MoneyPrinterV2@5192af8eca (2026-08-28). Data as JSON: /api/errors/cde669cb3ab77e5f. Report an issue: GitHub.

Appendix: source

Thrown at src/classes/PostBridge.py:250

                )
            except requests.RequestException as exc:
                last_exception = exc
                if attempt == self._max_retries:
                    break
                time.sleep(0.5 * attempt)
                continue

            if response.status_code in expected_statuses:
                return response

            if (
                response.status_code in self.RETRYABLE_STATUS_CODES
                and attempt < self._max_retries
            ):
                time.sleep(0.5 * attempt)
                continue

            raise PostBridgeClientError(
                self._build_http_error(response),
                status_code=response.status_code,
            )

        raise PostBridgeClientError(
            f"Request to Post Bridge failed: {last_exception}",
        ) from last_exception

    def _build_http_error(self, response: requests.Response) -> str:
        try:
            response_json = response.json()
        except ValueError:
            response_json = None

        details = None

        if isinstance(response_json, dict):
            if isinstance(response_json.get("error"), list):

View on GitHub (pinned to 5192af8eca)