Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing Config Backup git repository fails #29

Closed
991jo opened this issue Mar 9, 2021 · 1 comment
Closed

Pushing Config Backup git repository fails #29

991jo opened this issue Mar 9, 2021 · 1 comment

Comments

@991jo
Copy link

991jo commented Mar 9, 2021

Environment

  • Python version: 3.7.3
  • Nautobot version: development-branch from ~ 2020-03-08T16:00:00 UTC
  • nautobot-golden-config version: 0.9.0

Steps to Reproduce

  1. Configure a git repository (in a self hosted gitlab instance)
  2. Run a Backup Job

Expected Behavior

The Backup Config git repo gets pushed.

Observed Behavior

The process fails with an error after making the config backup:

An exception occurred: GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git push --porcelain origin stderr: 'fatal: Authentication failed for 'https://<key here>:x-oauth-basic@git.example.org/someuser/nautobot-tests.git/''

Traceback (most recent call last):
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot/extras/jobs.py", line 826, in _run_job
    output = job.run(data=data, commit=commit)
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/jobs.py", line 53, in inner
    return method(obj, data, commit)
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/jobs.py", line 187, in run
    backup_repo.push()
  File "/opt/nautobot/lib/python3.7/site-packages/nautobot_golden_config/utilities/git.py", line 56, in push
    self.repo.remotes.origin.push()
  File "/opt/nautobot/lib/python3.7/site-packages/git/remote.py", line 848, in push
    return self._get_push_info(proc, progress)
  File "/opt/nautobot/lib/python3.7/site-packages/git/remote.py", line 735, in _get_push_info
    proc.wait(stderr=stderr_text)
  File "/opt/nautobot/lib/python3.7/site-packages/git/cmd.py", line 408, in wait
    raise GitCommandError(self.args, status, errstr)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git push --porcelain origin
  stderr: 'fatal: Authentication failed for 'https://<key here>:x-oauth-basic@git.example.org/someuser/nautobot-tests.git/''

Pulling the repo works. Also the username for that repo is not x-oauth-basic, sounds wrong to me, but I have no idea how the gitlab API works. The access token has write access to the repo.

@itdependsnetworks
Copy link
Contributor

Yes, I believe this is covered in #27

The support of additional providers was a late arrival in core by @smk4664 and I have not matched. Let me know if you think this is incorrect to reopen, but closing as duplicate for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants