【问题标题】:Artifactory yum install 404 error神器yum安装404错误
【发布时间】:2016-01-18 07:02:28
【问题描述】:

我目前正在 Windows Server 2008 R2 上运行 Artifactory Professional 4.0.2 rev 40009 的实例。

我已将 https://mirror.aarnet.edu.au 配置为 Artifactory 中的远程 Yum 存储库。

我已经在 linux 服务器上配置 yum 指向这个工件实例。

当我运行命令时:

yum install -y epel-release

我收到这样的 404 错误:

epel/7/x86_64/updateinfo       FAILED
http://<Artifactory Server Instance>/artifactory/mirror.aarnet.edu.au/pub/epel/7/x86_64/repodata/0dd9044655fe1722d6579c768395f719a74f9954cf78e80d0b757a313be4f7e2-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found|    0 B  --:--:-- ETA Trying other mirror.

如果我直接浏览网址,我会收到类似的 404 错误:

{
    "errors" : [ {
    "status" : 404,
    "message" : "Not Found"
    } ]
}

Artifactory 中的远程 Yum Repo 配置:

<remoteRepository>
        <key>mirror.aarnet.edu.au</key>
        <type>yum</type>
        <description>Mirror of Yum packages hosted by mirror.aarnet.edu.au</description>
        <includesPattern>pub/centos/**,epel/**,pub/epel/**,pub/elrepo/**,pub/el6-dom0/**,pub/fedora/**,pub/fedora-secondary/**,</includesPattern>
        <repoLayoutRef>simple-default</repoLayoutRef>
        <dockerApiVersion>V1</dockerApiVersion>
        <forceDockerAuthentication>false</forceDockerAuthentication>
        <blackedOut>false</blackedOut>
        <handleReleases>true</handleReleases>
        <handleSnapshots>true</handleSnapshots>
        <maxUniqueSnapshots>0</maxUniqueSnapshots>
        <suppressPomConsistencyChecks>true</suppressPomConsistencyChecks>
        <propertySets>
            <propertySetRef>artifactory</propertySetRef>
        </propertySets>
        <archiveBrowsingEnabled>false</archiveBrowsingEnabled>
        <url>https://mirror.aarnet.edu.au</url>
        <offline>false</offline>
        <hardFail>false</hardFail>
        <storeArtifactsLocally>true</storeArtifactsLocally>
        <fetchJarsEagerly>false</fetchJarsEagerly>
        <fetchSourcesEagerly>false</fetchSourcesEagerly>
        <retrievalCachePeriodSecs>0</retrievalCachePeriodSecs>
        <assumedOfflinePeriodSecs>300</assumedOfflinePeriodSecs>
        <missedRetrievalCachePeriodSecs>7200</missedRetrievalCachePeriodSecs>
        <remoteRepoChecksumPolicyType>generate-if-absent</remoteRepoChecksumPolicyType>
        <unusedArtifactsCleanupPeriodHours>24</unusedArtifactsCleanupPeriodHours>
        <shareConfiguration>false</shareConfiguration>
        <synchronizeProperties>false</synchronizeProperties>
        <listRemoteFolderItems>true</listRemoteFolderItems>
        <rejectInvalidJars>false</rejectInvalidJars>
        <allowAnyHostAuth>false</allowAnyHostAuth>
        <socketTimeoutMillis>15000</socketTimeoutMillis>
        <enableCookieManagement>false</enableCookieManagement>
        <enableTokenAuthentication>false</enableTokenAuthentication>
        <proxyRef>Developer-Proxy</proxyRef>
</remoteRepository>

Yum 回购配置:

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://<artifactory server instance>/artifactory/mirror.aarnet.edu.au/pub/epel/$releasever/$basearch/
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://<artifactory server instance>/artifactory/mirror.aarnet.edu.au/pub/epel/$releasever/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://<artifactory server instance>/artifactory/mirror.aarnet.edu.au/pub/epel/$releasever/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

在 Artifactory 中删除缓存并删除远程存储库的内容修复了该问题,但它不断重复出现,我们正在寻找永久修复。

我该如何解决这个问题?

输出失败的二进制 url ?trace :

Request ID: 11bb6581
Repo Path ID: mirror.aarnet.edu.au:pub/centos/7/updates/x86_64/repodata/1d3ddc7dc7e6b67102e2dec1e43813582e2de2d1c813007350586aee0e32eb2e-primary.sqlite.bz2:
Method Name: GET
User: <UserName>
Time: 2016-02-02T13:56:45.565+11:00
Thread: http-nio-8082-exec-28
Steps: 
2016-02-02T13:56:45.565+11:00 Received request
2016-02-02T13:56:45.565+11:00 Request source = 10.62.58.23, Last modified = 01-01-70 09:59:59 +10:00, If modified since = -1, Thread name = http-nio-8082-exec-28
2016-02-02T13:56:45.565+11:00 Executing any BeforeDownloadRequest user plugins that may exist
2016-02-02T13:56:45.565+11:00 Exiting download process - intercepted by addon manager

【问题讨论】:

  • 您是如何配置远程存储库的?你是如何配置你的 yum 的?
  • @JBaruch 感谢您的回复,我已经用信息更新了问题
  • 第一眼看起来不错。请尝试将网址粘贴到浏览器中,看看是否仍然是404?如果是,请将?trace添加到URL末尾并查看结果。
  • @JBaruch 我已经删除了缓存并删除了内容。我会密切关注它,如果它再次出现在 repo 中,我将使用?trace 浏览网址并将其发布在这里。
  • 今天在同一个存储库中再次出现问题,距离我上次删除缓存并删除此存储库的内容已经过去了 2 周。尝试执行“yum install -y epel-release”时会出现“....primary.sqlite.bz2:[Errno 14] HTTP 错误 404 - 未找到”。如果我浏览带有 ?trace 末尾的 url,则输出为:

标签: artifactory yum


【解决方案1】:

升级到 v5.1.4 后再次出现此问题。缓存保留期减少到 10 秒,希望它可以增加索引文件正确更新的可能性,但它没有任何效果,我们必须删除 repodata 文件夹的内容并删除缓存作为解决方法。

我可以看到http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml 上 repomd.xml 的哈希值(最后修改时间:2017 年 3 月 29 日 18:05)与 Artifactory 中同一文件的哈希值不匹配(最后修改时间:29-Mar- 2017 年 05:05)。文件大小也不对齐。

这会导致某些 yum 安装因索引文件过期而失败 -

yum update -y && yum clean all
 ---> Running in e154e2b58ab1
Loaded plugins: fastestmirror, ovl
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package binutils.x86_64 0:2.20.51.0.2-5.44.el6 will be updated
---> Package binutils.x86_64 0:2.20.51.0.2-5.47.el6_9.1 will be an update
---> Package curl.x86_64 0:7.19.7-52.el6 will be updated
---> Package curl.x86_64 0:7.19.7-53.el6_9 will be an update
---> Package glibc.x86_64 0:2.12-1.192.el6 will be updated
---> Package glibc.x86_64 0:2.12-1.209.el6_9.1 will be an update
---> Package glibc-common.x86_64 0:2.12-1.192.el6 will be updated
---> Package glibc-common.x86_64 0:2.12-1.209.el6_9.1 will be an update
---> Package libcurl.x86_64 0:7.19.7-52.el6 will be updated
---> Package libcurl.x86_64 0:7.19.7-53.el6_9 will be an update
---> Package nss.x86_64 0:3.21.0-8.el6 will be updated
---> Package nss.x86_64 0:3.28.3-3.el6_9 will be an update
--> Processing Dependency: nspr >= 4.13.0 for package: nss-3.28.3-3.el6_9.x86_64
---> Package nss-sysinit.x86_64 0:3.21.0-8.el6 will be updated
---> Package nss-sysinit.x86_64 0:3.28.3-3.el6_9 will be an update
---> Package nss-tools.x86_64 0:3.21.0-8.el6 will be updated
---> Package nss-tools.x86_64 0:3.28.3-3.el6_9 will be an update
---> Package nss-util.x86_64 0:3.21.0-2.el6 will be updated
---> Package nss-util.x86_64 0:3.28.3-1.el6_9 will be an update
--> Processing Dependency: nspr >= 4.13.0-1 for package: nss-util-3.28.3-1.el6_9.x86_64
---> Package tzdata.noarch 0:2016f-1.el6 will be updated
---> Package tzdata.noarch 0:2017b-1.el6 will be an update
--> Finished Dependency Resolution
Error: Package: nss-3.28.3-3.el6_9.x86_64 (updates)
           Requires: nspr >= 4.13.0
           Installed: nspr-4.11.0-1.el6.x86_64 (@CentOS/6.8)
               nspr = 4.11.0-1.el6
Error: Package: nss-util-3.28.3-1.el6_9.x86_64 (updates)
           Requires: nspr >= 4.13.0-1
           Installed: nspr-4.11.0-1.el6.x86_64 (@CentOS/6.8)
               nspr = 4.11.0-1.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

通过 HTTP GET 跟踪输出到 http:///org.centos.mirror/6/os/x86_64/repodata/repomd.xml?trace

Request ID: 848754bb
Repo Path ID: org.centos.mirror:6/os/x86_64/repodata/repomd.xml
Method Name: GET
User: anonymous
Time: 2017-04-20T10:17:28.591+10:00
Thread: http-nio-9081-exec-130
Steps: 
2017-04-20T10:17:28.591+10:00 Received request
2017-04-20T10:17:28.591+10:00 Request source = x.x.x.x, Last modified = 01-01-70 09:59:59 +10:00, If modified since = -1, Thread name = http-nio-9081-exec-130
2017-04-20T10:17:28.591+10:00 Executing any BeforeDownloadRequest user plugins that may exist
2017-04-20T10:17:28.591+10:00 Retrieving info from {} repository '{}' type 
2017-04-20T10:17:28.623+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:17:28.623+10:00 Returning resource as expired
2017-04-20T10:17:28.623+10:00 Executing any AltRemotePath user plugins that may exist
2017-04-20T10:17:28.623+10:00 Appending matrix params to remote request URL
2017-04-20T10:17:28.623+10:00 Using remote request URL - http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml
2017-04-20T10:17:28.623+10:00 Executing HEAD request to http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml
2017-04-20T10:17:28.654+10:00 Found remote resource with last modified time - Wed Mar 29 05:05:42 AEDT 2017
2017-04-20T10:17:28.654+10:00 Found remote resource with ETag - "ea5-54bce4edce980"
2017-04-20T10:17:28.654+10:00 Found remote resource with content length - 3749
2017-04-20T10:17:28.654+10:00 Returning found remote resource info
2017-04-20T10:17:28.654+10:00 Requested resource is found = true
2017-04-20T10:17:28.654+10:00 Request is HEAD = false
2017-04-20T10:17:28.654+10:00 Request is for a checksum = false
2017-04-20T10:17:28.654+10:00 Target repository is not remote or doesn't store locally = false
2017-04-20T10:17:28.654+10:00 Requested resource was not modified = false
2017-04-20T10:17:28.654+10:00 Responding with found resource
2017-04-20T10:17:28.654+10:00 Executing any AltResponse user plugins that may exist
2017-04-20T10:17:28.654+10:00 Alternative response status is set to -1 and message to 'null'
2017-04-20T10:17:28.654+10:00 Found no alternative content handles
2017-04-20T10:17:28.654+10:00 Retrieving a content handle from target repo
2017-04-20T10:17:28.654+10:00 The requested resource isn't pre-resolved
2017-04-20T10:17:28.654+10:00 Target repository isn't virtual - verifying that downloading is allowed
2017-04-20T10:17:28.654+10:00 Creating a resource handle from 'org.centos.mirror'
2017-04-20T10:17:28.654+10:00 Target repository is configured to retain artifacts locally - resource will be stored and the streamed to the user
2017-04-20T10:17:28.654+10:00 Remote repository is online
2017-04-20T10:17:28.685+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:17:28.685+10:00 Returning resource as expired
2017-04-20T10:17:28.685+10:00 Found expired cached resource but remote is newer = false. Cached resource: 1490724342000, Remote resource: 1490724342000
2017-04-20T10:17:28.685+10:00 Force expiration on the cached resource = false
2017-04-20T10:17:28.685+10:00 Resource isn't cached and isn't expired = false
2017-04-20T10:17:28.685+10:00 Found expired cached resource and is newer than remote = true
2017-04-20T10:17:28.685+10:00 Executing any AltRemotePath user plugins that may exist
2017-04-20T10:17:28.716+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:17:28.716+10:00 Found request parameter {}=artifactory.forceDownloadIfNewer
2017-04-20T10:17:28.716+10:00 Returning resource as expired
2017-04-20T10:17:28.716+10:00 Using remote request URL - http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml:properties
2017-04-20T10:17:28.716+10:00 Executing HEAD request to http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml:properties
2017-04-20T10:17:28.732+10:00 Received status 404 (message: Not Found) on remote info request - returning unfound resource
2017-04-20T10:17:28.732+10:00 Found no remote properties
2017-04-20T10:17:28.763+10:00 Un-expiring cached resource if needed
2017-04-20T10:17:28.763+10:00 Is resource metadata = false
2017-04-20T10:17:28.763+10:00 Un-expiring the resource
2017-04-20T10:17:28.810+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:17:28.810+10:00 Found request parameter {}=artifactory.forceDownloadIfNewer
2017-04-20T10:17:28.810+10:00 Returning cached resource
2017-04-20T10:17:28.810+10:00 Removing the resource from all failed caches
2017-04-20T10:17:28.810+10:00 Returning the cached resource
2017-04-20T10:17:28.810+10:00 Creating a resource handle from 'org.centos.mirror-cache:6/os/x86_64/repodata/repomd.xml'
2017-04-20T10:17:28.825+10:00 Identified requested resource as a file
2017-04-20T10:17:28.825+10:00 Requested resource is an ordinary artifact - using normal content handle with length '3751'
2017-04-20T10:17:28.825+10:00 Executing any BeforeDownload user plugins that may exist
2017-04-20T10:17:28.825+10:00 Responding with selected content handle
2017-04-20T10:17:28.825+10:00 Request succeeded

编辑:我注意到在存储库上配置了同步属性。禁用该选项后,跟踪输出现在如下所示。好像缓存的 repomd 文件的时间戳,和远程是一样的,但是文件内容不同(mirror.centos.org 中的修订号是 1463896289,但在 Artifactory 中显示为 1490724196)。

Request ID: a4f6fc65
Repo Path ID: org.centos.mirror:6/os/x86_64/repodata/repomd.xml
Method Name: GET
User: fowliena
Time: 2017-04-20T10:56:03.880+10:00
Thread: http-nio-9081-exec-133
Steps: 
2017-04-20T10:56:03.880+10:00 Received request
2017-04-20T10:56:03.880+10:00 Request source = x.x.x.x, Last modified = 01-01-70 09:59:59 +10:00, If modified since = -1, Thread name = http-nio-9081-exec-133
2017-04-20T10:56:03.880+10:00 Executing any BeforeDownloadRequest user plugins that may exist
2017-04-20T10:56:03.880+10:00 Retrieving info from {} repository '{}' type 
2017-04-20T10:56:03.912+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:56:03.912+10:00 Returning resource as expired
2017-04-20T10:56:03.912+10:00 Executing any AltRemotePath user plugins that may exist
2017-04-20T10:56:03.912+10:00 Appending matrix params to remote request URL
2017-04-20T10:56:03.912+10:00 Using remote request URL - http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml
2017-04-20T10:56:03.912+10:00 Executing HEAD request to http://mirror.centos.org/centos/6/os/x86_64/repodata/repomd.xml
2017-04-20T10:56:03.943+10:00 Found remote resource with last modified time - Wed Mar 29 05:05:42 AEDT 2017
2017-04-20T10:56:03.943+10:00 Found remote resource with ETag - "ea5-54bce4edce980"
2017-04-20T10:56:03.943+10:00 Found remote resource with content length - 3749
2017-04-20T10:56:03.943+10:00 Returning found remote resource info
2017-04-20T10:56:03.943+10:00 Requested resource is found = true
2017-04-20T10:56:03.943+10:00 Request is HEAD = false
2017-04-20T10:56:03.943+10:00 Request is for a checksum = false
2017-04-20T10:56:03.943+10:00 Target repository is not remote or doesn't store locally = false
2017-04-20T10:56:03.943+10:00 Requested resource was not modified = false
2017-04-20T10:56:03.943+10:00 Responding with found resource
2017-04-20T10:56:03.943+10:00 Executing any AltResponse user plugins that may exist
2017-04-20T10:56:03.943+10:00 Alternative response status is set to -1 and message to 'null'
2017-04-20T10:56:03.943+10:00 Found no alternative content handles
2017-04-20T10:56:03.943+10:00 Retrieving a content handle from target repo
2017-04-20T10:56:03.943+10:00 The requested resource isn't pre-resolved
2017-04-20T10:56:03.943+10:00 Target repository isn't virtual - verifying that downloading is allowed
2017-04-20T10:56:03.943+10:00 Creating a resource handle from 'org.centos.mirror'
2017-04-20T10:56:03.943+10:00 Target repository is configured to retain artifacts locally - resource will be stored and the streamed to the user
2017-04-20T10:56:03.943+10:00 Remote repository is online
2017-04-20T10:56:03.974+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:56:03.974+10:00 Returning resource as expired
2017-04-20T10:56:03.974+10:00 Found expired cached resource but remote is newer = false. Cached resource: 1490724342000, Remote resource: 1490724342000
2017-04-20T10:56:03.974+10:00 Force expiration on the cached resource = false
2017-04-20T10:56:03.974+10:00 Resource isn't cached and isn't expired = false
2017-04-20T10:56:03.974+10:00 Found expired cached resource and is newer than remote = true
2017-04-20T10:56:03.974+10:00 Remote property synchronization is disabled - expired resource property synchronization not attempted
2017-04-20T10:56:03.974+10:00 Un-expiring cached resource if needed
2017-04-20T10:56:03.974+10:00 Is resource metadata = false
2017-04-20T10:56:03.974+10:00 Un-expiring the resource
2017-04-20T10:56:04.005+10:00 Found the resource in the cache - checking for expiry
2017-04-20T10:56:04.005+10:00 Found request parameter {}=artifactory.forceDownloadIfNewer
2017-04-20T10:56:04.005+10:00 Returning cached resource
2017-04-20T10:56:04.021+10:00 Removing the resource from all failed caches
2017-04-20T10:56:04.021+10:00 Returning the cached resource
2017-04-20T10:56:04.021+10:00 Creating a resource handle from 'org.centos.mirror-cache:6/os/x86_64/repodata/repomd.xml'
2017-04-20T10:56:04.021+10:00 Identified requested resource as a file
2017-04-20T10:56:04.021+10:00 Requested resource is an ordinary artifact - using normal content handle with length '3751'
2017-04-20T10:56:04.021+10:00 Executing any BeforeDownload user plugins that may exist
2017-04-20T10:56:04.021+10:00 Responding with selected content handle
2017-04-20T10:56:04.021+10:00 Request succeeded

【讨论】:

猜你喜欢
  • 2011-07-03
  • 2017-07-02
  • 2018-09-13
  • 1970-01-01
  • 1970-01-01
  • 2017-11-14
  • 2015-09-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多