{"record":{"id":"754d3fe35db78c67","repo":"ruvnet/RuView","slug":"user-already-exists","errorCode":null,"errorMessage":"User already exists","messagePattern":"User already exists","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"archive/v1/src/middleware/auth.py","lineNumber":123,"sourceCode":"    \n    def authenticate_user(self, username: str, password: str) -> Optional[Dict[str, Any]]:\n        \"\"\"Authenticate user with username and password.\"\"\"\n        user = self.get_user(username)\n        if not user:\n            return None\n        \n        if not self.verify_password(password, user[\"hashed_password\"]):\n            return None\n        \n        if not user.get(\"is_active\", False):\n            return None\n        \n        return user\n    \n    def create_user(self, username: str, email: str, password: str, roles: list = None) -> Dict[str, Any]:\n        \"\"\"Create a new user.\"\"\"\n        if username in self._users:\n            raise ValueError(\"User already exists\")\n        \n        user = {\n            \"username\": username,\n            \"email\": email,\n            \"hashed_password\": self.hash_password(password),\n            \"roles\": roles or [\"user\"],\n            \"is_active\": True,\n            \"created_at\": datetime.utcnow(),\n        }\n        \n        self._users[username] = user\n        return user\n    \n    def update_user(self, username: str, updates: Dict[str, Any]) -> Optional[Dict[str, Any]]:\n        \"\"\"Update user information.\"\"\"\n        user = self._users.get(username)\n        if not user:\n            return None","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/middleware/auth.py#L105-L141","documentation":"Error \"User already exists\" thrown in ruvnet/RuView.","triggerScenarios":"Thrown at archive/v1/src/middleware/auth.py:123 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":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}