Vonng / pigsty

Battery-Included PostgreSQL Distro as a Free RDS Alternative
https://pigsty.io
GNU Affero General Public License v3.0
3.01k stars 242 forks source link

Bootstrap script fails to download cache #353

Closed jekader closed 7 months ago

jekader commented 7 months ago

The bootstrap script v 2.5.1 produces the following error on an el8 node:

[root@pigsty1 pigsty]# ./bootstrap
bootstrap pigsty v2.5.1 begin
[ OK ] region = default
[ OK ] kernel = Linux
[ OK ] machine = x86_64
[ OK ] package = rpm,dnf
[ OK ] vendor = rocky (Rocky Linux)
[ OK ] version = 8 (8.9)
[ OK ] sudo = root ok
[WARN] cache = /tmp/pkg.tgz exists but invalid
[ IN ] Cache /tmp/pkg.tgz not exists, download? (y/n):
=> y
[ OK ] $ curl https://github.com/Vonng/pigsty/releases/download/v2.5.1/pigsty-pkg-v2.5.1.el8.x86_64.tgz -o /tmp/pkg.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ OK ] repo = extract from /tmp/pkg.tgz
tar: This does not look like a tar archive

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
[ OK ] repo file = add el8.x86_64 default upstream
[ OK ] repo cache = created

Looking at the URL, it produces a 302 redirect which curl is not following. To fix that, adding -L to the curl command is needed in the download_file function of the bootstrap script.

Vonng commented 7 months ago

That do make sense, will be added in the next release

Vonng commented 7 months ago

https://github.com/Vonng/pigsty/commit/8498bb1aade4683d9fbb578d89747cfb88a80685