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

.cache folder is not created during first run #16

Closed
fdosani opened this issue Apr 23, 2016 · 1 comment
Closed

.cache folder is not created during first run #16

fdosani opened this issue Apr 23, 2016 · 1 comment

Comments

@fdosani
Copy link
Contributor

fdosani commented Apr 23, 2016

This might not be a bug but just hoping to confirm.

Recreated with the following steps:

  • I'm running on a freshly installed macbook as an FYI.
  • Installed cloud-custodian
  • I signed up for a new AWS account
  • setup credentials via IAM user/role
  • Ran an off hours policy on a empty account (which should return nothing)

I got the following error:

(cloud-custodian)➜  cc_policy custodian run --dryrun -c test.yaml -s out
2016-04-23 11:59:07,529: custodian.output:INFO Storing output with <DirectoryOutput to dir:out/offhour-stop-19>
2016-04-23 11:59:07,529: custodian.policy:INFO Running policy offhour-stop-19
2016-04-23 11:59:07,530: custodian.resources.ec2:INFO Querying ec2 instances with []
2016-04-23 11:59:08,414: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/policy.py", line 169, in poll
    resources = self.resource_manager.resources()
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/resources/ec2.py", line 79, in resources
    self._cache.save(qf, instances)
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/cache.py", line 79, in save
    with open(self.cache_path, 'w') as fh:
IOError: [Errno 2] No such file or directory: '/Users/faisal/.cache/cloud-custodian.cache'
2016-04-23 11:59:08,415: custodian.commands:WARNING Error while executing policy offhour-stop-19, continuing
2016-04-23 11:59:08,415: custodian.output:INFO Storing output with <DirectoryOutput to dir:out/onhour-start-10>
2016-04-23 11:59:08,415: custodian.policy:INFO Running policy onhour-start-10
2016-04-23 11:59:08,415: custodian.resources.ec2:INFO Querying ec2 instances with []
2016-04-23 11:59:08,757: custodian.output:ERROR Error while executing policy
Traceback (most recent call last):
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/policy.py", line 169, in poll
    resources = self.resource_manager.resources()
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/resources/ec2.py", line 79, in resources
    self._cache.save(qf, instances)
  File "/Users/faisal/Documents/git/cloud-custodian/c7n/cache.py", line 79, in save
    with open(self.cache_path, 'w') as fh:
IOError: [Errno 2] No such file or directory: '/Users/faisal/.cache/cloud-custodian.cache'
2016-04-23 11:59:08,760: custodian.commands:WARNING Error while executing policy onhour-start-10, continuing

I'm wondering if the .cache folder should be generated as part of the process if it doesn't already exist? The fix was easy in that I just did a mkdir ~/.cache. Might just make things more friendly?

@kapilt
Copy link
Collaborator

kapilt commented Apr 25, 2016

thanks!, closed in #23

@kapilt kapilt closed this as completed Apr 25, 2016
Sutto pushed a commit to Sutto/cloud-custodian that referenced this issue May 26, 2021
Support for specifying between read / write logging types
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