Closed pmeier closed 8 months ago
After some ultimately futile bisecting, I found that the issue is reproducible on 6dd32b7ddea2c4876ebe3812b6a18a2e37f83ba7, i.e. the commit that added docker support. Meaning, it never worked. No idea how this slipped past me in #283.
This has nothing to do with docker
. The issue happens on Python 3.11
https://github.com/Quansight/ragna/blob/4a667f9aced1970f8eab8aa9e01aaf8c67b05db0/Dockerfile#L1
while we are using 3.9 for development
3.10 is also fine.
Here is a repro:
$ conda create -n ragna-359-py311 -c conda-forge python=3.11
$ conda activate ragna-359-py311
$ pip install --pre ragna==0.2.0rc1
$ ragna init
and select the default options. This creates a configuration file picked up automatically by the next command$ ragna ui
Changing 1. and 2. to
$ conda create -n ragna-359-py310 -c conda-forge python=3.10
$ conda activate ragna-359-py310
results in
It seems panel is accessing the repr(self._placeholder)
at some point and in turn this fails:
from ragna.deploy._ui.central_view import RagnaChatMessage
message = RagnaChatMessage("Bug", role="user", user="")
repr(message)
Traceback (most recent call last):
File "/home/philip/git/ora/main2.py", line 43, in <module>
repr(message)
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/pane/base.py", line 217, in __repr__
params = param_reprs(self, ['object'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/util/__init__.py", line 166, in param_reprs
else: v = abbreviated_repr(v)
^^^^^^^^^^^^^^^^^^^
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/util/__init__.py", line 115, in abbreviated_repr
vrepr = repr(value)
^^^^^^^^^^^
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/pane/base.py", line 217, in __repr__
params = param_reprs(self, ['object'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/util/__init__.py", line 166, in param_reprs
else: v = abbreviated_repr(v)
^^^^^^^^^^^^^^^^^^^
File "/home/philip/.conda/envs/ragna-359-py311/lib/python3.11/site-packages/panel/util/__init__.py", line 115, in abbreviated_repr
vrepr = repr(value)
^^^^^^^^^^^
[...]
This is a reference cycle. When trying to get the repr
for the RagnaChatMessage
, the repr
for the avatar_lookup
parameter is needed. We have implemented this as bound method
Thus, this holds a reference back to the original RagnaChatMessage
and thus causing the cycle and ultimately the recursion error.
Bug description
Per title. Traceback:
How to reproduce the bug?
Ask a question in the web UI.
Versions and dependencies used
0.2.0rc1
Anything else?
No response