{"record":{"id":"728a29d3afb5b6c0","repo":"oraios/serena","slug":"error-processing-request-method-with-params-pa","errorCode":null,"errorMessage":"Error processing request {method} with params:\n{params}","messagePattern":"Error processing request (.+?) with params:\n(.+?)","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls_process.py","lineNumber":385,"sourceCode":"        \"\"\"\n        result = self._send_request_once(method, params)\n        if not result.is_error():\n            log.debug(\"Returning result:\\n%s\", result.payload)\n            return result.payload\n\n        if method in self._content_modified_retry_methods:\n            for attempt in range(2, _CONTENT_MODIFIED_MAX_ATTEMPTS + 1):\n                is_content_modified = isinstance(result.error, LSPError) and result.error.code == LSPErrorCodes.ContentModified\n                if not is_content_modified:\n                    break\n                log.info(\"Request %s got ContentModified (-32801); retrying (%d/%d)\", method, attempt, _CONTENT_MODIFIED_MAX_ATTEMPTS)\n                time.sleep(_CONTENT_MODIFIED_RETRY_DELAY)\n                result = self._send_request_once(method, params)\n                if not result.is_error():\n                    log.debug(\"Returning result:\\n%s\", result.payload)\n                    return result.payload\n\n        raise SolidLSPException(f\"Error processing request {method} with params:\\n{params}\", cause=result.error) from result.error\n\n    @abstractmethod\n    def _send_payload(self, payload: StringDict) -> None:\n        \"\"\"\n        Send the given payload to the server\n        \"\"\"\n\n    def on_request(self, method: str, cb: Callable[[Any], Any]) -> None:\n        \"\"\"\n        Register the callback function to handle requests from the server to the client for the given method\n        \"\"\"\n        self.on_request_handlers[method] = cb\n\n    def on_notification(self, method: str, cb: Callable[[Any], None]) -> None:\n        \"\"\"\n        Register the callback function to handle notifications from the server to the client for the given method\n        \"\"\"\n        self.on_notification_handlers[method] = cb","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls_process.py#L367-L403","documentation":"SolidLSPException raised by send_request (src/solidlsp/ls_process.py:385) after the language server returned an error result for an LSP request, even after retrying on Content-Modified. The original LSP error is attached as `cause` (`result.error`). It means the server itself rejected or failed to process the request.","triggerScenarios":"Calling any request-style API (request_document_symbols, request_definition, request_hover, etc.) when the server replies with a JSON-RPC error such as 'Content modified' repeatedly, 'Server not initialized', method not supported, or an internal server error.","commonSituations":"Sending requests before server initialization completes; editing files faster than the server re-indexes (repeated Content-Modified); requesting capabilities the language server doesn't support; server internal crash on a malformed request.","solutions":["Inspect the `cause` attribute of the exception to see the actual LSP error message from the server.","Ensure the language server is fully started/initialized before sending requests.","Retry after a short delay if the cause is 'Content modified' (server is re-indexing).","Verify the requested method/capability is supported by the configured language server."],"exampleFix":"// before\nresult = ls.request_document_symbols(file_path)\n// after\ntry:\n    result = ls.request_document_symbols(file_path)\nexcept SolidLSPException as e:\n    log.warning(\"LSP request failed: %s\", e.cause)\n    time.sleep(1.0)\n    result = ls.request_document_symbols(file_path)","handlingStrategy":"try-catch","validationCode":"assert ls.is_running(), \"language server not started\"\n# only request capabilities the server advertises\nif not ls.server_capabilities.get(\"documentSymbolProvider\"):\n    raise SkipCapability(\"documentSymbol unsupported\")","typeGuard":"def lsp_error_has(cause: str) -> bool:\n    return \"Content modified\" in cause","tryCatchPattern":"for attempt in range(3):\n    try:\n        return ls.request_document_symbols(path)\n    except SolidLSPException as e:\n        if \"Content modified\" in str(e.cause) and attempt < 2:\n            time.sleep(1.0)\n            continue\n        raise","preventionTips":["Wait for server initialization before issuing requests","Rate-limit edits to give the server time to re-index","Always inspect the `cause` attribute for the real LSP error","Feature-check server_capabilities before requesting a method"],"tags":["lsp","request-failed","solidlsp"],"backgroundTag":"lsp-server-request-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}