appwrite/appwrite · error · Exception

Failed to login user

Error message

Failed to login user

What it means

Error "Failed to login user" thrown in appwrite/appwrite.

Source

Thrown at src/Appwrite/Platform/Tasks/Screenshot.php:95

        if ($user['headers']['status-code'] !== 201) {
            Console::error(\json_encode($user));
            throw new \Exception("Failed to register user");
        }

        Console::info("User created");

        // Login
        $session = $client->call(Client::METHOD_POST, '/account/sessions/email', [
            'content-type' => 'application/json',
            'x-appwrite-project' => 'console',
        ], [
            'email' => $email,
            'password' => $password,
        ]);

        if ($session['headers']['status-code'] !== 201) {
            Console::error(\json_encode($session));
            throw new \Exception("Failed to login user");
        }

        Console::info("Session created");

        $secret = $session['cookies']['a_session_console'];
        $cookieConsole = 'a_session_console=' . $secret;

        // Create organization
        $team = $client->call(Client::METHOD_POST, '/teams', [
            'content-type' => 'application/json',
            'x-appwrite-project' => 'console',
            'cookie' => $cookieConsole
        ], [
            'teamId' => ID::unique(),
            'name' => 'Demo Project Team',
        ]);

        if ($team['headers']['status-code'] !== 201) {

View on GitHub (pinned to a1d520eea4)

Solutions

  1. Verify the user credentials are correct and the user account exists and is not blocked.
  2. Check the Appwrite container logs for the session creation error details.

When it happens

Trigger: Thrown at src/Appwrite/Platform/Tasks/Screenshot.php:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of appwrite/appwrite@a1d520eea4 (2026-08-18). Data as JSON: /api/errors/7d4eee623a6f280a. Report an issue: GitHub.