Summary: | fetch(1) not able to fetch file | ||
---|---|---|---|
Product: | Base System | Reporter: | Slawomir Wojciech Wojtczak <vermaden> |
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed Not A Bug | ||
Severity: | Affects Many People | CC: | andrew, fernape, thj |
Priority: | --- | ||
Version: | 12.2-RELEASE | ||
Hardware: | Any | ||
OS: | Any |
Description
Slawomir Wojciech Wojtczak
2020-11-17 13:32:21 UTC
Was this maybe a temporay issue with github? I cannot reproduce on 12.1, 12-stable or 13-current and someone on irc couldn't on 12.2-stable or 11.4-stable I can not reproduce in a 12.2 machine: fernape@12:~ $ uname -a FreeBSD 12.2amd64 12.2-RELEASE FreeBSD 12.2-RELEASE r367095 GENERIC amd64 fernape@12:~ $ fetch -v https://github.com/amir/sctd/archive/0.2.0.tar.gz resolving server address: github.com:443 SSL options: 82004854 Peer verification enabled Using CA cert file: /usr/local/etc/ssl/cert.pem Verify hostname TLSv1.3 connection established using TLS_AES_128_GCM_SHA256 Certificate subject: /C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com Certificate issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA requesting https://github.com/amir/sctd/archive/0.2.0.tar.gz 302 redirect to https://codeload.github.com/amir/sctd/tar.gz/0.2.0 resolving server address: codeload.github.com:443 SSL options: 82004854 Peer verification enabled Using CA cert file: /usr/local/etc/ssl/cert.pem Verify hostname TLSv1.3 connection established using TLS_AES_128_GCM_SHA256 Certificate subject: /C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=*.github.com Certificate issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA requesting https://codeload.github.com/amir/sctd/tar.gz/0.2.0 remote size / mtime: 8629 / 0 0.2.0.tar.gz 8629 B 31 MBps 00s Just tried again, same results: % fetch https://github.com/amir/sctd/archive/0.2.0.tar.gz fetch: https://github.com/amir/sctd/archive/0.2.0.tar.gz: Moved Temporarily % uname -a FreeBSD w520.local 12.2-RELEASE FreeBSD 12.2-RELEASE r366954 GENERIC amd64 % freebsd-version -u 12.2-RELEASE % freebsd-version -k 12.2-RELEASE % host github.com github.com has address 140.82.121.3 github.com mail is handled by 1 aspmx.l.google.com. github.com mail is handled by 10 alt3.aspmx.l.google.com. github.com mail is handled by 10 alt4.aspmx.l.google.com. github.com mail is handled by 5 alt1.aspmx.l.google.com. github.com mail is handled by 5 alt2.aspmx.l.google.com. % dog !$ dog github.com A github.com. 54s 140.82.121.3 Its just that fetch(1) has a problem with HTTP 302 redirection. When you see the wget(1) output then after redirection it is downloaded from https://codeload.github.com/amir/sctd/tar.gz/0.2.0 location and this one works even with fetch(1). % fetch https://codeload.github.com/amir/sctd/tar.gz/0.2.0 fetch: https://codeload.github.com/amir/sctd/tar.gz/0.2.0: size of remote file is not known 0.2.0 8629 B 10 MBps 00s % ls -l 0.2.0 0.2.0.tar.gz -rw-r--r-- 1 vermaden vermaden 8629 2020-11-17 17:49 0.2.0 -rw-r--r-- 1 vermaden vermaden 8629 2020-11-17 14:31 0.2.0.tar.gz % file 0.2.0 0.2.0.tar.gz 0.2.0: gzip compressed data, from Unix, original size modulo 2^32 40960 0.2.0.tar.gz: gzip compressed data, from Unix, original size modulo 2^32 40960 (In reply to vermaden from comment #3) In my execution fetch is accepting 302 fine. Could you run fetch -v and see where your output and mine differ? (In reply to Fernando Apesteguía from comment #4) Here: % fetch -v https://github.com/amir/sctd/archive/0.2.0.tar.gz resolving server address: github.com:443 SSL options: 82004854 TLSv1.3 connection established using TLS_AES_128_GCM_SHA256 Certificate subject: /C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com Certificate issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA requesting https://github.com/amir/sctd/archive/0.2.0.tar.gz fetch: https://github.com/amir/sctd/archive/0.2.0.tar.gz: Moved Temporarily (In reply to vermaden from comment #5) ... Peer verification enabled Using CA cert file: /usr/local/etc/ssl/cert.pem Verify hostname ... Someone at IRC suggested using --no-verify-peer. Also not reproducible here unless I add the -A/--no-redirect option. (In reply to vermaden from comment #5) (I am the "someone on IRC" previously mentioned) As far as I can tell, it's impossible to get this verbose output: > requesting https://github.com/amir/sctd/archive/0.2.0.tar.gz > fetch: https://github.com/amir/sctd/archive/0.2.0.tar.gz: Moved Temporarily unless the -A flag is somehow becoming set in libfetch. Without that flag, that code path would always lead through code that outputs this: > 302 redirect to https://codeload.github.com/amir/sctd/tar.gz/0.2.0 What if you run it in a clean environment with env -i? I am sorry. I had an alias for fetch with -A ... % which fetch fetch: aliased to fetch -ApRr --no-verify-peer --no-verify-hostname My bad. Sorry for your lost time. Regards. |