简体   繁体   English

下载 Jfrog artifactory 抛出 403 错误[只允许非匿名用户访问 AQL 查询]

[英]Downloading Jfrog artifactory throws 403 error[Only non-anonymous users are allowed to access AQL queries]

I am using Jenkins Pipeline to download Jfrog artifactory on a server where Jfrog CLI is configured.我正在使用 Jenkins 管道在配置了 Jfrog CLI 的服务器上下载 Jfrog 工件。

1.The following cmd when executed from Jenkins throws the below error: 1.以下cmd从Jenkins执行时抛出以下错误:

jf rt dl is-passport-dev/xyz.zip C\Windows\xyz.zip

[Error] the --url option is mandatory [错误] --url 选项是强制性的

2.The same above command on executing directly on the jfrog configured server works like a charm. 2.直接在jfrog配置的服务器上执行相同的上述命令就像一个魅力。

3.Below cmd is executed as a workaround for Point 1: 3.下面 cmd 作为第 1 点的解决方法执行:

jf rt dl --url https://<artifactory_url>/artifactory/is-passport-dev/xyz.zip C\Windows\xyz.zip

[Info] Searching items to download... [信息] 正在搜索要下载的项目...

[Error] Server response: 403 Forbidden [错误] 服务器响应:403 Forbidden

Only non-anonymous users are allowed to access AQL queries只允许非匿名用户访问 AQL 查询

This error is seen both when executing from the jenkins pipeline and also on executing directly on jfrog configured server.从 jenkins 管道执行以及直接在 jfrog 配置的服务器上执行时都会出现此错误。 I have ensured that the user and the repository has the right permission for uploading and downloading.我已确保用户和存储库具有上传和下载的正确权限。

Note: jf rt upload --url <url_path> <source_file_path> <destination_file_path> works fine without any issues注意: jf rt upload --url <url_path> <source_file_path> <destination_file_path>工作正常,没有任何问题

Can someone suggest me how to overcome this problem?有人可以建议我如何克服这个问题吗?

The problem is that you are trying to download an Artifact but you are 'anonymous' (server is not configured in the cli):问题是您正在尝试下载 Artifact 但您是“匿名”(未在 cli 中配置服务器):

two solutions:两种解决方案:

  1. give 'anonymous' users read rights on you repo (not recommended)授予“匿名”用户对您的 repo 的阅读权限(不推荐)

  2. Configure the cli with a user and password/token使用用户和密码/令牌配置 cli

     jf c add server_1

    follow steps to configure按照步骤配置

    cmd to use it cmd 使用它

    jf rt dl is-passport-dev/xyz.zip C:\Windows\xyz.zip --flat --server-id server_1

Fabien.法比安。

Even though I am able to achieve the artifact download using curl commands instead of JFrog CLI, the downloading of the package with the curl command is extremely slow.尽管我能够使用 curl 命令而不是 JFrog CLI 来实现工件下载,但使用 curl 命令下载 package 非常慢。 700MB zip takes close to 8 minutes with curl cmd. 700MB zip 使用 curl cmd 需要将近 8 分钟。 Is it possible to reduce the download time here?是否可以减少这里的下载时间?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM