Cloud-custodian: c7n_mailer is giving me this error when I run it, any issues with the mailer itself?

Created on 24 Mar 2017  路  4Comments  路  Source: cloud-custodian/cloud-custodian

This is the error message I get when I run the command:
$ c7n-mailer -c mailer.yml && custodian run -c test-policy.yml -s .

Traceback (most recent call last):
  File "/home/anant/cloud_custodian/cloud-custodian/tools/c7n_mailer/c7n_mailer/cli.py", line 72, in main
    deploy.provision(config, functools.partial(session_factory, config))
  File "/home/anant/cloud_custodian/cloud-custodian/tools/c7n_mailer/c7n_mailer/deploy.py", line 74, in provision
    archive = get_archive(config)
  File "/home/anant/cloud_custodian/cloud-custodian/tools/c7n_mailer/c7n_mailer/deploy.py", line 38, in get_archive
    'memcache')
TypeError: __init__() takes at most 6 arguments (8 given)
> /home/anant/cloud_custodian/cloud-custodian/tools/c7n_mailer/c7n_mailer/deploy.py(38)get_archive()
-> 'memcache')
(Pdb)

@kapilt @whit537

Most helpful comment

I'll note, if we just rev c7n with a new version, it will probably fix the issue for people.

You can add -e git+https://github.com/capitalone/cloud-custodian.git#egg=c7n to your requirements.txt to pip install HEAD c7n from the repo to get the mu.py changes.

All 4 comments

@JohnTheodore brought up this same issue in Gitter the other day. The problem is that you have a new version of the c7n-mailer executable that is importing an old version of the underlying c7n.mu library, due to the way you have custodian installed.

(The old library has a PythonPackageArchive class that took at most six arguments. The new version of PythonPackageArchive takes an arbitrary number of arguments, and the new mailer executable wants to give it eight.)

In @JohnTheodore's case, he "was just pip installing c7n, and git cloning to install c7n-mailer," and was able to clean up his environment and get it to work. Perhaps you could share your fix, @JohnTheodore?

Does that get you pointed in the right direction, @srinivas-anant?

I'll note, if we just rev c7n with a new version, it will probably fix the issue for people.

You can add -e git+https://github.com/capitalone/cloud-custodian.git#egg=c7n to your requirements.txt to pip install HEAD c7n from the repo to get the mu.py changes.

@whit537 How long will it take for the c7n.mu to be updated? I tired John's method to add the line in the requirements.txt file but it doesn't seem to be doing any mu.py changes.

Sorry my bad it was a typo error. Your answer helped me out thanks @JohnTheodore and @whit537.

Was this page helpful?
0 / 5 - 0 ratings