Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Download etcd release package from custom url error #144

Closed
pytimer opened this issue Dec 16, 2019 · 4 comments · Fixed by #145
Closed

Download etcd release package from custom url error #144

pytimer opened this issue Dec 16, 2019 · 4 comments · Fixed by #145

Comments

@pytimer
Copy link
Contributor

pytimer commented Dec 16, 2019

I use the lasted etcdadm to init the cluster, want to use --release-url download etcd release package from my custom url, i save the etcd release package to wrong path, but i see etcdadm also download completed, the error occur to extracting archive package.

error logs:

[root@k8s-1 ~]# etcdadm init --name k8s --release-url http://192.168.10.108/tools/etcd --version 3.3.18 -l debug
INFO[0000] [install] Artifact not found in cache. Trying to fetch from upstream: http://192.168.10.108/tools/etcd
INFO[0000] [install] Downloading & installing etcd http://192.168.10.108/tools/etcd from 3.3.18 to /var/cache/etcdadm/etcd/v3.3.18
INFO[0000] [install] downloading etcd from http://192.168.10.108/tools/etcd/v3.3.18/etcd-v3.3.18-linux-amd64.tar.gz to /var/cache/etcdadm/etcd/v3.3.18/etcd-v3.3.18-linux-amd64.tar.gz
######################################################################## 100.0%
INFO[0000] [install] extracting etcd archive /var/cache/etcdadm/etcd/v3.3.18/etcd-v3.3.18-linux-amd64.tar.gz to /tmp/etcd862140673

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
FATA[0000] [install] Artifact could not be installed from cache: unable to extract etcd archive: exit status 2

Can etcdadm downloading etcd from --release-url show error instead of extract etcd archive if the package not found ?

@dlipovetsky
Copy link
Contributor

Can etcdadm downloading etcd from --release-url show error instead of extract etcd archive if the package not found ?

@pytimer, are you saying that the curl call ignores errors? Because etcdadm should fail if curl reports an error.

@pytimer
Copy link
Contributor Author

pytimer commented Dec 16, 2019

@dlipovetsky Yes.I think etcdadm call curl should not ignore errors, so i add --fail when invoke curl command to download etcd release package.

@dlipovetsky
Copy link
Contributor

@dlipovetsky Yes.I think etcdadm call curl should not ignore errors,

I agree with you. Unfortunately, I couldn't understand the problem from your report, but I see it now; curl will exit with zero if it receives some output with a 404.

$ curl http://google.com/foo 
<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}
  </style>
  <a href=//www.google.com/><span id=logo aria-label=Google></span></a>
  <p><b>404.</b> <ins>That’s an error.</ins>
  <p>The requested URL <code>/foo</code> was not found on this server.  <ins>That’s all we know.</ins>
$ echo $?
0
$ curl --fail http://google.com/foo
curl: (22) The requested URL returned error: 404 Not Found
$ echo $?
22

@pytimer
Copy link
Contributor Author

pytimer commented Dec 20, 2019

If ignore curl error, it mean that download etcd incomplete, it occur tar failed.. Sorry, I didn't explain clearly what I mean.

justinsb added a commit to justinsb/etcdadm that referenced this issue Jul 25, 2020
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 28, 2020
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 29, 2020
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 29, 2020
justinsb added a commit to justinsb/etcdadm that referenced this issue Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants