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

Failed to run without the us-east-1 region #24

Closed
robertstettner opened this issue Apr 3, 2020 · 2 comments
Closed

Failed to run without the us-east-1 region #24

robertstettner opened this issue Apr 3, 2020 · 2 comments

Comments

@robertstettner
Copy link

The tool complains that the us-east-1 region is required. Furthermore, after adding it in the config, if there are no account-wide, or org-wide policies, and only certain region policies, barring the us-east-1, because say, we don't use that region, what shall we do?

The error for when the tool tries to run no policies for a region is below:

[2020-04-02 11:26:38,422 INFO] Step custodian in REGION 1 of 4 (us-east-1)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/c7n/config.py", line 25, in __getattr__
    return self[k]
KeyError: 'policy_filters'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/manheim-c7n-runner", line 11, in <module>
    load_entry_point('manheim-c7n-tools', 'console_scripts', 'manheim-c7n-runner')()
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 622, in main
    args.ACTION, args.regions, step_names=args.steps, skip_steps=args.skip
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 484, in run
    self._run_step_in_regions(action, step, regions)
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 539, in _run_step_in_regions
    step(region_name, region_conf).dryrun()
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 267, in dryrun
    run(conf)
  File "/usr/local/lib/python3.7/site-packages/c7n/commands.py", line 117, in _load_policies
    _print_no_policies_warning(options, all_policies)
  File "/usr/local/lib/python3.7/site-packages/c7n/commands.py", line 161, in _print_no_policies_warning
    if options.policy_filters or options.resource_types:
  File "/usr/local/lib/python3.7/site-packages/c7n/config.py", line 27, in __getattr__
    raise AttributeError(k)
AttributeError: policy_filters

The error for the tool complaining it needs the us-east-1 region is:

[2020-04-02 09:22:44,711 INFO] Loading config from: manheim-c7n-tools.yml
Traceback (most recent call last):
  File "/usr/local/bin/manheim-c7n-runner", line 11, in <module>
    load_entry_point('manheim-c7n-tools', 'console_scripts', 'manheim-c7n-runner')()
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 618, in main
    cr = CustodianRunner(args.ACCT_NAME, args.config)
  File "/manheim_c7n_tools/manheim_c7n_tools/runner.py", line 413, in __init__
    self.config = ManheimConfig.from_file(config_path, account_name)
  File "/manheim_c7n_tools/manheim_c7n_tools/config.py", line 146, in from_file
    return ManheimConfig(**acct_conf)
  File "/manheim_c7n_tools/manheim_c7n_tools/config.py", line 122, in __init__
    'ERROR: the first configured region must be us-east-1'
RuntimeError: ERROR: the first configured region must be us-east-1
@jantman
Copy link
Contributor

jantman commented Apr 3, 2020

Hmm... so I don't doubt that this is true, and a valid bug. However it's also likely never going to impact us here at Manheim, for various reasons (including that we run c7n in a minimum set of regions in every account, regardless of whether the regions are actually "in use" in that account or not).

I can't make any promises about when this will get fixed. I'll do my best to address it next time I do some major work on this project. Aside from that, pull requests are always welcome.

@jantman jantman mentioned this issue Apr 6, 2020
@jantman jantman closed this as completed in c71ee11 Apr 6, 2020
@jantman
Copy link
Contributor

jantman commented Apr 6, 2020

This has been released in 0.8.5, which should be published shortly. Thanks so much for reporting it!

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

No branches or pull requests

2 participants