phacility/phabricator · error · Exception

Expected `git-lfs-authenticate

Error message

Expected `git-lfs-authenticate <path> <operation>`, but received too few arguments.

What it means

Argument-count guard in getLFSArgument: the git-lfs-authenticate SSH command is expected to carry at least <path> <operation> (argv positions 0 and 1), but the requested position is not set. It means the client invoked the LFS authenticate workflow with too few positional arguments, so the path or operation is missing.

Solutions

  1. Invoke git-lfs-authenticate with both a repository path and an operation ('upload' or 'download')
  2. Upgrade the git-lfs client so it sends well-formed arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/diffusion/gitlfs/DiffusionGitLFSAuthenticateWorkflow.php:36 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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

Appendix: source

Thrown at src/applications/diffusion/gitlfs/DiffusionGitLFSAuthenticateWorkflow.php:36

    return $this->loadRepositoryWithPath(
      $this->getLFSPathArgument(),
      PhabricatorRepositoryType::REPOSITORY_TYPE_GIT);
  }

  private function getLFSPathArgument() {
    return $this->getLFSArgument(0);
  }

  private function getLFSOperationArgument() {
    return $this->getLFSArgument(1);
  }

  private function getLFSArgument($position) {
    $args = $this->getArgs();
    $argv = $args->getArg('argv');

    if (!isset($argv[$position])) {
      throw new Exception(
        pht(
          'Expected `git-lfs-authenticate <path> <operation>`, but received '.
          'too few arguments.'));
    }

    return $argv[$position];
  }

  protected function executeRepositoryOperations() {
    $operation = $this->getLFSOperationArgument();

    // NOTE: We aren't checking write access here, even for "upload". The
    // HTTP endpoint should be able to do that for us.

    switch ($operation) {
      case 'upload':
      case 'download':
        break;

View on GitHub (pinned to 5720a38cfe)