Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wget 请求被识别为移动设备,报403: Forbidden #1353

Closed
ChengbingLiu opened this issue Oct 13, 2021 · 2 comments
Closed

wget 请求被识别为移动设备,报403: Forbidden #1353

ChengbingLiu opened this issue Oct 13, 2021 · 2 comments

Comments

@ChengbingLiu
Copy link

发生了什么(What happened)

通过yum install jenkins被重定向到tuna的mirror,但报403错误。

经排查,wget直接下载也会报403:
# wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm
--2021-10-13 14:06:11--  https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2021-10-13 14:06:11 ERROR 403: Forbidden.

打开debug日志,发现原因是被识别为移动设备:

# wget --debug https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm
DEBUG output created by Wget 1.14 on linux-gnu.

URI encoding = ‘UTF-8’
Converted file name 'jenkins-2.303.2-1.1.noarch.rpm' (UTF-8) -> 'jenkins-2.303.2-1.1.noarch.rpm' (UTF-8)
Converted file name 'jenkins-2.303.2-1.1.noarch.rpm' (UTF-8) -> 'jenkins-2.303.2-1.1.noarch.rpm' (UTF-8)
--2021-10-13 14:07:20--  https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.15.130, 2402:f000:1:400::2
Caching mirrors.tuna.tsinghua.edu.cn => 101.6.15.130 2402:f000:1:400::2
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.15.130|:443... connected.
Created socket 3.
Releasing 0x0000000000a5c540 (new refcount 1).
Initiating SSL handshake.
Handshake successful; connected socket 3 to SSL handle 0x0000000000a81820
certificate:
  subject: /CN=tuna.tsinghua.edu.cn
  issuer:  /C=US/O=Let's Encrypt/CN=R3
X509 certificate successfully verified and matches host mirrors.tuna.tsinghua.edu.cn

---request begin---
GET /jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm HTTP/1.1
User-Agent: Wget/1.14 (linux-gnu)
Accept: */*
Host: mirrors.tuna.tsinghua.edu.cn
Connection: Keep-Alive

---request end---
HTTP request sent, awaiting response... 
---response begin---
HTTP/1.1 403 Forbidden
Server: nginx/1.18.0
Date: Wed, 13 Oct 2021 06:07:20 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
X-TUNA-MIRROR-ID: nanomirrors

---response end---
403 Forbidden
Registered socket 3 for persistent reuse.
Skipping 512 bytes of body: [<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>清华大学 TUNA 镜像站</title>
    <link href="//cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <style> body { padding-top: 40px; } </style>
  </head>
  <body>
    <div class="container">
      <div class="well">
        <p lang="zh-cn">尊敬的访问者,</p>
		<Skipping 512 bytes of body: [p lang="en">Dear visitor, </p>
		<p lang="fr">Chère cliente, </p>
		<p lang="ja">訪問者へ 、</p>
		<p>&nbsp;</p>
        <p lang="zh-cn">您好!</p>
		<p lang="en">Hello! </p>
		<p lang="fr">Bonjour! </p>
		<p lang="ja">こんにちは !</p>
		<p>&nbsp;</p>
        <p lang="zh-cn">我们检测到您正在使用移动设备下载镜像站上较大的二进制文件,为防止消耗过多流量,我们建议您改用计算机下载。</p>
		<p lang="en">Your attempt to download a large binary fileSkipping 512 bytes of body: [ from a mobile device has been detected. To avoid excessive consumption of data transfer, you are recommended to download it from a computer. </p>
		<p lang="fr">Une tentative de téléchargement d'un fichier binaire de grande taille depuis un appareil mobile a été détectée. Afin d'éviter une consommation excessive de données mobile, nous vous conseillons de recommencer cette action à partir d'un ordinateur. </p>
		<p lang="ja">容量の大きいバイナリファイルが今モバイルデバイス⒫ipping 512 bytes of body: [«転送しようとしております、大量のトラフィックが発生するため、コンピュータからのダウンロードをお勧めします。</p>
		<p>&nbsp;</p>
		<p lang="zh-cn">如有疑问,请联系 <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a> 。</p>
		<p lang="en">If there are any possible questions, please contact <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>. </p>
		<p lang="fr">Pour plus d'informations, veuilleSkipping 395 bytes of body: [z contacter <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>. </p>
		<p lang="ja">なおご質問などありましたら、<a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>までご連絡してください。</p>
		<p>&nbsp;</p>
		<p><code>00000078 2043ae5371a6740e7189c4adbf2b77bc</code></p>
      </div>
    </div>
  </body>
</html>
] done.
2021-10-13 14:07:20 ERROR 403: Forbidden.

期望的现象(What you expected to happen)

yum和wget都能正常下载

如何重现(How to reproduce it)

wget https://mirrors.tuna.tsinghua.edu.cn/jenkins/redhat-stable/jenkins-2.303.2-1.1.noarch.rpm

其他事项(Anything else we need to know)

您的环境(Environment)

  • 操作系统(OS Version):CentOS 7.6
  • 浏览器(如果适用)(Browser version, if applicable):yum / wget
  • 其他(Others):
@shankerwangmiao
Copy link
Member

您所在的 IP 地址段因此前大量下载镜像站上的内容,消耗过多带宽而被列入关注列表。

@ChengbingLiu
Copy link
Author

了解了,这个报错信息希望能改进一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants