sotopia-lab / sotopia

Sotopia: an Open-ended Social Learning Environment (ICLR 2024 spotlight)
https://docs.sotopia.world
MIT License
151 stars 20 forks source link

[BUG]: dependency version control #209

Closed yufansong closed 4 days ago

yufansong commented 4 days ago

Description of the bug

I use sotopia python package version 0.1.0-rc.1. It run correctly in previous week. But in this week, I find the it cannot run correctly in my previous docker environment. After investigation, the problem should be the hiredis package, the preivous dependency version is 2.4.0 which will cause error now. But upgrade it to 3.0.0 will solve the problem. I am not sure what is the root cause of it. But I recommand to add this dependency into poetry pyproject.toml.

cc @XuhuiZhou

Steps To Reproduce

When you run sotopia 0.1.0-rc.1 with hiredis 2.4.0, it will cause error.

Additional Information

No response

li-boxuan commented 4 days ago

Stacktrace:

    env_profile = EnvironmentProfile.parse_obj(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 526, in parse_obj
    return cls(**obj)
           ^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis_om/model/model.py", line 1690, in __init__
    if not has_redis_json(self.db()):
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis_om/checks.py", line 17, in has_redis_json
    command_exists = check_for_command(conn, "json.set")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis_om/checks.py", line 9, in check_for_command
    cmd_info = conn.execute_command("command", "info", cmd)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis/client.py", line 559, in execute_command
    return self._execute_command(*args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis/client.py", line 565, in _execute_command
    conn = self.connection or pool.get_connection(command_name, **options)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 1423, in get_connection
    connection.connect()
  File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 370, in connect
    self.on_connect()
  File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 432, in on_connect
    self.send_command("AUTH", *auth_args, check_health=False)
  File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 558, in send_command
    self._command_packer.pack(*args),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/redis/connection.py", line 79, in pack
    output.append(hiredis.pack_command(args))
                  ^^^^^^^
NameError: name 'hiredis' is not defined
yufansong commented 4 days ago

Find the root cause, in #138, hiredis get updated. And currently it require 3.0.0

https://github.com/sotopia-lab/sotopia/blame/main/poetry.lock#L1564

XuhuiZhou commented 4 days ago

Thanks for raising the bug and the fix! I am checking things now.

yufansong commented 4 days ago

Solved.