{"record":{"id":"c840ec32ff506084","repo":"oraios/serena","slug":"api-request-failed-with-http-error-e","errorCode":null,"errorMessage":"API request failed with HTTP error: {e}","messagePattern":"API request failed with HTTP error: (.+?)","errorType":"exception","errorClass":"PluginServerError","httpStatus":null,"severity":"error","filePath":"src/serena/jetbrains/jetbrains_plugin_client.py","lineNumber":357,"sourceCode":"\n        except requests.exceptions.ConnectionError as e:\n            raise ConnectionError(f\"Failed to connect to Serena service at {url}: {e}\")\n        except requests.exceptions.Timeout as e:\n            raise ConnectionError(f\"Request to {url} timed out: {e}\")\n        except requests.exceptions.HTTPError as e:\n            if response is not None:\n                # check for recoverable error (i.e. errors where the problem can be resolved by the caller or\n                # other errors where the error text shall simply be passed on to the LLM).\n                # The plugin returns 400 for such errors (typically illegal arguments, e.g. non-unique name path)\n                # but only since version 2023.2.6\n                if self.is_version_at_least(2023, 2, 6):\n                    is_recoverable_error = response.status_code == 400\n                else:\n                    is_recoverable_error = True  # assume recoverable for older versions (mix of errors)\n                if is_recoverable_error:\n                    raise APIError(response)\n                raise PluginServerError(f\"API request failed with status {response.status_code}: {response.text}\")\n            raise PluginServerError(f\"API request failed with HTTP error: {e}\")\n        except requests.exceptions.RequestException as e:\n            raise SerenaClientError(f\"Request failed: {e}\")\n\n    @staticmethod\n    def _pythonify_response(response: T) -> T:\n        \"\"\"\n        Converts dictionary keys from camelCase to snake_case recursively.\n\n        :response: the response in which to convert keys (dictionary or list)\n        \"\"\"\n        to_snake_case = lambda s: \"\".join([\"_\" + c.lower() if c.isupper() else c for c in s])\n\n        def convert(x):\n            if isinstance(x, dict):\n                return {to_snake_case(k): convert(v) for k, v in x.items()}\n            elif isinstance(x, list):\n                return [convert(item) for item in x]\n            else:","sourceCodeStart":339,"sourceCodeEnd":375,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/jetbrains/jetbrains_plugin_client.py#L339-L375","documentation":"When requests raises an HTTPError but the response object is unavailable (response is None), _make_request raises PluginServerError('API request failed with HTTP error: {e}') — the request failed at HTTP level without a usable response body to inspect or classify as recoverable.","triggerScenarios":"HTTP-level failure where response was never assigned/available in the except block, e.g. errors raised before a response was fully received; typically seen from the same callers (init, find_symbol, move, find_references, get_symbols_overview, get_supertypes).","commonSituations":"Malformed responses/connection drops mid-exchange; plugin service restarting between connect and response; unusual proxy behavior.","solutions":["Retry the request; transient connection drops resolve after the plugin service settles","Restart the IDE/plugin service if it recurs","Check proxy/localhost networking as in connection errors","Update the plugin and client to matched versions"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    overview = client.get_symbols_overview(relative_path=\"src\")\nexcept (PluginServerError, ConnectionError) as e:\n    log.warning(\"Plugin request failed (%s); retrying once\", e)\n    overview = retry_once(lambda: client.get_symbols_overview(relative_path=\"src\"))","preventionTips":["Add one retry for transient plugin-request failures","Verify proxy/localhost networking configuration","Update plugin + client together to reduce protocol mismatches","Restart the IDE if failures repeat"],"tags":["jetbrains","http","network","api"],"backgroundTag":"http-request-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}