argocd-autopilot icon indicating copy to clipboard operation
argocd-autopilot copied to clipboard

Cannot initialize Azure DevOps repository during bootstrap

Open antongroot opened this issue 2 years ago • 4 comments

Describe the bug

Hi,

I'm bootstrapping argocd and receive a runtime error. The repository in Azure is created but not initialized while the INFO line 5 suggests it is.

To Reproduce

Set the environment vars GIT_TOKEN and GIT_REPO and run argocd-autopilot repo bootstrap.

Expected behavior

Expected an initialize repository with argocd deployment up and running.

Screenshots

Version

v0.4.5

Logs

INFO[2022-08-24T11:23:25+02:00] cloning repo: https://<redacted>/_git/argocd-bootstrap
DEBU[2022-08-24T11:23:25+02:00] cloning git repo                              url="https://<redacted>/_git/argocd-bootstrap"
DEBU[2022-08-24T11:23:25+02:00] Failed to clone repository, trying again in 3 seconds...  err="repository not found" retry=0
INFO[2022-08-24T11:23:28+02:00] repository 'https://<redacted>/_git/argocd-bootstrap' was not found, trying to create it...
INFO[2022-08-24T11:23:28+02:00] empty repository, initializing a new one with specified remote
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2aa3e8f]

goroutine 1 [running]:
github.com/argoproj-labs/argocd-autopilot/pkg/git.(*adoGit).GetDefaultBranch(0xc001c0a630, {0x433bfe8, 0xc000515dc0}, {0xc000052037, 0x10})
	/codefresh/volume/argocd-autopilot/pkg/git/provider_ado.go:95 +0xef
github.com/argoproj-labs/argocd-autopilot/pkg/git.(*repo).getDefaultBranch(0xc000523500, {0x433bfe8, 0xc000515dc0}, {0xc000052009?, 0x0?})
	/codefresh/volume/argocd-autopilot/pkg/git/repository.go:541 +0x99
github.com/argoproj-labs/argocd-autopilot/pkg/git.glob..func11({0x433bfe8, 0xc000515dc0}, 0xc0001ba280)
	/codefresh/volume/argocd-autopilot/pkg/git/repository.go:515 +0x3f7
github.com/argoproj-labs/argocd-autopilot/pkg/git.(*CloneOptions).GetRepo(0xc0001ba280, {0x433bfe8?, 0xc000515dc0})
	/codefresh/volume/argocd-autopilot/pkg/git/repository.go:234 +0x350
github.com/argoproj-labs/argocd-autopilot/cmd/commands.glob..func3({0x433bfe8?, 0xc000515dc0?}, 0x4341040?)
	/codefresh/volume/argocd-autopilot/cmd/commands/common.go:41 +0x32
github.com/argoproj-labs/argocd-autopilot/cmd/commands.RunRepoBootstrap({0x433bfe8?, 0xc000515dc0}, 0xf?)
	/codefresh/volume/argocd-autopilot/cmd/commands/repo.go:231 +0x54d
github.com/argoproj-labs/argocd-autopilot/cmd/commands.NewRepoBootstrapCommand.func2(0xc0011ef400, {0x3cef783?, 0x4?, 0x4?})
	/codefresh/volume/argocd-autopilot/cmd/commands/repo.go:149 +0x2a5
github.com/spf13/cobra.(*Command).execute(0xc0011ef400, {0xc00059c900, 0x4, 0x4})
	/codefresh/volume/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc0011eec80)
	/codefresh/volume/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x3b4
github.com/spf13/cobra.(*Command).Execute(...)
	/codefresh/volume/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:902
github.com/spf13/cobra.(*Command).ExecuteContext(...)
	/codefresh/volume/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:895
main.main()
	/codefresh/volume/argocd-autopilot/cmd/main.go:26 +0x34b

antongroot avatar Aug 24 '22 09:08 antongroot

Any updates on this?

alexvonstein avatar Nov 30 '22 09:11 alexvonstein

No sorry, still waiting for dev team to resolve.

antongroot avatar Nov 30 '22 09:11 antongroot

Hello, Any news ????

julianobarbosa avatar Dec 13 '22 10:12 julianobarbosa

Hey, i'm also looking for a valid solution for this. Azure DevOps is not a small provider. The workarounds are really nasty and possibly break up with company compliance rules. (eg. hosting an intermediate repository on GitHub) Therefore this could be a dealbreaker for argocd usage at all

sknopp avatar Mar 10 '23 09:03 sknopp