FujiwaraChoki/MoneyPrinterV2 · error · PostBridgeClientError
Request to Post Bridge failed: {last_exception}
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.
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)
Solutions
- Check basic connectivity: curl the API base URL from the same machine
- Inspect the chained last_exception (DNS? TLS? timeout?) to narrow the cause
- Increase timeout / max_retries for large uploads that time out on slow links
- 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
- Rely on the client's built-in retry budget; tune _max_retries/timeout for large uploads
- Monitor DNS and TLS health of the API host in long-running jobs
- Wrap crossposting jobs in an outer retry-with-backoff to survive transient outages
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
- Post Bridge returned an invalid social accounts payload.
- Media file does not exist: {file_path}
- Post Bridge did not return a media_id and upload_url.
- Post Bridge returned a non-JSON response.
- Unsupported provider '{provider}'. Expected 'twitter' or 'yo
AI-assisted analysis of FujiwaraChoki/MoneyPrinterV2@5192af8eca (2026-08-28).
Data as JSON: /api/errors/cde669cb3ab77e5f.
Report an issue: GitHub.