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

Unable to sync a git repository if the token contains some special characters #397

Closed
dgarros opened this issue May 1, 2021 · 1 comment · Fixed by #425
Closed

Unable to sync a git repository if the token contains some special characters #397

dgarros opened this issue May 1, 2021 · 1 comment · Fixed by #425
Assignees
Labels
type: bug Something isn't working as expected
Milestone

Comments

@dgarros
Copy link
Contributor

dgarros commented May 1, 2021

Environment

  • Python version: 3.7
  • Nautobot version: 1.0.0

Steps to Reproduce

  1. Create a new Git repository
  2. Add a token containing a special character like /
  3. Try to sync the repository

Expected Behavior

Either it shouldn't be possible to create a repository with an invalid token or the sync should work as expected

Observed Behavior

The synchronization fail with an exit code of 128 and the following messages

  • name : Test Wrong token
  • username: test
  • token qwertytrew/qewrtsdfgtrew
  • repo : https://github.com/networktocode-llc/nautobot-datasource
2021-05-01T20:25:14.013404 | Failure |   | Cmd('git') failed due to: exit code(128) cmdline: git clone -v --progress https://test:qwertytrew/qewrtsdfgtrew@github.com/networktocode-llc/nautobot-datasource /opt/nautobot/git/test-wrong-token
2021-05-01T20:25:14.045399 | Failure |   | Error while refreshing Test Wrong token: Cmd('git') failed due to: exit code(128) cmdline: git clone -v --progress https://test:qwertytrew/qewrtsdfgtrew@github.com/networktocode-llc/nautobot-datasource /opt/nautobot/git/test-wrong-token
@glennmatthews
Copy link
Contributor

Thanks for the report! Looks like we probably need to url-encode the token when we add it to the URL in ensure_git_repository().

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants