简体   繁体   English

JFrog Artifactory 通过 Jenkins 上传 tar 失败,出现 404

[英]JFrog Artifactory upload tar via Jenkins failes with 404

Since a few days we got an error on a Jenkins Pipeline when we want to upload a tar archive via spec to the Artifactory.几天以来,当我们想通过规范将 tar 存档上传到 Artifactory 时,我们在 Jenkins 管道上遇到错误。 All the Maven builds with goal deploy works well and the artifacts gets deployed.所有带有目标deploy的 Maven 构建都运行良好,并且工件被部署。 I checked the docs, logs and Stackoverflow.我检查了文档、日志和 Stackoverflow。 At the moment I have no further ideas except asking here.目前除了在这里问之外,我没有其他想法。

This is the error message of the console output from the Jenkins Pipeline:这是来自 Jenkins 管道的控制台 output 的错误消息:

[...]
[Pipeline] script
[Pipeline] {
[Pipeline] newBuildInfo
[Pipeline] artifactoryUpload
Executing command: /bin/sh -c git log --pretty=format:%s -1
[consumer_0] Deploying artifact: http://artifactory.build.ir-d.de/artifactory/snapshots/de/bmg/ird/app-ird-rst/release-bundles/1.62.0/ird-rst-release-bundle-1.62.0.tar.gz
Failed to upload file
[consumer_0] An exception occurred during execution:
java.lang.RuntimeException: java.io.IOException: JFrog service failed. Received 404: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>

    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:44)
    at org.jfrog.build.extractor.producerConsumer.ConsumerRunnableBase.run(ConsumerRunnableBase.java:11)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.io.IOException: JFrog service failed. Received 404: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
</body></html>

    at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.throwException(JFrogService.java:49)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.Upload.handleUnsuccessfulResponse(Upload.java:59)
    at org.jfrog.build.extractor.clientConfiguration.client.JFrogService.execute(JFrogService.java:121)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.services.Upload.execute(Upload.java:77)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager.upload(ArtifactoryManager.java:262)
    at org.jfrog.build.extractor.clientConfiguration.client.artifactory.ArtifactoryManager.upload(ArtifactoryManager.java:257)
    at org.jfrog.build.extractor.clientConfiguration.util.spec.SpecDeploymentConsumer.consumerRun(SpecDeploymentConsumer.java:39)
    ... 2 more
[...]

That's the relevant part of the pipeline with the upload spec:这是与上传规范相关的管道部分:

def artifactoryServer = Artifactory.server 'art1'
[...]
pipeline {
    stages {
        stage('Transfer release bundle to artifactory.') {
            steps {
                script {
                    parentArtifactId = parentPom.artifactId
                    def repository = "snapshots"
                    if(params.branchName == "master") {
                        repository = "releases";
                    }
                        
                    def uploadReleaseArchiveSpec = """{
                        "files": [ 
                            {
                                 "pattern": "release-bundle-${releaseBundleVersion}.tar.gz",
                                 "target": "${repository}/path/to/file/${parentArtifactId}/release-bundles/${parentPom.version}/"
                            }
                        ]                                                 
                    }"""
                        artifactoryServer.upload spec: uploadReleaseArchiveSpec, failNoOp: true
                }
            }    
        }
    }
}

In the router-request.log I found this:router-request.log我发现这个:

{
    "ClientAddr": "127.0.0.1:56828",
    "DownstreamContentSize": 95,
    "DownstreamStatus": 404,
    "Duration": 2531738,
    "RequestMethod": "GET",
    "RequestPath": "/access/api/v1/users/jffe@000?expand=groups",
    "ServiceAddr": "localhost:8040",
    "StartUTC": "2022-09-08T09:39:50.224317922Z",
    "level": "info",
    "msg": "",
    "request_Uber-Trace-Id": "745779c57b007818:30fa1347695348a7:062656bb9a6ef6c9:0",
    "request_User-Agent": "JFrog Access Java Client/7.43.6 74306900  Artifactory/7.38.10 73810900",
    "time": "2022-09-08T11:39:50+02:00"
}

There is also an error message in the catalina log from Tomcat of Artifactory:来自 Artifactory 的 Tomcat 的 catalina 日志中也有错误消息:

08-Sep-2022 13:52:42.392 SEVERE [http-nio-127.0.0.1-8091-Acceptor] org.apache.tomcat.util.net.Acceptor.run Socket accept failed
        java.io.IOException: Duplicate accept detected. This is a known OS bug. Please consider reporting that you are affected: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1924298
                at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:548)
                at org.apache.tomcat.util.net.NioEndpoint.serverSocketAccept(NioEndpoint.java:78)
                at org.apache.tomcat.util.net.Acceptor.run(Acceptor.java:129)
                at java.base/java.lang.Thread.run(Thread.java:829)

But we are using RedHat Enterprise Linux and not Ubuntu.但我们使用的是 RedHat Enterprise Linux 而不是 Ubuntu。 Otherwise there is an error.否则有错误。 Our environment:我们的环境:

Jenkins 2.346.3
Artifactory 7.38.10
Jenkins Artifactory Plug-in 3.17.0 (and 3.16.2 former attempts)
RedHat Enterprise Linux 8.6

Has anybody an idea?有人有想法吗? Did I overseen something in the logs above?我在上面的日志中监督了什么吗? Where else should I look?我还应该去哪里看?

I saw also this post .我也看到了这个帖子 Unfortunately without answer.可惜没有答案。

I guess you are using your own private Jfrog?我猜您正在使用自己的私人 Jfrog? In that case, does the Jenkins machine have access to your JFrog?在这种情况下,Jenkins 机器是否可以访问您的 JFrog? Can you ssh into your Jenkins machine and upload a random artifact using curl?您可以将 ssh 放入您的 Jenkins 机器并使用 curl 上传随机工件吗?

This may not be the best answer, but when dealing with Jfrog, I always simply use curl within the Jenkins pipeline to upload artifacts:这可能不是最好的答案,但是在处理 Jfrog 时,我总是简单地在 Jenkins 管道中使用 curl 来上传工件:

curl -u <user>:<password> -X PUT "<jfrog_url>/path/to/upload/artifact.zip" -T "path\on\jenkins\artifact.zip"

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

相关问题 Jfrog神器与jenkins集成 - Jfrog artifactory intigration with jenkins 通过Jenkins的Artifactory上传问题 - Artifactory upload issue via Jenkins 通过 jenkins 上传的 JFrog Artifactory 工件不会出现在构建中 - JFrog Artifactory artifacts uploaded via jenkins dont show up in builds 如何在Jenkins中使用filespec动态创建文件夹并在Jfrog人工制品中上传人工制品? - How to create folders dynamically and upload artifacts in Jfrog artifactory using filespecs in Jenkins? 使用JFrog Artifactory在Jenkins中运行Maven会产生PluginResolutionException - Running Maven in Jenkins with JFrog Artifactory produces PluginResolutionException JFrog Artifactory的Jenkins管道无法发布BuildInfo - Jenkins pipeline for JFrog Artifactory fails to publish BuildInfo Jenkins 中的 Nuget.config 文件设置(来自 Jfrog Artifactory) - Nuget.config file setup in Jenkins (From Jfrog Artifactory) 如何为上传到 Jfrog Artifactory 的每个工件触发 Jenkins 管道构建 - How to trigger a Jenkins pipeline build for every artifact uploaded to Jfrog Artifactory Jenkins 构建触发器“启用 Artifactory 触发器”不适用于 JFrog - Jenkins Build Trigger "Enable Artifactory trigger" is not working with JFrog 如何知道一个工件是否已经存在于 Jenkins 的 Jfrog Artifactory 中 - How to know if an artifact already exists in Jfrog Artifactory by Jenkins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM