@@ -62,7 +62,6 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
6262 with tracer .start_as_current_span (self .server .name ) as root_span :
6363 root_span .set_attribute ("session_id" , self .server .session_id )
6464 root_span .set_attribute ("command" , self .server .command )
65- root_span .set_attribute ("env" , self .server .env )
6665 root_span .set_attribute ("args" , self .server .args )
6766 self .signalr_client = SignalRClient (
6867 signalr_url ,
@@ -222,7 +221,6 @@ async def _register(self) -> None:
222221 async with stdio_client (server_params ) as (read , write ):
223222 async with ClientSession (read , write ) as session :
224223 logger .info ("Initializing client session..." )
225-
226224 # Try to initialize with timeout
227225 try :
228226 await asyncio .wait_for (
@@ -242,14 +240,17 @@ async def _register(self) -> None:
242240 # We don't continue with registration here - we'll do it after the context managers
243241
244242 except Exception as e :
245- # Handle any other exceptions that occur
246- logger .error (f"Error during server initialization: { e } " )
247- raise UiPathMcpRuntimeError (
248- "SERVER_ERROR" ,
249- "Server initialization failed" ,
250- str (e ),
251- UiPathErrorCategory .DEPLOYMENT ,
252- ) from e
243+ # Just log the exception during cleanup - it's expected
244+ if "ProcessLookupError" in str (e ) or "ExceptionGroup" in str (e ):
245+ logger .info ("Process already terminated during cleanup - this is expected" )
246+ else :
247+ logger .error (f"Error during server initialization: { e } " )
248+ raise UiPathMcpRuntimeError (
249+ "SERVER_ERROR" ,
250+ "Server initialization failed" ,
251+ str (e ),
252+ UiPathErrorCategory .DEPLOYMENT ,
253+ ) from e
253254
254255 # Now that we're outside the context managers, check if initialization succeeded
255256 if not initialization_successful :
0 commit comments