{"record":{"id":"a421cfee20fdf804","repo":"pypa/pip","slug":"fatal-internal-error-id-1-please-report-as-a-bu","errorCode":null,"errorMessage":"Fatal Internal error [id=1]. Please report as a bug.","messagePattern":"Fatal Internal error \\[id=1\\]\\. Please report as a bug\\.","errorType":"exception","errorClass":"ConfigurationError","httpStatus":null,"severity":"error","filePath":"src/pip/_internal/configuration.py","lineNumber":200,"sourceCode":"        key = _normalize_name(key)\n        self._ensure_have_load_only()\n\n        assert self.load_only\n        fname, parser = self._get_parser_to_modify()\n\n        if (\n            key not in self._config[self.load_only][fname]\n            and key not in self._config[self.load_only]\n        ):\n            raise ConfigurationError(f\"No such key - {orig_key}\")\n\n        if parser is not None:\n            section, name = _disassemble_key(key)\n            if not (\n                parser.has_section(section) and parser.remove_option(section, name)\n            ):\n                # The option was not removed.\n                raise ConfigurationError(\n                    \"Fatal Internal error [id=1]. Please report as a bug.\"\n                )\n\n            # The section may be empty after the option was removed.\n            if not parser.items(section):\n                parser.remove_section(section)\n            self._mark_as_modified(fname, parser)\n        try:\n            del self._config[self.load_only][fname][key]\n        except KeyError:\n            del self._config[self.load_only][key]\n\n    def save(self) -> None:\n        \"\"\"Save the current in-memory state.\"\"\"\n        self._ensure_have_load_only()\n\n        for fname, parser in self._modified_parsers:\n            logger.info(\"Writing to %s\", fname)","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pypa/pip/blob/f399c3718970b1b0e2478dac5296eb62679a9b86/src/pip/_internal/configuration.py#L182-L218","documentation":"Raised by Configuration.unset_value() in a branch where the in-memory config claimed the key existed, but the underlying RawConfigParser.remove_option() returned False (option not found in the section). This indicates the in-memory cache and the parser object diverged — a state pip considers impossible under normal operation and explicitly labels a bug.","triggerScenarios":"A genuine internal inconsistency: the _config dict has the key but the parser does not. Practically unreachable in released pip without concurrent modification, filesystem races, or a bug in _load_file/_mark_as_modified. Could surface under exotic conditions like a custom sitecustomize patching configparser.","commonSituations":"Concurrent pip processes editing the same config file; filesystem snapshots/races where the file changed between read and write; extremely rare — most users will never see it.","solutions":["Report as a bug to pip with the full command, pip version, and config file contents (https://github.com/pypa/pip/issues).","Ensure no other pip process or editor is modifying the config file simultaneously.","Inspect the config file manually for corruption and rewrite it if needed.","Retry the unset operation after restarting the shell/interpreter to clear any stale in-memory state."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from pip._internal.exceptions import ConfigurationError\ntry:\n    cfg.unset_value(key)\nexcept ConfigurationError as e:\n    if 'Fatal Internal error [id=1]' in str(e):\n        # report and recover by reloading config from disk\n        cfg.load()\n    else:\n        raise\n","preventionTips":["Avoid concurrent pip processes editing the same config file.","Report occurrences to pip — this path is labeled an internal bug."],"tags":["pip","config","internal","bug","race-condition"],"backgroundTag":null,"analyzedSha":"f399c3718970b1b0e2478dac5296eb62679a9b86","analyzedAt":"2026-08-08T23:01:42.227Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}