简体   繁体   English

curl 命令无法上传文件,如果文件已经存在于 jfrog artifactory

[英]curl command not working to upload file , if file is already present on jfrog artifactory

The following curl command:以下curl命令:

curl -v -H X-JFrog-Art-Api:<API-Key> -X PUT "http:<artifactory-url>:<port>/<path>/test.exe" -T test.exe

Returns bad gateway error 502, if test.exe is already present on the artifactory url.如果 test.exe 已经存在于 artifactory url 上,则返回错误的网关错误 502。 How do I overwrite this file ?我如何覆盖这个文件?

You can overwrite a fill only if the user is having the overwrite permissions on the repository.只有当用户对存储库具有覆盖权限时,您才能覆盖填充。 Please make sure the user has permissions.请确保用户具有权限。

on the other hand 502 indicates that there is an issue with proxy configuration.另一方面,502 表示代理配置存在问题。 My request is to share more information if the user above user permission didn't fix the issue.如果高于用户权限的用户没有解决问题,我的请求是分享更多信息。 error log messages from Artifactory + reverse proxy will be helpful来自 Artifactory + 反向代理的错误日志消息会有所帮助

The issue may not be necessarily a 502 from the Artifactory side.问题可能不一定是 Artifactory 方面的 502。 Apache is known to send 502s instead of 403/401 when there is a redirect involved.众所周知,当涉及重定向时,Apache 会发送 502s 而不是 403/401。 I'd suggest the same call with an admin user or a user with the correct permissions;我建议与管理员用户或具有正确权限的用户进行相同的调用; it's possible the API key is not correct or the user just hasn't been given the right permissions. API 密钥可能不正确,或者用户没有获得正确的权限。

It's also possible the path is wrong;也有可能是路径不对; depending on your configuration and version the path may need to have "/artifactory/" after the port, and if not given it may fail the request.根据您的配置和版本,路径可能需要在端口后包含“/artifactory/”,如果没有给出,它可能会导致请求失败。

Also could be that the repository is not local, and you are pushing to a repo that does not accept uploads.也可能是存储库不是本地的,并且您正在推送到不接受上传的存储库。

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

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