termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.08k stars 3k forks source link

packages.termux.dev has issues #11007

Closed Grimler91 closed 2 years ago

Grimler91 commented 2 years ago

Discussed in https://github.com/termux/termux-packages/discussions/10976

Originally posted by **buttaface** June 13, 2022 It redirects to packages.termux.dev which is down. Is this planned? packages-cf.termux.dev still works.
Grimler91 commented 2 years ago

It's a problem with fosshost's ipv6 -> ipv4 proxy, similar to https://github.com/termux/termux-app/issues/2650. Has been reported to fosshost's support, but haven't heard back yet

2096779623 commented 2 years ago
C:\Users\Administrator>nslookup packages.termux.org
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  fe80::1

non-authoritative answer:
Name:    packages.termux.org
Addresses:  2606:4700:3030::6815:1491
          2606:4700:3030::ac43:c121
          172.67.193.33
          104.21.20.145

C:\Users\Administrator>nslookup -type=ns packages.termux.org
DNS request timed out.
    timeout was 2 seconds.
Server:  UnKnown
Address:  fe80::1

termux.org
        primary name server = clark.ns.cloudflare.com
        responsible mail addr = dns.cloudflare.com
        serial  = 2280631813
        refresh = 10000 (2 hours 46 mins 40 secs)
        retry   = 2400 (40 mins)
        expire  = 604800 (7 days)
        default TTL = 3600 (1 hour)

In China it redirects normally to packages.termux.dev.

When I manually resolve to fosshost's IP (via hosts) it also jumps fine.

I tested all IPs of #2650 and it works fine.

Grimler91 commented 2 years ago

@2096779623 yeah you are right, issue is only with packages.termux.dev (after we enabled proxy'ing by cloudflare for packages.termux.org)

fosshost's proxy has 5 IP addresses, 216.18.208.170 - 216.18.208.174 (see dig packages.termux.dev). For 171 and 172 connection fails, while for the other ones it works fine:

$ curl --resolve "packages.termux.dev:80:216.18.208.171"  http://packages.termux.dev
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty/1.19.9.1</center>
</body>
</html>
$ curl --resolve "packages.termux.dev:80:216.18.208.170"  http://packages.termux.dev
# success
Grimler91 commented 2 years ago

packages.termux.org, packages-cf.termux.org and packages-cf.termux.dev all goes through cloudflares proxy and works, while packages.termux.dev goes straight to fosshost which fails if you are unlucky and it resolves to 216.18.208.171 or 216.18.208.172

2096779623 commented 2 years ago

@2096779623 yeah you are right, issue is only with packages.termux.dev (after we enabled proxy'ing by cloudflare I believe)

fosshost's proxy has 5 IP addresses, 216.18.208.170 - 216.18.208.174 (see dig packages.termux.dev). For 171 and 172 connection fails, while for the other ones it works fine:

$ curl --resolve "packages.termux.dev:80:216.18.208.171"  http://packages.termux.dev
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty/1.19.9.1</center>
</body>
</html>
$ curl --resolve "packages.termux.dev:80:216.18.208.170"  http://packages.termux.dev
# success

In fact, all four IPs(216.18.208.170 - 216.18.208.174) have issues.

I tested packages.termux.dev using some site for website speed testing and found that some regions HTTP status code is 500, as you said.

Failed IP List:

  1. 216.18.208.172
    • Chengdu,Sichuan,China
    • Taiyuan,Shanxi,China
    • Shiyan,Hubei,China
    • Dalian,Niaoning,China
    • Baoding,Hebei,China
    • Chengdu,Sichuan,China
    • Shanghai,China
    • Zhenzhou,Henan,China
  2. 216.18.208.171
    • Suqian,Jiangsu,China
    • Hohhot,Inner
    • Mongolia,China
    • Moldova
  3. 216.18.208.173
    • Xian,Shanxi,China
    • Changsha,Hunan,China
    • XinXiang,Henan,China
    • Beijing,China
    • LA,America
    • Frankfurt(AWS), Germany
    • Malaysia
    • Seoul, Korea
    • Turkey
      1. 216.18.208.170
    • Jingyang,Sichuan,China
    • Urumqi,Xinjiang,China
  4. 216.18.208.174
    • Shanghai,China
    • Hangzhou,Zhejiang,China
    • Hefei,Anhui,China
    • Shenzhen(Aliyun),China
    • Mumbai, India
agnostic-apollo commented 2 years ago

Have pushed 3b76d37 and a3e68e2 to try to fix package upload issue.

Grimler91 commented 2 years ago

Should probably revert my attempt to fix it then ;)

agnostic-apollo commented 2 years ago

I am probably starting to go blind I guess ;)

Grimler91 commented 2 years ago

Ooor I should communicate more :)

agnostic-apollo commented 2 years ago

Lolz.

Why did you revert bc9834df in d090e2139 instead of 1615ccc8?

Grimler91 commented 2 years ago

Yeah, good question. git log'ed .github/ to find my previous commit, instead of scripts/. I need glasses I guess

agnostic-apollo commented 2 years ago

Ah, thanks for fixing.

I need glasses I guess

Well, they didn't help me ;)

Dawimpy commented 2 years ago

@2096779623 yeah you are right, issue is only with packages.termux.dev (after we enabled proxy'ing by cloudflare I believe) fosshost's proxy has 5 IP addresses, 216.18.208.170 - 216.18.208.174 (see dig packages.termux.dev). For 171 and 172 connection fails, while for the other ones it works fine:

$ curl --resolve "packages.termux.dev:80:216.18.208.171"  http://packages.termux.dev
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>openresty/1.19.9.1</center>
</body>
</html>
$ curl --resolve "packages.termux.dev:80:216.18.208.170"  http://packages.termux.dev
# success

In fact, all four IPs(216.18.208.170 - 216.18.208.174) have issues.

I tested packages.termux.dev using some site for website speed testing and found that some regions HTTP status code is 500, as you said.

Failed IP List:

  1. 216.18.208.172

    • Chengdu,Sichuan,China
    • Taiyuan,Shanxi,China
    • Shiyan,Hubei,China
    • Dalian,Niaoning,China
    • Baoding,Hebei,China
    • Chengdu,Sichuan,China
    • Shanghai,China
    • Zhenzhou,Henan,China
  2. 216.18.208.171

    • Suqian,Jiangsu,China
    • Hohhot,Inner
    • Mongolia,China
    • Moldova
  3. 216.18.208.173

    • Xian,Shanxi,China
    • Changsha,Hunan,China
    • XinXiang,Henan,China
    • Beijing,China
    • LA,America
    • Frankfurt(AWS), Germany
    • Malaysia
    • Seoul, Korea
    • Turkey
  4. 216.18.208.170

    • Jingyang,Sichuan,China
    • Urumqi,Xinjiang,China
  5. 216.18.208.174

    • Shanghai,China
    • Hangzhou,Zhejiang,China
    • Hefei,Anhui,China
    • Shenzhen(Aliyun),China
    • Mumbai, India
  • List may not be complete.

Hello, I'm actually a Malaysian. 216.18.208.171 can't load for me while port 173 got no problem

2096779623 commented 2 years ago

Maybe you're lucky! But the speed test website gives different results: image

Dawimpy commented 2 years ago

I using curl... But when I use chrome, none of all working... :(

Dawimpy commented 2 years ago

Maybe you're lucky! But the speed test website gives different results: image

By the way, what tool is it? Want to check it out

2096779623 commented 2 years ago

Maybe you're lucky! But the speed test website gives different results: image

By the way, what tool is it? Want to check it out

https://www.itdog.cn/http/

This website is in Chinese and needs translation.

Dawimpy commented 2 years ago

Screenshot_2022_0619_151103 216.18.208.171 is dead...

2096779623 commented 2 years ago

Screenshot_2022_0619_151103 216.18.208.171 is dead...

Maybe it's all dead..

Dawimpy commented 2 years ago

Screenshot_2022_0619_151103 216.18.208.171 is dead...

Maybe it's all dead..

Yes, it's true...

sad noises

2096779623 commented 2 years ago

@Grimler91 All package upload failed now:

Checking packages.termux.dev ip access
success: 216.18.208.1[72](https://github.com/termux/termux-packages/runs/6972289827?check_suite_focus=true#step:4:73)
[18:20:45]: Failed to upload 'debs/cloudflared_2022.6.3_aarch64.deb'. Server/proxy dropped connection during upload.
[18:20:45]: Aborting any further uploads to this repo.
[18:20:45] Deleting uploads temporary directory...
[18:20:45] Warning: server returned 000 code while deleting temporary directory.
Error: Process completed with exit code 1.
Grimler91 commented 2 years ago

Yeah, it fails occasionally, re-running the failed job usually works

peerau commented 2 years ago

This should be resolved on fosshost's side.

agnostic-apollo commented 2 years ago

@peerau Thanks a lot. Seems to be working fine now. I assume it was ngninx map hash table size issue as per fosshostorg/aarch64@5017bab5 and fosshostorg/aarch64@9eea9541?

http://nginx.org/en/docs/http/ngx_http_map_module.html http://nginx.org/en/docs/stream/ngx_stream_map_module.html http://nginx.org/en/docs/hash.html

REPOSITORY_URL="https://packages.termux.dev"
REPOSITORY_DOMAIN="$(echo "$REPOSITORY_URL" | cut -d'/' -f3)"
for ip in $(dig -t a +short "$REPOSITORY_DOMAIN" | sed '1d'); do
    if [ $(curl -s -o /dev/null -w "%{http_code}" --resolve "$REPOSITORY_DOMAIN:80:$ip" "http://$REPOSITORY_DOMAIN") = "200" ]; then
        echo "success: $ip"
    else
        echo "failed: $ip" 
    fi
done
success: 216.18.208.171
success: 216.18.208.172
success: 216.18.208.174
success: 216.18.208.173
success: 216.18.208.170
peerau commented 2 years ago

Correct - apologies are in order, I have been sick the past few weeks and wasn't able to push it :(

agnostic-apollo commented 2 years ago

No apologies necessary, health should be a priority. Hopefully, you are better now :)

Grimler91 commented 2 years ago

Great, thanks @peerau! Works in my tests as well, so I think we can close this