{"record":{"id":"78bb40671839ece6","repo":"Unity-Technologies/ml-agents","slug":"the-entry-identifier-is-not-present-in-the-regis","errorCode":null,"errorMessage":"The entry {identifier} is not present in the registry.","messagePattern":"The entry (.+?) is not present in the registry\\.","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"ml-agents-envs/mlagents_envs/registry/unity_env_registry.py","lineNumber":110,"sourceCode":"\n    def clear(self) -> None:\n        \"\"\"\n        Deletes all entries in the registry.\n        \"\"\"\n        self._REGISTERED_ENVS.clear()\n        self._manifests = []\n        self._sync = True\n\n    def __getitem__(self, identifier: str) -> BaseRegistryEntry:\n        \"\"\"\n        Returns the BaseRegistryEntry with the provided identifier. BaseRegistryEntry\n        can then be used to make a Unity Environment.\n        :param identifier: The identifier of the BaseRegistryEntry\n        :returns: The associated BaseRegistryEntry\n        \"\"\"\n        self._load_all_manifests()\n        if identifier not in self._REGISTERED_ENVS:\n            raise KeyError(f\"The entry {identifier} is not present in the registry.\")\n        return self._REGISTERED_ENVS[identifier]\n\n    def __len__(self) -> int:\n        self._load_all_manifests()\n        return len(self._REGISTERED_ENVS)\n\n    def __iter__(self) -> Iterator[Any]:\n        self._load_all_manifests()\n        yield from self._REGISTERED_ENVS\n\n\ndefault_registry = UnityEnvRegistry()\n# TODO restore when a new registry is available.\ndefault_registry.register_from_yaml(\n    \"https://storage.googleapis.com/mlagents-test-environments/1.1.0/manifest.yaml\"\n)  # noqa E501\n","sourceCodeStart":92,"sourceCodeEnd":127,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents-envs/mlagents_envs/registry/unity_env_registry.py#L92-L127","documentation":"KeyError raised by UnityEnvRegistry.__getitem__ when the requested identifier was not found among registered environment entries (after loading all available manifests). It is the registry's way of reporting an unknown environment name.","triggerScenarios":"registry['name'] where 'name' was never registered via register() or listed in any loaded manifest JSON.","commonSituations":"Typo in the environment identifier; forgetting to register a custom entry before lookup; manifest file not on the path / not loaded; casing mismatch in the id.","solutions":["Print list(registry) (or iterate __len__/keys via the registry) to see available identifiers and correct the name.","Register the entry first: registry.register(name, ... or manifest_path) before lookup.","Wrap lookup with `if identifier in registry` (uses __contains__/len semantics) or try/except KeyError.","Ensure the manifest JSON with the entry is discoverable (correct path/URL passed to UnityEnvRegistry)."],"exampleFix":"// before\nentry = registry['3DBall']  # KeyError: registered as '3dball'\n// after\nentry = registry['3dball']  # or: check `if '3DBall' in registry` first","handlingStrategy":"try-catch","validationCode":"identifier = '3dball'\nif identifier not in registry:  # triggers manifest load\n    raise KeyError(f\"{identifier} not registered; available: {[e for e in registry]}\")\nentry = registry[identifier]","typeGuard":"def get_entry(registry, identifier: str):\n    return registry[identifier] if identifier in registry else None","tryCatchPattern":"try:\n    entry = registry[identifier]\nexcept KeyError as e:\n    logger.error(\"Unknown env id %s; available=%s\", identifier, list(registry))\n    raise","preventionTips":["Copy identifiers exactly from the manifest (watch casing)","List registered entries before lookup","Ensure all needed manifest paths/URLs are passed to UnityEnvRegistry"],"tags":["registry","keyerror","python"],"backgroundTag":"unknown-registry-key","analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}