diff --git a/skyvern/forge/agent.py b/skyvern/forge/agent.py index e9d12996..468f12ea 100644 --- a/skyvern/forge/agent.py +++ b/skyvern/forge/agent.py @@ -302,7 +302,6 @@ class ForgeAgent: except FailedToSendWebhook: LOG.exception( "Failed to send webhook", - exc_info=True, task_id=task.task_id, step_id=step.step_id, task=task, diff --git a/skyvern/forge/sdk/api/aws.py b/skyvern/forge/sdk/api/aws.py index f5300ddd..440112dd 100644 --- a/skyvern/forge/sdk/api/aws.py +++ b/skyvern/forge/sdk/api/aws.py @@ -41,7 +41,7 @@ class AsyncAWSClient: error_code = e.response["Error"]["Code"] # type: ignore except Exception: error_code = "failed-to-get-error-code" - LOG.exception("Failed to get secret.", secret_name=secret_name, error_code=error_code, exc_info=True) + LOG.exception("Failed to get secret.", secret_name=secret_name, error_code=error_code) return None @execute_with_async_client(client_type=AWSClientType.S3) diff --git a/skyvern/forge/sdk/db/client.py b/skyvern/forge/sdk/db/client.py index f56c219c..9a551108 100644 --- a/skyvern/forge/sdk/db/client.py +++ b/skyvern/forge/sdk/db/client.py @@ -165,10 +165,10 @@ class AgentDB: await session.refresh(new_artifact) return convert_to_artifact(new_artifact, self.debug_enabled) except SQLAlchemyError: - LOG.exception("SQLAlchemyError", exc_info=True) + LOG.exception("SQLAlchemyError") raise except Exception: - LOG.exception("UnexpectedError", exc_info=True) + LOG.exception("UnexpectedError") raise async def get_task(self, task_id: str, organization_id: str | None = None) -> Task | None: @@ -580,10 +580,10 @@ class AgentDB: else: return None except SQLAlchemyError: - LOG.exception("SQLAlchemyError", exc_info=True) + LOG.exception("SQLAlchemyError") raise except Exception: - LOG.exception("UnexpectedError", exc_info=True) + LOG.exception("UnexpectedError") raise async def get_artifact( @@ -662,10 +662,10 @@ class AgentDB: return artifacts[0] return None except SQLAlchemyError: - LOG.exception("SQLAlchemyError", exc_info=True) + LOG.exception("SQLAlchemyError") raise except Exception: - LOG.exception("UnexpectedError", exc_info=True) + LOG.exception("UnexpectedError") raise async def get_latest_n_artifacts( @@ -693,10 +693,10 @@ class AgentDB: return [convert_to_artifact(artifact, self.debug_enabled) for artifact in artifacts] return None except SQLAlchemyError: - LOG.exception("SQLAlchemyError", exc_info=True) + LOG.exception("SQLAlchemyError") raise except Exception: - LOG.exception("UnexpectedError", exc_info=True) + LOG.exception("UnexpectedError") raise async def get_latest_task_by_workflow_id( diff --git a/skyvern/forge/sdk/workflow/models/block.py b/skyvern/forge/sdk/workflow/models/block.py index 91886fac..1f7d2447 100644 --- a/skyvern/forge/sdk/workflow/models/block.py +++ b/skyvern/forge/sdk/workflow/models/block.py @@ -85,7 +85,6 @@ class Block(BaseModel, abc.ABC): except Exception: LOG.exception( "Block execution failed", - exc_info=True, workflow_run_id=workflow_run_id, block_label=self.label, block_type=self.block_type, @@ -657,7 +656,7 @@ class UploadToS3Block(Block): uri=self._get_s3_uri(workflow_run_id, self.path), file_path=self.path ) except Exception as e: - LOG.exception("UploadToS3Block: Failed to upload file to S3", file_path=self.path, exc_info=True) + LOG.exception("UploadToS3Block: Failed to upload file to S3", file_path=self.path) raise e LOG.info("UploadToS3Block: File(s) uploaded to S3", file_path=self.path) diff --git a/skyvern/forge/sdk/workflow/service.py b/skyvern/forge/sdk/workflow/service.py index 746e0b09..0fb08e31 100644 --- a/skyvern/forge/sdk/workflow/service.py +++ b/skyvern/forge/sdk/workflow/service.py @@ -192,7 +192,6 @@ class WorkflowService: LOG.exception( f"Error while executing workflow run {workflow_run.workflow_run_id}", workflow_run_id=workflow_run.workflow_run_id, - exc_info=True, ) await self.mark_workflow_run_as_failed(workflow_run_id=workflow_run.workflow_run_id) raise e diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.py index 14e908df..42c5511c 100644 --- a/skyvern/webeye/actions/handler.py +++ b/skyvern/webeye/actions/handler.py @@ -228,7 +228,9 @@ async def handle_download_file_action( await download.save_as(full_file_path) except Exception as e: LOG.exception( - "DownloadFileAction: Failed to download file", action=action, full_file_path=full_file_path, exc_info=True + "DownloadFileAction: Failed to download file", + action=action, + full_file_path=full_file_path, ) return [ActionFailure(e)] @@ -363,7 +365,7 @@ async def handle_select_option_action( if action.option.index is not None: LOG.warning( "Failed to click on the option by label, trying by index", - exc_info=e, + exc_info=True, action=action, xpath=xpath, ) @@ -667,7 +669,7 @@ async def click_sibling_of_input( interacted_with_sibling=True, ) except Exception as e: - LOG.warning("Failed to click sibling label of input element", exc_info=e) + LOG.warning("Failed to click sibling label of input element", exc_info=True) return ActionFailure(exception=e, javascript_triggered=javascript_triggered) diff --git a/skyvern/webeye/browser_factory.py b/skyvern/webeye/browser_factory.py index 868804dd..5c808a89 100644 --- a/skyvern/webeye/browser_factory.py +++ b/skyvern/webeye/browser_factory.py @@ -181,7 +181,7 @@ class BrowserState: await self.page.goto(url) await asyncio.sleep(3) except Error as playright_error: - LOG.exception(f"Error while navigating to url: {str(playright_error)}", exc_info=True) + LOG.exception(f"Error while navigating to url: {str(playright_error)}") raise FailedToNavigateToUrl(url=url, error_message=str(playright_error)) success = True LOG.info(f"Successfully went to {url}") @@ -190,13 +190,12 @@ class BrowserState: except Exception as e: LOG.exception( f"Error while creating or navigating to a new page. Waiting for 5 seconds. Error: {str(e)}", - exc_info=True, ) retries += 1 # Wait for 5 seconds before retrying await asyncio.sleep(5) if retries >= 3: - LOG.exception(f"Failed to create a new page after 3 retries: {str(e)}", exc_info=True) + LOG.exception(f"Failed to create a new page after 3 retries: {str(e)}") raise e LOG.info(f"Retrying to create a new page. Retry count: {retries}") @@ -236,8 +235,8 @@ class BrowserState: animations="disabled", ) except TimeoutError as e: - LOG.exception(f"Timeout error while taking screenshot: {str(e)}", exc_info=True) + LOG.exception(f"Timeout error while taking screenshot: {str(e)}") raise FailedToTakeScreenshot(error_message=str(e)) from e except Exception as e: - LOG.exception(f"Unknown error while taking screenshot: {str(e)}", exc_info=True) + LOG.exception(f"Unknown error while taking screenshot: {str(e)}") raise FailedToTakeScreenshot(error_message=str(e)) from e diff --git a/skyvern/webeye/scraper/scraper.py b/skyvern/webeye/scraper/scraper.py index e854e68c..199cb3f0 100644 --- a/skyvern/webeye/scraper/scraper.py +++ b/skyvern/webeye/scraper/scraper.py @@ -49,7 +49,7 @@ def load_js_script() -> str: with open(path, "r") as f: return f.read() except FileNotFoundError as e: - LOG.exception("Failed to load the JS script", exc_info=True, path=path) + LOG.exception("Failed to load the JS script", path=path) raise e