Skyvern-AI/skyvern

Can't determine where or why the timeout error occurred.

nanpuhaha opened this issue · 1 comments

How can I set the wait_until option for a specific URL format be domcontentloaded instead of commit, load, or networkidle?

skyvern git:(main) ./run_skyvern.sh
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: skyvern (0.1.0)
Alembic mode:  online
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Alembic mode:  online
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
No new upgrade operations detected.
2024-04-01T22:28:45.277841Z [info     ] Agent server starting.         host=0.0.0.0 port=8000
INFO:     Will watch for changes in these directories: ['/Users/user/GitHub/free-font-downloader/skyvern']
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [11003] using WatchFiles
2024-04-02 07:28:49 [info     ] Registering LLM config         llm_key=OPENAI_GPT4_TURBO
2024-04-02 07:28:49 [info     ] Registering LLM config         llm_key=OPENAI_GPT4V
2024-04-01T22:28:49.912753Z [info     ] Initializing ForgeAgent        browser_action_timeout_ms=5000 browser_type=chromium-headful debug_mode=False env=local execute_all_steps=True long_running_task_warning_ratio=0.95 max_scraping_retries=0 max_steps_per_run=50 video_path=./videos
2024-04-01T22:28:50.016098Z [info     ] Starting the skyvern scheduler.
2024-04-01T22:46:22.247142Z [info     ] Created new task               data_goal=Extract the actual URL used for downloading the file and the name of the file being downloaded. Ensure the data is provided in JSON format, including both the direct download link and the file name. nav_goal=Navigate through the website to first locate the name of the font and the publisher who created and distributed it. After identifying these details, search for a yellow download page button and click it to open the page where the font can be downloaded. In the newly opened page, find and click on the button or buttons to download the font. Some pages may contain multiple download buttons; ensure all are clicked to achieve the goal. proxy_location=NONE task_id=tsk_241928560382524842 title=None url=https://noonnu.cc/font_page/1339
2024-04-01T22:46:22.248015Z [info     ] Executing task using background task executor task_id=tsk_241928560382524842
2024-04-01T22:46:22.340120Z [info     ] Creating browser state for task task_id=tsk_241928560382524842
2024-04-01T22:46:31.162207Z [info     ] Creating a new page           
2024-04-01T22:46:31.858802Z [info     ] A new page is created         
2024-04-01T22:46:31.858918Z [info     ] Navigating page to https://noonnu.cc/font_page/1339 and waiting for 3 seconds
/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/structlog/_base.py:167: UserWarning: Remove `format_exc_info` from your processor chain if you want pretty exceptions.
  event_dict = proc(self._logger, method_name, event_dict)
2024-04-01T22:47:04.922176Z [error    ] Error while navigating to url: Timeout 30000ms exceeded.
Traceback (most recent call last):
  File "/Users/user/GitHub/free-font-downloader/skyvern/skyvern/webeye/browser_factory.py", line 176, in check_and_fix_state
    await self.page.goto(url)
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/async_api/_generated.py", line 9275, in goto
    await self._impl_obj.goto(
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/_impl/_page.py", line 484, in goto
    return await self._main_frame.goto(**locals_to_params(locals()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/_impl/_frame.py", line 149, in goto
    await self._channel.send("goto", locals_to_params(locals()))
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 63, in send
    return await self._connection.wrap_api_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 495, in wrap_api_call
    return await cb()
           ^^^^^^^^^^
  File "/Users/user/GitHub/free-font-downloader/skyvern/.venv/lib/python3.11/site-packages/playwright/_impl/_connection.py", line 101, in inner_send
    result = next(iter(done)).result()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._errors.TimeoutError: Timeout 30000ms exceeded.

Configuring the waituntil doesn't always work for every website, that's why we don't plan to support allowing playwright configurations like that in the short term. However you can set it manually if you'd like to:

This is the line it actually fails as seen in the logs

2024-04-01T22:47:04.922176Z [error ] Error while navigating to url: Timeout 30000ms exceeded.
Traceback (most recent call last):
File "/Users/user/GitHub/free-font-downloader/skyvern/skyvern/webeye/browser_factory.py", line 176, in check_and_fix_state
await self.page.goto(url)

You can manually try passing in the wait until to page.goto https://playwright.dev/python/docs/api/class-page#page-goto-option-wait-until