MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

AttributeError: 'NoneType' object has no attribute 'root_relative_path'

Open krish240574 opened this issue 1 year ago • 4 comments

Bug description

Whenever I run metagpt --project-path <my_existing_project_path> "some new feature/incremental code" , I get the following error: 2024-07-02 11:54:36.567 | ERROR | metagpt.utils.common:wrapper:631 - Exception occurs, start to serialize the project, exp: Traceback (most recent call last): File "/root/DBApp/MetaGPT/metagpt/utils/common.py", line 640, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/role.py", line 550, in run rsp = await self.react() ^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'root_relative_path'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/root/DBApp/MetaGPT/metagpt/utils/common.py", line 626, in wrapper result = await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/team.py", line 131, in run await self.env.run() Exception: Traceback (most recent call last): File "/root/DBApp/MetaGPT/metagpt/utils/common.py", line 640, in wrapper return await func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/role.py", line 550, in run rsp = await self.react() ^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/role.py", line 519, in react rsp = await self._react() ^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/role.py", line 474, in _react rsp = await self._act() ^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/engineer.py", line 149, in _act return await self._act_write_code() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/engineer.py", line 156, in _act_write_code changed_files = await self._act_sp_with_cr(review=self.use_code_review) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/DBApp/MetaGPT/metagpt/roles/engineer.py", line 121, in _act_sp_with_cr dependencies.add(coding_context.code_plan_and_change_doc.root_relative_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'root_relative_path'

Bug solved method

Environment information

  • LLM type and model name: gpt-4o, llama-3-70b,, gemini-1.5-flash
  • System version:
  • Ubuntu 24.04
  • Python version:
  • python 3.11
  • MetaGPT version or branch: git clone https://github.com/geekan/MetaGPT && cd MetaGPT && pip install --upgrade -e .

krish240574 avatar Jul 02 '24 14:07 krish240574

Is the existing project code you want to improve created by MetaGPT?

shenchucheng avatar Jul 05 '24 01:07 shenchucheng

Yes, I started the project using metagpt "project specs". Then continued using metagpt --project-path "incremental feature"

Thanks, Kumar

On Fri, 5 Jul 2024 at 06:55, shenchucheng @.***> wrote:

Is the existing project code you want to improve created by MetaGPT?

— Reply to this email directly, view it on GitHub https://github.com/geekan/MetaGPT/issues/1379#issuecomment-2209841434, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFVT5RSUJICYVO2T2GU6KTZKXYYNAVCNFSM6AAAAABKHUE23OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZHA2DCNBTGQ . You are receiving this because you authored the thread.Message ID: @.***>

krish240574 avatar Jul 05 '24 02:07 krish240574

Could you please upload the generated project code? I can try to reproduce this issue.

shenchucheng avatar Jul 05 '24 06:07 shenchucheng

I'm afraid I can't, since the code is now company-internal. I simply followed the steps in the documentation, metagpt "new project specs" - it generated some code ok. Then I did metagpt --project path <project_path> "description of new feature to be added".

On Fri, 5 Jul 2024 at 12:18, shenchucheng @.***> wrote:

Could you please upload the generated project code? I can try to reproduce this issue.

— Reply to this email directly, view it on GitHub https://github.com/geekan/MetaGPT/issues/1379#issuecomment-2210290197, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFVT5Q5JR6HMN3HPNLRIRTZKY6TXAVCNFSM6AAAAABKHUE23OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGI4TAMJZG4 . You are receiving this because you authored the thread.Message ID: @.***>

krish240574 avatar Jul 05 '24 12:07 krish240574

The code you submitted needs a modification in one place:#37

iorisa avatar Oct 11 '24 03:10 iorisa

I've consolidated all the incremental development-related issues into #1498 to make it easier to follow up. Any new issues will be discussed in this newly opened issue, and the old issue will be closed.

iorisa avatar Oct 11 '24 06:10 iorisa