You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What command was run? python cloudmapper.py report --account my_account
Are you working out of a virtualenv environment, Docker, or something else? virtualenv, Linux
I did get a number of errors during collect: s3.get_bucket_({'Bucket': 'bucket-name'}): An error occurred (AccessDenied) when calling the GetBucket operation: Access Denied
$ python cloudmapper.py report --account my_account
* Getting resource counts
Traceback (most recent call last):
File "cloudmapper.py", line 72, in <module>
main()
File "cloudmapper.py", line 66, in main
commands[command].run(arguments)
File "/home/john.milton/src/github.com/duo-labs/cloudmapper/commands/report.py", line 471, in run
report(accounts, config, args)
File "/home/john.milton/src/github.com/duo-labs/cloudmapper/commands/report.py", line 100, in report
account_stats[account["name"]] = get_account_stats(
File "/home/john.milton/src/github.com/duo-labs/cloudmapper/shared/common.py", line 278, in get_account_stats
bucket_region = get_parameter_file(
TypeError: 'NoneType' object is not subscriptable
wrapping a try/except around it got around this error:
diff --git a/shared/common.py b/shared/common.py
index e1a3708..5b711e6 100644
--- a/shared/common.py
+++ b/shared/common.py
@@ -275,10 +275,12 @@ def get_account_stats(account, all_resources=False):
)
for bucket in buckets:
# Get the bucket's location
- bucket_region = get_parameter_file(
- region, "s3", "get-bucket-location", bucket
- )["LocationConstraint"]
-
+ try:
+ bucket_region = get_parameter_file(
+ region, "s3", "get-bucket-location", bucket
+ )["LocationConstraint"]
+ except TypeError:
+ bucket_region=None
# Convert the value to a name.
# See https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
if bucket_region is None:
The text was updated successfully, but these errors were encountered:
Hello @miltieIV2 !
Can you try running it again without getting those AccessDenied errors that you mention above?
So we can see if the TypeError is caused due to that?
Thank you!
Hello again @miltieIV2 !
I've been reviewing some issues and found a similar issue to yours.
Start with #422 and read the linked issues, could it be that you were running an old version of Cloudmapper or an old version of boto3/botocore ?
Can you try the same but reinstalling Cloudmapper again form scratch?
Thank you!
Please mention the following:
I did get a number of errors during collect: s3.get_bucket_({'Bucket': 'bucket-name'}): An error occurred (AccessDenied) when calling the GetBucket operation: Access Denied
wrapping a try/except around it got around this error:
The text was updated successfully, but these errors were encountered: