Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
626 views
in Technique[技术] by (71.8m points)

node.js - Terraform v0.14.5 Setup failed: failed unpacking terraform config: failed to uncompress slug: gzip: invalid header

I am trying to send PUT request (example at page) using AXIOS.

AXIOS gives me error, but I can successfully execute the command using curl as mentioned below

curl 
  --header "Content-Type: application/octet-stream" 
  --request PUT 
  --data-binary @filename 
  https://archivist.terraform.io/v1/object/4c44d964-eba7-4dd5-ad29-1ece7b99e8da

This is the Error as given by PUT request with AXIOS

Terraform v0.14.5

Setup failed: failed unpacking terraform config: failed to uncompress slug: gzip: invalid header

My AXIOS code is to upload the file is written below:

        res = await axios.put(UPLOAD_URL, { data: fs.readFileSync(UPLOAD_FILE_NAME) }, {
            headers: {
                "Content-Type": "application/octet-stream"
            }
        });
        if (!(res.status == 201 || res.status==200)) {
            console.log("Response header is not 201
", res);
            return false;
        }
        console.log("Configuration version uploaded ...");
    } catch (err) {
        console.log("Unable to upload the configuration version data file");
        console.log(err.message);
        return false;
    }```

Thank you for the time!!!
question from:https://stackoverflow.com/questions/65854138/terraform-v0-14-5-setup-failed-failed-unpacking-terraform-config-failed-to-unc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...