Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhook failed #694

Open
devinat1 opened this issue Aug 9, 2024 · 1 comment
Open

Webhook failed #694

devinat1 opened this issue Aug 9, 2024 · 1 comment
Labels

Comments

@devinat1
Copy link

devinat1 commented Aug 9, 2024

Sometimes, upon Skyvern sending back a webhook, sending it is unsuccessful:

Traceback (most recent call last):
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 305, in execute_step
    await self.send_task_response(
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 1211, in send_task_response
    await self.cleanup_browser_and_create_artifacts(close_browser_on_completion, last_step, task)
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 1339, in cleanup_browser_and_create_artifacts
    browser_state = await app.BROWSER_MANAGER.cleanup_for_task(task.task_id, close_browser_on_completion)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/webeye/browser_manager.py", line 178, in cleanup_for_task
    await browser_state_to_close.close(close_browser_on_completion=close_browser_on_completion)
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/webeye/browser_factory.py", line 324, in close
    await self.browser_context.close()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/async_api/_generated.py", line 13832, in close
    return mapping.from_maybe_impl(await self._impl_obj.close(reason=reason))
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_browser_context.py", line 522, in close
    await self._channel._connection.wrap_api_call(_inner_close, True)
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 495, in wrap_api_call
    return await cb()
           ^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_browser_context.py", line 504, in _inner_close
    await self._channel.send("harExport", {"harId": har_id})
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 63, in send
    return await self._connection.wrap_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 490, in wrap_api_call
    return await cb()
           ^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 101, in inner_send
    result = next(iter(done)).result()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._errors.TargetClosedError: Target page, context or browser has been closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 198, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/util/connection.py", line 85, in create_connection
    raise err
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/util/connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 793, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 496, in _make_request
    conn.request(
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 400, in request
    self.endheaders()
  File "/usr/lib/python3.11/http/client.py", line 1298, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.11/http/client.py", line 1058, in _send_output
    self.send(msg)
  File "/usr/lib/python3.11/http/client.py", line 996, in send
    self.connect()
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 238, in connect
    self.sock = self._new_conn()
                ^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connection.py", line 213, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x726b8aff1a90>: Failed to establish a new connection: [Errno 111] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/connectionpool.py", line 847, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/urllib3/util/retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x726b8aff1a90>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 1316, in execute_task_webhook
    resp = requests.post(task.webhook_callback_url, data=payload, headers=headers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/.cache/pypoetry/virtualenvs/skyvern-wB5pmyxT-py3.11/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /webhook (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x726b8aff1a90>: Failed to establish a new connection: [Errno 111] Connection refused'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 350, in execute_step
    return await self.execute_step(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 459, in execute_step
    await self.send_task_response(
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 1216, in send_task_response
    await self.execute_task_webhook(task=task, last_step=last_step, api_key=api_key)
  File "/home/bond/Desktop/multion/agent-collector/agents/open-source/skyvern/skyvern/forge/agent.py", line 1333, in execute_task_webhook
    raise FailedToSendWebhook(task_id=task.task_id) from e
skyvern.exceptions.FailedToSendWebhook: Failed to send webhook.   task_id=tsk_289865751426699776

Copy link

github-actions bot commented Sep 9, 2024

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant