leeroybrun / glacier-vault-remove

Remove all archives stored inside an Amazon Glacier vault, even if you have a huge number of them.
379 stars 50 forks source link

Wrong format output of get_job_output #29

Closed magrinj closed 5 years ago

magrinj commented 7 years ago

I try to face against something strange, in your code you in the output of "get_job_ouput", the variable "body" should contain a string parsable to Json, but for me if I print this value: job_output['body'].read().decode('utf-8') I got something to csv format, I try to take a look at the boto3 documentation and I don't find any solution to change the output format for the moment :/ I try to use initiate_job function to specify the Format variable to JSON, but I don't understand how this function works... So if anyone got the same problem and can help me :D

rienafairefr commented 7 years ago

I think what happened is that at some point you created an inventory retrieval job that specified the CSV output format. Maybe by error. Then when glacier-vault-remove looks at the jobs, it sees that job and tries to get its output, csv data. To remove that error, you'd have to manually remove that inventory retrieval job

vinyar commented 5 years ago

I had/have the same problem and I validated that my job was in json format.

TLDR I used one of the scripts here: https://gist.github.com/Remiii/507f500b5c4e801e4ddc

vinyar commented 5 years ago

Ok, I did some more experimenting, and here is how I got it to work:

First, you need python 3: sudo apt install python3 sudo apt install python3-setuptools sudo python3 setup.py install

then it worked. Basically, it looks like this script is not compatible with python 2

leeroybrun commented 5 years ago

Closing as this is quite old. Feel free to let us know if that's still an issue.