jfrog-client-go icon indicating copy to clipboard operation
jfrog-client-go copied to clipboard

goroutine stack exceeds for GetUrl() method

Open susannamartinelli opened this issue 5 years ago • 2 comments

HI, the call

rtDetails := auth.NewArtifactoryDetails()
rtDetails.SetUrl("https://my.artifactory-endpoint.com/artifactory/")
rtDetails.SetUser("admin")
rtDetails.SetPassword("mypasswd")
artconfig, err := artifactory.NewConfigBuilder().SetArtDetails(rtDetails).SetThreads(3).SetDryRun(false).Build()
if err != nil {
	panic(err)
}
cli, err := artifactory.New(&rtDetails, artconfig)
if err != nil {
	panic(err)
}
_, err = cli.Ping()
if err != nil {
	panic(err)
}
fmt.Println(cli.GetConfig().GetUrl())

causes a goroutine stack exceeds (infinite recursion I guess)

goroutine 1 [running]:
github.com/jfrog/jfrog-client-go/artifactory.(*artifactoryServicesConfig).GetUrl(0x9c94960, 0x0, 0x0)
	/home/susanna/go/pkg/mod/github.com/jfrog/[email protected]/artifactory/config.go:29 +0x3a fp=0x12400368 sp=0x12400364 pc=0x8548eaa
github.com/jfrog/jfrog-client-go/artifactory.(*artifactoryServicesConfig).GetUrl(0x9c94960, 0x0, 0x0)
	/home/susanna/go/pkg/mod/github.com/jfrog/[email protected]/artifactory/config.go:30 +0x21 fp=0x12400378 sp=0x12400368 pc=0x8548e91
github.com/jfrog/jfrog-client-go/artifactory.(*artifactoryServicesConfig).GetUrl(0x9c94960, 0x0, 0x0)
	/home/susanna/go/pkg/mod/github.com/jfrog/[email protected]/artifactory/config.go:30 +0x21 fp=0x12400388 sp=0x12400378 pc=0x8548e91
github.com/jfrog/jfrog-client-go/artifactory.(*artifactoryServicesConfig).GetUrl(0x9c94960, 0x0, 0x0)

I'm using v0.4.0. Thanks

susannamartinelli avatar Jul 11 '19 14:07 susannamartinelli

@susannamartinelli, Thank you for reporting this issue. We pushed https://github.com/jfrog/jfrog-client-go/pull/69 to the dev branch. It basically removes the problematic GetConfig().GetUrl() API, because the GetConfig().GetArtDetails().GetUrl() API can be used instead. You should already be able to use it, even before this fix is released. Looking forward to your feedback.

eyalbe4 avatar Jul 14 '19 13:07 eyalbe4

Thanks a lot @eyalbe4 I'll try that.

susannamartinelli avatar Jul 16 '19 08:07 susannamartinelli