{"record":{"id":"85c1775ccbe70bf9","repo":"exo-explore/exo","slug":"expected-exactly-one-new-instance-from-placement","errorCode":null,"errorMessage":"Expected exactly one new instance from placement","messagePattern":"Expected exactly one new instance from placement","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"src/exo/api/main.py","lineNumber":502,"sourceCode":"                    min_nodes=min_nodes,\n                ),\n                node_memory=self.state.node_memory,\n                node_network=self.state.node_network,\n                node_backends=self.state.node_backends,\n                topology=self.state.topology,\n                current_instances=self.state.instances,\n                download_status=self.state.downloads,\n                node_rdma_ctl=self.state.node_rdma_ctl,\n            )\n        except ValueError as exc:\n            raise HTTPException(status_code=400, detail=str(exc)) from exc\n\n        current_ids = set(self.state.instances.keys())\n        new_ids = [\n            instance_id for instance_id in placements if instance_id not in current_ids\n        ]\n        if len(new_ids) != 1:\n            raise HTTPException(\n                status_code=500,\n                detail=\"Expected exactly one new instance from placement\",\n            )\n\n        return placements[new_ids[0]]\n\n    async def get_placement_previews(\n        self,\n        model_id: ModelId,\n        node_ids: Annotated[list[NodeId] | None, Query()] = None,\n    ) -> PlacementPreviewResponse:\n        seen: set[tuple[ModelId, Sharding, InstanceMeta, int]] = set()\n        previews: list[PlacementPreview] = []\n        required_nodes = set(node_ids) if node_ids else None\n\n        if len(list(self.state.topology.list_nodes())) == 0:\n            return PlacementPreviewResponse(previews=[])\n","sourceCodeStart":484,"sourceCodeEnd":520,"githubUrl":"https://github.com/exo-explore/exo/blob/21a54c5ea0230a3bec1e1a786d200126c7e34ec6/src/exo/api/main.py#L484-L520","documentation":"Error \"Expected exactly one new instance from placement\" thrown in exo-explore/exo.","triggerScenarios":"Thrown at src/exo/api/main.py:502 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"21a54c5ea0230a3bec1e1a786d200126c7e34ec6","analyzedAt":"2026-08-26T00:02:16.033Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}