phacility/phabricator · warning · PhutilArgumentUsageException

You must enter an LDAP username.

Error message

You must enter an LDAP username.

What it means

The bin/auth ldap workflow interactively prompts for LDAP credentials to test the provider's bind; phutil_console_prompt returns an empty LDAP username and the workflow aborts with PhutilArgumentUsageException before prompting for the password.

Source

Thrown at src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php:40

      $console->writeOut(
        "%s\n",
        pht('The LDAP authentication provider is not enabled.'));
      exit(1);
    }

    if (!function_exists('ldap_connect')) {
      $console->writeOut(
        "%s\n",
        pht('The LDAP extension is not enabled.'));
      exit(1);
    }

    $adapter = $provider->getAdapter();

    $console->writeOut("%s\n", pht('Enter LDAP Credentials'));
    $username = phutil_console_prompt(pht('LDAP Username: '));
    if (!strlen($username)) {
      throw new PhutilArgumentUsageException(
        pht('You must enter an LDAP username.'));
    }

    phutil_passthru('stty -echo');
    $password = phutil_console_prompt(pht('LDAP Password: '));
    phutil_passthru('stty echo');

    if (!strlen($password)) {
      throw new PhutilArgumentUsageException(
        pht('You must enter an LDAP password.'));
    }

    $adapter->setLoginUsername($username);
    $adapter->setLoginPassword(new PhutilOpaqueEnvelope($password));

    $console->writeOut("\n");
    $console->writeOut("%s\n", pht('Connecting to LDAP...'));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Re-run and enter a real LDAP username (typically your own test/bind user), then the password.
  2. Run the command from an interactive shell — this workflow takes no CLI arguments.
  3. Confirm the LDAP extension is loaded and the LDAP provider is enabled (the workflow exits earlier otherwise).
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Pressing Enter at the 'LDAP Username:' prompt without typing anything, or running the command where stdin is closed so the prompt reads empty.

Common situations: Misfired Enter; probing whether the prompt is mandatory; invoking the interactive workflow from a script without stdin attached.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/46468a62f209cc92. Report an issue: GitHub.