首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >artifactory archive entry download: 404 for tgz,路径为归档资源的前导点

artifactory archive entry download: 404 for tgz,路径为归档资源的前导点
EN

Stack Overflow用户
提问于 2020-04-02 17:29:55
回答 2查看 295关注 0票数 1

对于tar.gz归档文件,artifactory archive entry download API会系统地失败。

整个归档文件可以通过https://jcr.mydomain/artifactory/osb-cmdb-builds/manual_report.tgz下载,但https://jcr.mydomain/artifactory/osb-cmdb-builds/manual_report.tgz!/osb-cmdb/build/reports/tests/test/index.html上的个别文件会失败,并显示消息Unable to find zip resource: 'osb-cmdb/build/reports/tests/test/index.html' using full URI '/artifactory/osb-cmdb-builds/manual_report.tgz!/osb-cmdb/build/reports/tests/test/index.html'

但是,artifactory存储库浏览器可以正确地显示存档的内容。

这是使用docker镜像jfrog/artifactory-jcr版本:7.3.2和tar重现的

代码语言:javascript
复制
$ tar --version
tar (GNU tar) 1.29
$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

我是不是漏掉了什么?这是一个在以后的版本中修复的artifactory bug吗?

以下是重现该问题的步骤:

代码语言:javascript
复制
$ tar cvfz manual_report2.tgz ./osb-cmdb/build/reports/tests/test/index.html
$ tar tvfz manual_report2.tgz
-rw-r--r-- guillaume/guillaume 4193 2020-04-01 22:25 ./osb-cmdb/build/reports/tests/test/index.html

查看browsing screenshot entry download screenshot屏幕截图

以及https://meta.stackexchange.com/questions/47689/how-can-i-attach-a-file-to-a-post中建议的google drive上的sample tgz

解决方法:使用zip或tar格式,而不是tar.gz格式。

EN

回答 2

Stack Overflow用户

发布于 2020-04-03 03:41:04

这个问题与“。在文件的路径中。您可以在树浏览器屏幕截图中看到路径的一部分。当您尝试下载时,Artifactory找不到文件的原因是路径缺少点。

点的棘手之处在于,它被认为是一个特殊的符号,可以转换到当前目录中。如果您尝试将其包含在用于下载文件的URL中,浏览器将删除该文件。

但是,通过使用URL编码,我能够使用cURL下载该文件:

代码语言:javascript
复制
curl -vv "http://localhost:8081/artifactory/generic-local/manual_report2.tgz%21/%2E/osb-cmdb/build/reports/tests/test/index.html"

以下URL编码的使用适用于Firefox:

代码语言:javascript
复制
http://localhost:8081/artifactory/generic-local/manual_report2.tgz!%2F./osb-cmdb/build/reports/tests/test/index.html
票数 2
EN

Stack Overflow用户

发布于 2020-04-03 18:27:19

( @dror-bereznitsky答案的改进)

避免在tar.gz归档文件中使用前导./

如果归档路径是动态计算的(例如,find . -name "pattern"的结果),则按照https://unix.stackexchange.com/a/250186/381792中的建议使用--transform='s|^\./||S'参数调用tar命令

代码语言:javascript
复制
$ find . -name "index.html"
./osb-cmdb/build/reports/tests/test/index.html
$ tar cvfz manual_report2.tgz --transform='s|^\./||S' `find . -name "index.html"`
$ tar tvfz manual_report2.tgz
-rw-r--r-- guillaume/guillaume 4193 2020-04-01 22:25 osb-cmdb/build/reports/tests/test/index.html
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60988334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档