Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring a file dies with this message #10

Closed
tk422 opened this issue Feb 26, 2013 · 11 comments
Closed

Restoring a file dies with this message #10

tk422 opened this issue Feb 26, 2013 · 11 comments
Labels

Comments

@tk422
Copy link

tk422 commented Feb 26, 2013

Hey again,

Went to test the restore of a tar.gz file,now using a long name without the double tar.gz. Can you actually add a period back after the last part of the filename that way the date code doesnt get jumbled together.

Here is what I get:

2013-02-26 16:33:13,182 INFO: Restoring gridlock.XXXX.org.23420130221100557.tgz.enc <*_**-- note the 234 is the last part of the file name and would like that separate from the date
Password:
2013-02-26 16:33:43,045 INFO: Downloading...
Traceback (most recent call last):
File "/usr/local/bin/bakthat", line 9, in
load_entry_point('bakthat==0.3.7', 'console_scripts', 'bakthat')()
File "/usr/local/bin/bakthat.py", line 598, in main
app.run()
File "/usr/local/lib/python2.6/dist-packages/aaargh.py", line 157, in run
return func(__kwargs)
File "/usr/local/bin/bakthat.py", line 506, in restore
out = storage_backend.download(key_name, *_download_kwargs)
File "/usr/local/bin/bakthat.py", line 267, in download
job = self.vault.retrieve_archive(archive_id)
File "/usr/local/lib/python2.6/dist-packages/boto/glacier/vault.py", line 293, in retrieve_archive
response = self.layer1.initiate_job(self.name, job_data)
File "/usr/local/lib/python2.6/dist-packages/boto/glacier/layer1.py", line 351, in initiate_job
response_headers=response_headers)
File "/usr/local/lib/python2.6/dist-packages/boto/glacier/layer1.py", line 84, in make_request
raise UnexpectedHTTPResponseError(ok_responses, response)
boto.glacier.exceptions.UnexpectedHTTPResponseError: Expected 202, got (400, code=InvalidParameterValueException, message=Invalid vault name: arn:aws:glacier:us-east-1:917509789911:vaults/backups-east)

@tk422
Copy link
Author

tk422 commented Feb 26, 2013

looking into this further it looks like calling via a python module does not honor the glacier vault (hence the error about finding the file). Here is what I have in the upload script and (I just checked none of them are uploaded to the vault but instead are uploaded to "None")

vaultname = "backups-east"

aws_conf = {"access_key":ACCESS_KEY_ID, "secret_key":SECRET_ACCESS_KEY, "bucket": "", "vault": vaultname, "password":encpassword}

for each in os.listdir(bakfolder):
for files in os.listdir(os.path.join(bakfolder,each)):
if files[-3:] != ".gz":
pass
else:
bakthat.backup(os.path.join(bakfolder,each,files), conf=aws_conf, destination="glacier", password=encpassword, prompt="no")

@tsileo
Copy link
Owner

tsileo commented Feb 27, 2013

First, I totally agree with the dot before the date, I'll make the change quickly,

About your fist issue, the error says: Invalid vault name, I think you shouldn't have a dash in your vault name (backups-east), it's a boto/AWS related issue I think.

Now about the bakthat module call, I use bakthat in Python scripts to make daily backups to glacier on few servers, and I never had any issue:

  • first, the prompt argument is useless when calling bakthat from Python (either password="" to disable password, either a valid password)
  • next, if you already have a configuration file, you don't have to pass the conf argument, and when passing it, I suggest you to set a S3 bucket just to backup your local inventory glacier (if something goes wrong you don't have to wait 4-5 hours just to retrieve your inventory.)

Can you try without the conf (if you have a ~/.bakthat.conf) and promp argument, and show me the logs output, to check bakthat logs when using a Python script, just add these line at the top of your file:

import logging
log = logging.getLogger()
log.setLevel(logging.INFO)

Also, I'll rewrite the doc for both command line and python module usage, with backups scripts example.

Keep me updated, thanks for your feedback !

@tsileo
Copy link
Owner

tsileo commented Feb 27, 2013

I made the change on github to add a dot betwen the backup name and the date component, I have not pushed the change on pypi yet.

@tk422
Copy link
Author

tk422 commented Feb 27, 2013

Okay let me play around with it later today. I know that when I backup and restore from the command line (taking the configuration from .bakthat.cfg file) it works fine with the dash in the glacier name. But let me try a couple of things and see if I can pinpoint the breakdown some more.

@tk422
Copy link
Author

tk422 commented Feb 27, 2013

Okay when I call it via python module as shown above it doesnt work it errors out with the same error seen above. But when I do it via the commandline it correctly uploads it to the vault backups-east. So there might be something with the dash in the name when called via the module. Thats my current guess anyway. I'll look more into it.

@tk422
Copy link
Author

tk422 commented Feb 28, 2013

Tested it a few more times. It does look like its not properly uploading to a vault with a dash in it when using the module. But seems to work on the commandline.

@tk422
Copy link
Author

tk422 commented Mar 4, 2013

Any thoughts on this? I have been moving so havent been able to look at the code.

@tsileo
Copy link
Owner

tsileo commented Mar 4, 2013

It seems to be a boto related issue, so I will investigate more when bakthat 0.4.0 will be released and post an issue on boto repository if needed, I will keep you updated.

I making big changes on bakthat right now (not updated on pypi yet) with version 0.4.0 release coming soon and I would love to hear your feedback.

@tsileo tsileo closed this as completed Mar 18, 2013
@vsespb
Copy link

vsespb commented Apr 27, 2013

FYI Similar issue vsespb/mt-aws-glacier#32 https://forums.aws.amazon.com/thread.jspa?threadID=123076&tstart=0

Also I was unable to receive error message "Invalid vault name" in the wild - message is not thrown when vault name is really not valid.

Instead:

  1. When not found:
{"code":"ResourceNotFoundException","message":"Vault not found for ARN: arn:aws:glacier:us-east-1:XXXXXXXX:vaults/test1zz","type":"Client"}
  1. When name contains invalid characters:
{"code":"ResourceNotFoundException","message":"Vault not found for ARN: testz:z","type":"Client"}
  1. When permission problem: AccessDeniedException

@vsespb
Copy link

vsespb commented Apr 29, 2013

FYI it turns out that Invalid vault name means that this archive_id belongs to different vault https://forums.aws.amazon.com/thread.jspa?threadID=123076&tstart=0

@tsileo
Copy link
Owner

tsileo commented Apr 29, 2013

Thanks for the follow up, I'll try to update bakthat accordingly !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants