AttributeError: 'module' object has no attribute 'parseRetentionDef'

Asked by JOhn Chang

Hello,

I am following the Graphite installation instructions here:
http://graphite.wikidot.com/installation

I have completed the first page, and when I run ./examples/example-client.py, I get the error:
Couldn't connect to 127.0.0.1 on port 2003, is carbon-agent.py running?

I have started Carbon (or at least I tried to):
cd /opt/graphite/
./bin/carbon-cache.py start

It seems, however, that this does not start carbon. Tracing through the logs in /opt/graphite/storage/log/carbon-cache/console.log, I get the error:
AttributeError: 'module' object has no attribute 'parseRetentionDef'

The entire traceback is below. Any help would be appreciated.

0/08/2011 11:58:38 :: Traceback (most recent call last):
30/08/2011 11:58:38 :: File "./bin/carbon-cache.py", line 29, in <module>
30/08/2011 11:58:38 :: run_twistd_plugin(__file__)
30/08/2011 11:58:38 :: File "/opt/graphite/lib/carbon/util.py", line 85, in run_twistd_plugin
30/08/2011 11:58:38 :: runApp(config)
30/08/2011 11:58:38 :: File "/usr/lib/python2.6/dist-packages/twisted/scripts/twistd.py", line 23, in runApp
30/08/2011 11:58:38 :: _SomeApplicationRunner(config).run()
30/08/2011 11:58:38 :: File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 411, in run
30/08/2011 11:58:38 :: self.application = self.createOrGetApplication()
30/08/2011 11:58:38 :: File "/usr/lib/python2.6/dist-packages/twisted/application/app.py", line 489, in createOrGetApplication
30/08/2011 11:58:38 :: ser = plg.makeService(self.config.subOptions)
30/08/2011 11:58:38 :: File "/opt/graphite/lib/twisted/plugins/carbon_cache_plugin.py", line 21, in makeService
30/08/2011 11:58:38 :: return service.createCacheService(options)
30/08/2011 11:58:38 :: File "/opt/graphite/lib/carbon/service.py", line 111, in createCacheService
30/08/2011 11:58:38 :: from carbon.writer import WriterService
30/08/2011 11:58:38 :: File "/opt/graphite/lib/carbon/writer.py", line 40, in <module>
30/08/2011 11:58:38 :: schemas = loadStorageSchemas()
30/08/2011 11:58:38 :: File "/opt/graphite/lib/carbon/storage.py", line 127, in loadStorageSchemas
30/08/2011 11:58:38 :: archives = [ Archive.fromString(s) for s in retentions ]
30/08/2011 11:58:38 :: File "/opt/graphite/lib/carbon/storage.py", line 110, in fromString
30/08/2011 11:58:38 :: (secondsPerPoint, points) = whisper.parseRetentionDef(retentionDef)
30/08/2011 11:58:38 :: AttributeError: 'module' object has no attribute 'parseRetentionDef'

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
JOhn Chang
Solved:
Last query:
Last reply:
Revision history for this message
Aman Gupta (tmm1) said :
#1

This error means you're using an old whisper with a newer carbon.

Use the requirements.txt file in a trunk checkout to setup a dev environment, or run `python setup.py --force` for all three setup.py files to install.

Revision history for this message
JOhn Chang (jchang) said :
#2

Thanks for the reply. Two questions:
1) If I use the requirements.txt file, what do I do to it? Not sure what you want me to do in that.

2) If I use setup.py, which one? I see 3 of them:
graphite/carbon/setup.py
graphite/whisper/setup.py
graphite/setup.py

Revision history for this message
JOhn Chang (jchang) said :
#3

I tried doing a 'python setup.py --force' on all 3 of the setup.py files:

All 3 of them (in /carbon, /whisper, and /) produced the same error:

jchang@util:~/graphite/graphite/whisper$ python ./setup.py --force
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#4

Try

python ./setup.py install --force

JOhn Chang <email address hidden> wrote:

>Question #169644 on Graphite changed:
>https://answers.launchpad.net/graphite/+question/169644
>
>JOhn Chang gave more information on the question:
>I tried doing a 'python setup.py --force' on all 3 of the setup.py
>files:
>
>All 3 of them (in /carbon, /whisper, and /) produced the same error:
>
>jchang@util:~/graphite/graphite/whisper$ python ./setup.py --force
>usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
> or: setup.py --help [cmd1 cmd2 ...]
> or: setup.py --help-commands
> or: setup.py cmd --help
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~graphite-dev
>Post to : <email address hidden>
>Unsubscribe : https://launchpad.net/~graphite-dev
>More help : https://help.launchpad.net/ListHelp

Revision history for this message
Aman Gupta (tmm1) said :
#5

Sorry, you need to pass install to setup.py. Run all 3 of them, or follow the instructions at the top of requirements.txt

Revision history for this message
JOhn Chang (jchang) said :
#6

Hmm. Thanks for all the help, unfortunately I still get the same error.

Running "python ./setup.py install --force" in the 3 dirs seemed to work; no apparent errors. (Was there an order I was supposed to do them in?) However, I still get the same error.

As for requirements.txt, I am running the commands one by one. WHen I do this one:
  brew install cairo && brew link cairo
I get this error:
No command 'brew' found, did you mean:
 Command 'brec' from package 'bplay' (universe)
 Command 'qbrew' from package 'qbrew' (universe)
brew: command not found

It does not seem to be in my path, and I can't find it anywhere on my system. Where does it come from?

Thanks for all your help,
John

Revision history for this message
Nicholas Leskiw (nleskiw) said :
#7

Last thing to try is check out an old revision from bzr, try rev 415... I think trunk may not be working right now.

JOhn Chang <email address hidden> wrote:

>Question #169644 on Graphite changed:
>https://answers.launchpad.net/graphite/+question/169644
>
> Status: Answered => Open
>
>JOhn Chang is still having a problem:
>Hmm. Thanks for all the help, unfortunately I still get the same error.
>
>Running "python ./setup.py install --force" in the 3 dirs seemed to
>work; no apparent errors. (Was there an order I was supposed to do them
>in?) However, I still get the same error.
>
>As for requirements.txt, I am running the commands one by one. WHen I do this one:
> brew install cairo && brew link cairo
>I get this error:
>No command 'brew' found, did you mean:
> Command 'brec' from package 'bplay' (universe)
> Command 'qbrew' from package 'qbrew' (universe)
>brew: command not found
>
>It does not seem to be in my path, and I can't find it anywhere on my
>system. Where does it come from?
>
>Thanks for all your help,
>John
>
>--
>You received this question notification because you are a member of
>graphite-dev, which is an answer contact for Graphite.
>
>_______________________________________________
>Mailing list: https://launchpad.net/~graphite-dev
>Post to : <email address hidden>
>Unsubscribe : https://launchpad.net/~graphite-dev
>More help : https://help.launchpad.net/ListHelp

Revision history for this message
chrismd (chrismd) said :
#8

To my knowledge trunk works fine right now. Aman's suggestion earlier about having an old whisper library installed is definitely the problem because the parseRetentionDef method got moved from carbon's storage module to whisper a month or two ago, which has caused several users to stumble on this very problem.

John, can you confirm what version of whisper you're installing? I'd recommend using the latest trunk. If you're using the 0.9.8 release of whisper along with carbon from trunk then you'd definitely run into this issue.

Revision history for this message
JOhn Chang (jchang) said :
#9

I *think* I am on trunk. As the instructions said, I just did this to get the source:
bzr branch lp:graphite

I'm guessing that just pulls trunk, but it did not create a 'trunk' dir. The instructions say to cd to 'trunk' after pulling the source, but there is no such directory created.

I am reading up on bazaar and can't figure out how to get it to tell me what trunk or branch I am on. In case it is informative, doing a 'bzr log' produces this (I see revision numbers, but to trunk or branch indication):

revno: 547
committer: Sidnei da Silva <email address hidden>
branch nick: graphite
timestamp: Mon 2011-08-29 10:58:32 -0300
message:
  - Add missing __init__.py
------------------------------------------------------------
revno: 546
committer: Chris Davis <email address hidden>
branch nick: graphite
timestamp: Sun 2011-08-28 22:49:17 -0700
message:
  ignore exception-of-death when carbon-cache is unavailable
------------------------------------------------------------
revno: 545
committer: Chris Davis <email address hidden>
branch nick: graphite
timestamp: Wed 2011-08-24 22:27:35 -0700
message:
  whoops, merging in some bits I missed from the previous lp:~lucio.torre/graphite/add-events merge
------------------------------------------------------------
revno: 544
committer: Brian Hatfield <email address hidden>
branch nick: graphite
timestamp: Wed 2011-08-24 19:20:22 -0400
message:
  More polish of docs

(and so on....)

-----------------------------From the instructions:---------------------------------------
    Please Use Trunk
    There's a few subtle bugs in 0.9.7c that are causing increased message volume on the mailing list.
    Please checkout trunk first, rather than 0.9.7c.

        bzr branch lp:graphite
        cd trunk (--I could not do this; it did not create a trunk dir--)
------------------------------------------------------------------------------------------------

thanks

Revision history for this message
JOhn Chang (jchang) said :
#10

'bzr info' produces this. Does 'branch root' mean the same as 'trunk' in this case?

jchang@util:~/graphite/graphite$ bzr info
Standalone tree (format: pack-0.92)
Location:
  branch root: .

Related branches:
  parent branch: http://bazaar.launchpad.net/~graphite-dev/graphite/main/

Revision history for this message
JOhn Chang (jchang) said :
#11

I figured it out. I did have the correct version pulled down. However, you were right about the whisper version; an older version of whisper was already in /usr/lib/python (residual from before I started this project). I got rid of it and that got me past the problem.

Thanks