Skip to content

git push fails from AI agent: no SSH key configured and PAT unusable for HTTPS git push #36

Description

@dnyw4l3n13

Summary

While working on issue credfeto/credfeto-ssh-key-mgr#15, the AI agent cannot push to the remote repository via git push.

Error sequence

  1. Initial error: Host key verification failed. (no ~/.ssh/known_hosts in agent environment)
  2. After ssh-keyscan github.com >> ~/.ssh/known_hosts: Permission denied (publickey) (no SSH private key configured)
  3. Token-based HTTPS push with GH_ENTERPRISE_TOKEN: Invalid username or token. Password authentication is not supported for Git operations.
  4. No git credential helper is configured.

Commands attempted

git push -u origin feature/15-echo-to-output-helpers
# Error: Host key verification failed.

ssh-keyscan github.com >> ~/.ssh/known_hosts
git push -u origin feature/15-echo-to-output-helpers
# Error: git@github.com: Permission denied (publickey).

GIT_CONFIG_NOSYSTEM=1 HOME=/tmp git push "https://x-access-token:${GH_ENTERPRISE_TOKEN}@github.com/credfeto/credfeto-ssh-key-mgr.git" HEAD:feature/15-echo-to-output-helpers
# Error: remote: Invalid username or token. Password authentication is not supported for Git operations.

Impact

Cannot push the feature branch for issue credfeto/credfeto-ssh-key-mgr#15. The environment needs either:

  • An SSH private key for git@github.com available in the SSH agent, or
  • A valid GitHub PAT that can be used for HTTPS git push (e.g. via git credential store or GIT_TOKEN env var)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions