gpt-pilot icon indicating copy to clipboard operation
gpt-pilot copied to clipboard

[Bug]: IsADirectoryError gpt-pilot/workspace/.../Dockerfile/'

Open YosuCadilla opened this issue 6 months ago • 1 comments

Version

CLI

Operating System

Alpine Linux

What happened?

Seems "Dockerfile was created as a directory instead of a file???

Dev step 144

{"tasks": [{"type": "code_change", "code_change": {"name": "Dockerfile", "path": "/Dockerfile", "content": "# Use Ubuntu 22.04 as base image\nFROM ubuntu:22.04\n\n# Avoid prompts from apt\nENV DEBIAN_FRONTEND=noninteractive\n\n# Update and install software dependencies\nRUN apt-get update && apt-get install -y \\n software-properties-common \\n curl \\n lxd \\n lxd-client \\n haproxy \\n python3.11 \\n python3-pip\n\n# Add LXD stable repository for the latest version\nRUN add-apt-repository -y ppa:ubuntu-lxc/lxd-stable\n\n# Install additional Python 3.11 package dependencies\nRUN apt-get update && apt-get install -y \\n python3.11-venv \\n python3.11-dev\n\n# Installing LXD from snap (currently required for LXD 5.x on Ubuntu 22.04)\nRUN snap install lxd\n\n# Ensure Python 3.11 is used as default python3\nRUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1\n\n# Install pip and Python dependencies\nRUN python3 -m pip install --upgrade pip\n# Note: Specific Python dependencies are to be installed within the Python virtual environment.\n\n# Set up non-interactive mode for LXD initialisation\nRUN echo "yes" | lxd init --auto\n\n# Set up default command\nCMD ["bash", "-c", "lxd --version && haproxy -v && python3 --version"]\n"}}, {"type": "command", "command": {"command": "docker build -t mdeploy-py-try14 .", "timeout": 300000}}, {"type": "command", "command": {"command": "docker run --name mdeploy-test-container -d mdeploy-py-try14", "timeout": 30000, "command_id": "mdeploy-test-container-run"}}, {"type": "command", "command": {"command": "docker exec mdeploy-test-container lxd --version", "timeout": 10000, "success_message": "LXD version:"}}, {"type": "command", "command": {"command": "docker exec mdeploy-test-container haproxy -v", "timeout": 10000, "success_message": "HAProxy version"}}, {"type": "command", "command": {"command": "docker exec mdeploy-test-container python3 --version", "timeout": 10000, "success_message": "Python 3.11"}}, {"type": "command", "command": {"command": "docker stop mdeploy-test-container", "timeout": 10000}}, {"type": "command", "command": {"command": "docker rm mdeploy-test-container", "timeout": 10000}}]}

---------- GPT PILOT EXITING WITH ERROR ---------- Traceback (most recent call last): File "/gpt-pilot/pilot/main.py", line 77, in project.start() File "/gpt-pilot/pilot/helpers/Project.py", line 141, in start self.developer.start_coding() File "/gpt-pilot/pilot/helpers/agents/Developer.py", line 66, in start_coding self.implement_task(i, dev_task) File "/gpt-pilot/pilot/helpers/agents/Developer.py", line 113, in implement_task result = self.execute_task(convo_dev_task, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/gpt-pilot/pilot/helpers/agents/Developer.py", line 405, in execute_task result = self.step_code_change(convo, task_description, step, i, test_after_code_changes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/gpt-pilot/pilot/helpers/agents/Developer.py", line 178, in step_code_change self.project.save_file(data) File "/gpt-pilot/pilot/helpers/Project.py", line 263, in save_file update_file(full_path, data['content']) File "/gpt-pilot/pilot/helpers/files.py", line 29, in update_file with open(path, file_mode, encoding=encoding) as file: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ IsADirectoryError: [Errno 21] Is a directory: '/gpt-pilot/workspace/mdeploy-py-try14/Dockerfile/'

YosuCadilla avatar Dec 26 '23 23:12 YosuCadilla

I encountered recurring problems where other files were mistakenly treated as folders. It appears that the script encounters issues with files lacking extensions. To resolve this, I had to manually rename certain files, such as "sessions," to "sessions.db," which successfully resolved the problem. To continue, you'll need to replay and reload the project, stepping back to just before the point where it encountered the issue.

asimgilani avatar Dec 26 '23 23:12 asimgilani

Good workaround, thank you for sharing asimgilani

YosuCadilla avatar Dec 27 '23 01:12 YosuCadilla

Duplicate of #395

senko avatar Dec 27 '23 08:12 senko