使用 Jfrog CLI 从 Artifactory 下载文件会随机中断

File download from Artifactory breaks randomly with Jfrog CLI

我有一些脚本使用 Jfrog CLI 从 artifactory 下载文件。这些脚本在 RHEL7 上。从Artifactory下载软件包的下载命令(jfrog rt dl)很少

这些包中的一个随机会失败并显示以下错误消息:

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

我使用的命令是这样的(来自不同的脚本):


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

我正在使用 Jfrog CLI jf version 2.12.0

最初当它因分段错误消息而失败时,我添加了 TMPDIR,但这并没有解决问题。 我看了一个类似的 post 但它似乎不是我得到的确切错误。

有人遇到过类似的问题吗?有解决此问题的想法吗?

我在 CentOS 上也没有遇到这个问题。是否与 RHEL7 不兼容?

This commit of jfrog-client-go 解决了这个问题。 jfrog-client-go v1.8.1 已通过此修复发布。

JFrog CLI 2.12.1 也已发布并包含此修复程序。 看来暴露这个bug的场景是nil response或者没有body的response。如果这是由您的网络不稳定引起的,那么 jfrog-client-go 的 HTTP 重试机制有可能会缓解并解决该问题,因为它不再崩溃了。

值得upgrading JFrog CLI 到 2.12.1 版本(目前是最新的),看看问题是否完全解决,或者还有其他问题,这可能与以下问题有关,也可能与以下问题无关JFrog CLI的代码,还有待处理