{"record":{"id":"1f1eebd0e09fd106","repo":"FoundationAgents/MetaGPT","slug":"recover-path-not-exists-or-not-endswith-team","errorCode":null,"errorMessage":"{recover_path} not exists or not endswith `team`","messagePattern":"(.+?) not exists or not endswith `team`","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"metagpt/software_company.py","lineNumber":66,"sourceCode":"                ProductManager(),\n                Architect(),\n                Engineer2(),\n                # ProjectManager(),\n                DataAnalyst(),\n            ]\n        )\n\n        # if implement or code_review:\n        #     company.hire([Engineer(n_borg=5, use_code_review=code_review)])\n        #\n        # if run_tests:\n        #     company.hire([QaEngineer()])\n        #     if n_round < 8:\n        #         n_round = 8  # If `--run-tests` is enabled, at least 8 rounds are required to run all QA actions.\n    else:\n        stg_path = Path(recover_path)\n        if not stg_path.exists() or not str(stg_path).endswith(\"team\"):\n            raise FileNotFoundError(f\"{recover_path} not exists or not endswith `team`\")\n\n        company = Team.deserialize(stg_path=stg_path, context=ctx)\n        idea = company.idea\n\n    company.invest(investment)\n    asyncio.run(company.run(n_round=n_round, idea=idea))\n\n    return ctx.kwargs.get(\"project_path\")\n\n\n@app.command(\"\", help=\"Start a new project.\")\ndef startup(\n    idea: str = typer.Argument(None, help=\"Your innovative idea, such as 'Create a 2048 game.'\"),\n    investment: float = typer.Option(default=3.0, help=\"Dollar amount to invest in the AI company.\"),\n    n_round: int = typer.Option(default=5, help=\"Number of rounds for the simulation.\"),\n    code_review: bool = typer.Option(default=True, help=\"Whether to use code review.\"),\n    run_tests: bool = typer.Option(default=False, help=\"Whether to enable QA for adding & running tests.\"),\n    implement: bool = typer.Option(default=True, help=\"Enable or disable code implementation.\"),","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/FoundationAgents/MetaGPT/blob/11cdf466d042aece04fc6cfd13b28e1a70341b1f/metagpt/software_company.py#L48-L84","documentation":"software_company.start's recover branch validates the --recover-path argument: the path must exist and its string form must end with \"team\" (the serialized Team workspace directory, typically ./workspace/<project>/team). Violating either condition raises this FileNotFoundError.","triggerScenarios":"Running metagpt --recover-path <p> where <p> is typo'd, points to the project root instead of the .../team subdirectory, or the workspace was never serialized.","commonSituations":"Passing workspace/project instead of workspace/project/team; recovering on a different machine where the storage dir was not copied; trailing-slash or relative-path mistakes.","solutions":["Point --recover-path at the exact team directory, e.g. ./workspace/my_project/team","Verify with ls that the directory exists and contains team.json before running","If the team dir is gone, start a new project instead of recovering"],"exampleFix":"// before\nmetagpt \"my idea\" --recover-path workspace/my_project  # FileNotFoundError\n\n// after\nmetagpt \"my idea\" --recover-path workspace/my_project/team","handlingStrategy":"validation","validationCode":"from pathlib import Path\np = Path(recover_path)\nif not (p.exists() and str(p).endswith(\"team\")):\n    raise FileNotFoundError(f\"{p} must be an existing .../team directory\")","typeGuard":"from pathlib import Path\n\ndef is_team_workspace(path) -> bool:\n    p = Path(path)\n    return p.exists() and str(p).endswith(\"team\") and (p / \"team.json\").exists()","tryCatchPattern":"try:\n    ctx = start(idea, recover_path=rp, ...)\nexcept FileNotFoundError as e:\n    if \"not endswith `team`\" in str(e):\n        rp = str(Path(rp) / \"team\")  # common fix: user passed project root\n        ctx = start(idea, recover_path=rp, ...)\n    else:\n        raise","preventionTips":["Copy the full workspace/<project>/team directory when moving projects between machines","Tab-complete the exact team path on the CLI instead of typing it","Check for team.json before attempting recovery"],"tags":["recovery","path","cli","team"],"backgroundTag":null,"analyzedSha":"11cdf466d042aece04fc6cfd13b28e1a70341b1f","analyzedAt":"2026-08-14T23:20:02.994Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}