I have a few scripts which uses the Jfrog CLI to download files from artifactory. These scripts are on RHEL7. There are few download commands (jfrog rt dl) which download software packages from Artifactory.
Randomly one of these package will fail with following error messages:
04:12:24 [Info] [Thread 2] [1]: 206 Partial Content...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x9d2bfb]
goroutine 86 [running]:
github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).doDownloadFileRange.func2()
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:659 +0x1b
github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).doDownloadFileRange(0x64, {{0xc00003aa80, 0x25}, {0xc000354c40, 0x68}, {0xc000436320, 0x47}, {0x7ffecb4afe1c, 0x25}, {0xc000036168, ...}, ...}, ...)
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:685 +0x619
github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).downloadFileRange.func1()
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:614 +0x16b
github.com/jfrog/jfrog-client-go/utils.(*RetryExecutor).Execute(0xc000521d60)
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/utils/retryexecutor.go:33 +0x57
github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).downloadFileRange(0xc00036e900, {{0xc00003aa80, 0x25}, {0xc000354c40, 0x68}, {0xc000436320, 0x47}, {0x7ffecb4afe1c, 0x25}, {0xc000036168, ...}, ...}, ...)
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:632 +0x48d
github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).downloadChunksConcurrently.func1(0x0, 0x0, 0x1)
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:544 +0x229
created by github.com/jfrog/jfrog-client-go/http/httpclient.(*HttpClient).downloadChunksConcurrently
/root/go/pkg/mod/github.com/jfrog/jfrog-client-go@v1.8.0/http/httpclient/client.go:543 +0x151
The commands i use are like these(from different scripts):
TMPDIR="/app/install/temp" jfrog rt dl artifactory-project/Backup_file.rep.gz $REPO_FILE
jfrog rt dl artifactory-project/second_file.tar.gz /app/software/second_file.tar.gz
I am using Jfrog CLI jf version 2.12.0
Initially when it failed with segmentation error messages i added TMPDIR, but that did not sort out the issue. I took a look at a similar post Artifactory Crash due to Segmentation Violation but it does not seem to the exact error as i get.
Anyone faced similar issues? Any ideas to fix this issue?
Also I did not face this issue on CentOS. Is there some incompatibility with RHEL7?
This commit of jfrog-client-go fixes the issue. jfrog-client-go v1.8.1 was released with this fix.
JFrog CLI 2.12.1 was also released and includes this fix. It appears that the scenario which exposed this bug is a nil response or a response without a body. If this is caused by some instability in your network, there's a chance that jfrog-client-go's HTTP retry mechanism will mitigate and resolve the issue, now that it no longer crashes beicase of it.
It is worth upgrading JFrog CLI to version 2.12.1 (which is currently the latest) and seeing if the issue is completely resolved, or there are other issues, which may or may not be related to the code of JFrog CLI, which still need to be handled.