{"record":{"id":"7d4eee623a6f280a","repo":"appwrite/appwrite","slug":"failed-to-login-user","errorCode":null,"errorMessage":"Failed to login user","messagePattern":"Failed to login user","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Appwrite/Platform/Tasks/Screenshot.php","lineNumber":95,"sourceCode":"        if ($user['headers']['status-code'] !== 201) {\n            Console::error(\\json_encode($user));\n            throw new \\Exception(\"Failed to register user\");\n        }\n\n        Console::info(\"User created\");\n\n        // Login\n        $session = $client->call(Client::METHOD_POST, '/account/sessions/email', [\n            'content-type' => 'application/json',\n            'x-appwrite-project' => 'console',\n        ], [\n            'email' => $email,\n            'password' => $password,\n        ]);\n\n        if ($session['headers']['status-code'] !== 201) {\n            Console::error(\\json_encode($session));\n            throw new \\Exception(\"Failed to login user\");\n        }\n\n        Console::info(\"Session created\");\n\n        $secret = $session['cookies']['a_session_console'];\n        $cookieConsole = 'a_session_console=' . $secret;\n\n        // Create organization\n        $team = $client->call(Client::METHOD_POST, '/teams', [\n            'content-type' => 'application/json',\n            'x-appwrite-project' => 'console',\n            'cookie' => $cookieConsole\n        ], [\n            'teamId' => ID::unique(),\n            'name' => 'Demo Project Team',\n        ]);\n\n        if ($team['headers']['status-code'] !== 201) {","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/appwrite/appwrite/blob/a1d520eea492ebd1da1ef2dc8db5b2b34e277dce/src/Appwrite/Platform/Tasks/Screenshot.php#L77-L113","documentation":"Error \"Failed to login user\" thrown in appwrite/appwrite.","triggerScenarios":"Thrown at src/Appwrite/Platform/Tasks/Screenshot.php:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the user credentials are correct and the user account exists and is not blocked.","Check the Appwrite container logs for the session creation error details."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1d520eea492ebd1da1ef2dc8db5b2b34e277dce","analyzedAt":"2026-08-18T21:34:56.994Z","contentChangedAt":"2026-08-18T21:34:56.994Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}