web-arena-x / webarena

Code repo for "WebArena: A Realistic Web Environment for Building Autonomous Agents"
https://webarena.dev
Apache License 2.0
632 stars 90 forks source link

Cannot run minimal_example.py. No such file or directory: './.auth/gitlab_state.json' #143

Closed lyh1028 closed 1 month ago

lyh1028 commented 1 month ago

I'm using win11 WSL2 to run minimal_example.py. Here are the error Info:

python minimal_example.py 
Done setting up URLs
Done generating config files with the correct URLs
/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/beartype/_util/hint/pep/utilpeptest.py:345: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Mapping[str, gymnasium.spaces.space.Space[typing.Any]] deprecated by PEP 585 scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". See this discussion for further details and alternatives:
    https://github.com/beartype/beartype#pep-585-deprecations
  warn(
Done saving account cookies
/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/beartype/_util/hint/pep/utilpeptest.py:345: BeartypeDecorHintPep585DeprecationWarning: PEP 484 type hint typing.Mapping[str, gymnasium.spaces.space.Space[typing.Any]] deprecated by PEP 585 scheduled for removal in the first Python version released after October 5th, 2025. To resolve this, import this hint from "beartype.typing" rather than "typing". See this discussion for further details and alternatives:
    https://github.com/beartype/beartype#pep-585-deprecations
  warn(
/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/pydantic/_internal/_fields.py:160: UserWarning: Field "model_id" has conflict with protected namespace "model_".

You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
  warnings.warn(
Traceback (most recent call last):
  File "/home/lyh/webarena-main/minimal_example.py", line 86, in <module>
    obs, info = env.reset(options={"config_file": config_file})
  File "<@beartype(browser_env.envs.ScriptBrowserEnv.reset) at 0x7f4ad9751e10>", line 51, in reset
  File "/home/lyh/webarena-main/browser_env/envs.py", line 203, in reset
    self.setup(config_file=config_file)
  File "<@beartype(browser_env.envs.ScriptBrowserEnv.setup) at 0x7f4ad9751b40>", line 36, in setup
  File "/home/lyh/webarena-main/browser_env/envs.py", line 142, in setup
    self.context = self.browser.new_context(
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 13989, in new_context
    self._sync(
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 104, in _sync
    return task.result()
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/_impl/_browser.py", line 124, in new_context
    await prepare_browser_context_params(params)
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/_impl/_browser.py", line 234, in prepare_browser_context_params
    (await async_readfile(storageState)).decode()
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/_impl/_helper.py", line 352, in async_readfile
    return await loop.run_in_executor(None, inner)
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/lyh/miniconda3/envs/webarena/lib/python3.10/site-packages/playwright/_impl/_helper.py", line 348, in inner
    with open(file, "rb") as fh:
FileNotFoundError: [Errno 2] No such file or directory: './.auth/gitlab_state.json'
shuyanzhou commented 1 month ago

The cookie files are generated in a separated script:

mkdir -p ./.auth
python browser_env/auto_login.py
lyh1028 commented 1 month ago

The cookie files are generated in a separated script:

mkdir -p ./.auth
python browser_env/auto_login.py

Thanks for your reply!

However, it seems "subprocess.run(["bash", "prepare.sh"])" have run the command. But in fact I don't get json files like "gitlab_state.json".

Besides, if I run auto_login.py separately, I'll get an assertion error for lack of environment variables. If I first set environment variables as "minimal_example.py" does, the program encounters a cookie-expired error.

By the way, I'd like to ask questions about how to configure urls like "export SHOPPING=":7770". If I don't use AMS, do I have to download the image tar and configure docker locally before really run "minimal_example.py"?

I'd appreciate it if you could help me. Thanks again.

lyh1028 commented 1 month ago

Update: I configure AWS successfully but still can not get ANY json files after running python browser_env/auto_login.py. This problem is really bothering me. :(

shuyanzhou commented 1 month ago

Hi, have you run step 1, 2 and 3 in the README? Please don't hesitate to follow up if you encounter any issues.

lyh1028 commented 1 month ago

Thanks! I have made it by executing 3 steps by order.

---Original--- From: "Shuyan @.> Date: Mon, Jun 3, 2024 23:13 PM To: @.>; Cc: @.**@.>; Subject: Re: [web-arena-x/webarena] Cannot run minimal_example.py. No suchfile or directory: './.auth/gitlab_state.json' (Issue #143)

Hi, have you run step 1, 2 and 3 in the README? Please don't hesitate to follow up if you encounter any issues.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>