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

ValueError for missing account_id #178

Closed
lusitania opened this issue Jul 15, 2015 · 1 comment
Closed

ValueError for missing account_id #178

lusitania opened this issue Jul 15, 2015 · 1 comment
Labels
bug This issue is a confirmed bug.

Comments

@lusitania
Copy link

Hi

I was trying to enumerate available Glacier vaults for my account, was following the examples in class Glacier.Account and vaults.all():

import boto3

accountId = '-'  # (1) You can either specify an AWS account ID or optionally a single '-' (hyphen)

glacier = boto3.resource('glacier')
account = glacier.Account(accountId)
vault_iterator = account.vaults.all()

print(list(vault_iterator))
/Src/glacier-archive (master)$ ./test.py 
Traceback (most recent call last):
  File "./test.py", line 19, in <module>
    print(list(allvaults))
  File "/Src/glacier-archive/run/python/lib/python3.4/site-packages/boto3/resources/collection.py", line 82, in __iter__
    for page in self.pages():
  File "/Src/glacier-archive/run/python/lib/python3.4/site-packages/boto3/resources/collection.py", line 167, in pages
    for item in self._handler(self._parent, params, page):
  File "/Src/glacier-archive/run/python/lib/python3.4/site-packages/boto3/resources/response.py", line 240, in __call__
    parent, identifiers, response_item))
  File "/Src/glacier-archive/run/python/lib/python3.4/site-packages/boto3/resources/response.py", line 288, in handle_response_item
    resource = resource_cls(**kwargs)
  File "/Src/glacier-archive/run/python/lib/python3.4/site-packages/boto3/resources/base.py", line 119, in __init__
    'Required parameter {0} not set'.format(identifier))
ValueError: Required parameter account_id not set

I get this error for both my real accountId as well as '-'. However, if I query the vault directly

v101 = glacier.Vault(accountId, vaultname)
print(v101.size_in_bytes)

... I'm getting a proper response. Why? What's wrong?

(1): https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vaults-get.html

@jamesls
Copy link
Member

jamesls commented Jul 17, 2015

This appears to be a bug in our resources implementation in boto3.

@jamesls jamesls added bug This issue is a confirmed bug. confirmed labels Jul 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants