Skip to content

Automate browser based workflows with AI

Bump bitwarden timeout to 120s, try fix github action (#3661)

Suchintan601b57df5f69
diff --git a/skyvern/forge/sdk/services/bitwarden.py b/skyvern/forge/sdk/services/bitwarden.py
index 78a2debb2..fffd16c83 100644
--- a/skyvern/forge/sdk/services/bitwarden.py
+++ b/skyvern/forge/sdk/services/bitwarden.py
@@ -715,15 +715,19 @@ class BitwardenService:
@staticmethod
async def _unlock_using_server(master_password: str) -> None:
- status_response = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/status", retry=3, retry_timeout=15)
+ status_response = await aiohttp_get_json(
+ f"{BITWARDEN_SERVER_BASE_URL}/status", retry=3, retry_timeout=30, timeout=120
+ )
status = status_response["data"]["template"]["status"]
if status != "unlocked":
- await aiohttp_post(f"{BITWARDEN_SERVER_BASE_URL}/unlock", data={"password": master_password})
+ await aiohttp_post(
+ f"{BITWARDEN_SERVER_BASE_URL}/unlock", data={"password": master_password}, retry_timeout=30, timeout=120
+ )
@staticmethod
async def _get_login_item_by_id_using_server(item_id: str) -> PasswordCredential:
response = await aiohttp_get_json(
- f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}", retry=3, retry_timeout=30
+ f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}", retry=3, timeout=120, retry_timeout=30
)
if not response or response.get("success") is False:
raise BitwardenGetItemError(f"Failed to get login item by ID: {item_id}")
@@ -746,8 +750,8 @@ class BitwardenService:
name: str,
credential: PasswordCredential,
) -> str:
- item_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item")
- login_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item.login")
+ item_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item", timeout=120)
+ login_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item.login", timeout=120)
item_template = item_template["data"]["template"]
login_template = login_template["data"]["template"]
@@ -762,7 +766,7 @@ class BitwardenService:
item_template["collectionIds"] = [collection_id]
item_template["organizationId"] = bw_organization_id
- response = await aiohttp_post(f"{BITWARDEN_SERVER_BASE_URL}/object/item", data=item_template)
+ response = await aiohttp_post(f"{BITWARDEN_SERVER_BASE_URL}/object/item", data=item_template, timeout=120)
if not response or response.get("success") is False:
raise BitwardenCreateLoginItemError("Failed to create login item")
@@ -775,8 +779,10 @@ class BitwardenService:
name: str,
credential: CreditCardCredential,
) -> str:
- item_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item")
- credit_card_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item.card")
+ item_template = await aiohttp_get_json(f"{BITWARDEN_SERVER_BASE_URL}/object/template/item", timeout=120)
+ credit_card_template = await aiohttp_get_json(
+ f"{BITWARDEN_SERVER_BASE_URL}/object/template/item.card", timeout=120
+ )
item_template = item_template["data"]["template"]
credit_card_template = credit_card_template["data"]["template"]
@@ -948,7 +954,10 @@ class BitwardenService:
@staticmethod
async def _get_collection_items_using_server(collection_id: str) -> list[CredentialItem]:
response = await aiohttp_get_json(
- f"{BITWARDEN_SERVER_BASE_URL}/list/object/items?collectionId={collection_id}", retry=3, retry_timeout=30
+ f"{BITWARDEN_SERVER_BASE_URL}/list/object/items?collectionId={collection_id}",
+ retry=3,
+ retry_timeout=30,
+ timeout=120,
)
if not response or response.get("success") is False:
raise BitwardenGetItemError("Failed to get collection items")
@@ -971,7 +980,7 @@ class BitwardenService:
@staticmethod
async def _get_credential_item_by_id_using_server(item_id: str) -> CredentialItem:
response = await aiohttp_get_json(
- f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}", retry=3, retry_timeout=30
+ f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}", retry=3, timeout=120, retry_timeout=30
)
if not response or response.get("success") is False:
raise BitwardenGetItemError(f"Failed to get credential item by ID: {item_id}")
@@ -1021,4 +1030,4 @@ class BitwardenService:
@staticmethod
async def _delete_credential_item_using_server(item_id: str) -> None:
- await aiohttp_delete(f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}")
+ await aiohttp_delete(f"{BITWARDEN_SERVER_BASE_URL}/object/item/{item_id}", timeout=120)