microsoft / TaskWeaver

A code-first agent framework for seamlessly planning and executing data analytics tasks.
https://microsoft.github.io/TaskWeaver/
MIT License
5.17k stars 658 forks source link

CodeInterpreter in web UI cannot execute: Permission denied: '/app/ces/kernel_logging.log' #289

Open Mrzhiyao opened 5 months ago

Mrzhiyao commented 5 months ago

When answering tasks using the UI interface, the following error occurred in the ’CodeInterpreter'.

Traceback (most recent call last): File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/app/taskweaver/ces/kernel/launcher.py", line 5, in from taskweaver.ces.kernel.kernel_logging import logger File "/app/taskweaver/ces/kernel/kernel_logging.py", line 4, in logging.basicConfig( File "/usr/local/lib/python3.10/logging/init.py", line 2031, in basicConfig h = FileHandler(filename, mode, File "/usr/local/lib/python3.10/logging/init.py", line 1167, in init StreamHandler.init(self, self._open()) File "/usr/local/lib/python3.10/logging/init.py", line 1197, in _open return open_func(self.baseFilename, self.mode, PermissionError: [Errno 13] Permission denied: '/app/ces/kernel_logging.log'

By observing the logs, I found that although container 'taskweavercontainers/taskweaver-executor ' is recreated every time it fails, it cannot be executed every time. This error persists in the logs. What is the reason for this.

liqul commented 5 months ago

It seems that the process inside the container has no permission to access the session directory mounted to the container. Can you provide more information on your environment? like what is your host OS? You said it cannot be executed every time. Do you mean that it sometimes can run successfully?

pai4451 commented 4 months ago

same here

liqul commented 4 months ago

same here

configurations and the environment?

pai4451 commented 4 months ago

same here

configurations and the environment?

Ubuntu 22.04, and I run this ascii example on the documentation (I only adjust the ascii_render.yaml with enabled = true)

Here is how I reproduce it on my machine

cd scripts
./build_executor.sh
python3 -m taskweaver -p ./project/

After the terminal showed the welcome message, I asked for "render ABC in ascii art" to Taskweaver. I got the following error:

File "/home/ai-agent/TaskWeaver/taskweaver/ces/environment.py", line 266, in start_session
    raise Exception("Container is not ready after 10 seconds")
Exception: Container is not ready after 10 seconds

I then inspect the logs of the execution container taskweavercontainers/taskweaver-executor, here is the logs by the command docker logs <container_id>.

File "/usr/local/lib/python3.10/logging/init.py", line 1201, in _open
    return open_func(self.baseFilename, self.mode,
PermissionError: [Errno 13] Permission denied: '/app/ces/kernel_logging.log'
liqul commented 4 months ago

We have identified a bug of configuring the dir permission for linux OS. Will fix it asap.

liqul commented 4 months ago

Fixed in https://github.com/microsoft/TaskWeaver/pull/296

Please pull the latest code and try again.