--config parameter to carbon-cache.py does not work

Bug #684563 reported by Pete Emerson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Undecided
Unassigned

Bug Description

According to --help, I should be able to specify a configuration file with --config:

/opt/graphite/bin/carbon-cache.py --help
usage: carbon-cache.py [options] <start|stop|status>

options:
  -h, --help show this help message and exit
  --debug Run in the foreground, log to stdout
  --profile=PROFILE Record performance profile data to the given file
  --pidfile=PIDFILE Write pid to the given file
  --config=CONFIG Use the given config file
  --logdir=LOGDIR Write logs in the given directory

However, when I run it like this:

 /opt/graphite/bin/carbon-cache.py --config=/opt/graphite/conf/carbon.conf start

I get this:

03/12/2010 04:29:27 :: Log opened.
03/12/2010 04:29:27 :: twisted.internet.protocol.Factory starting on 2003
03/12/2010 04:29:27 :: Starting factory <twisted.internet.protocol.Factory instance at 0x2b55039de560>
03/12/2010 04:29:27 :: twisted.internet.protocol.Factory starting on 2004
03/12/2010 04:29:27 :: Starting factory <twisted.internet.protocol.Factory instance at 0x2b550624c3f8>
03/12/2010 04:29:27 :: twisted.internet.protocol.Factory starting on 7002
03/12/2010 04:29:27 :: Starting factory <twisted.internet.protocol.Factory instance at 0x2b550624c5a8>
03/12/2010 04:29:27 :: Failed to reload storage schemas
03/12/2010 04:29:27 :: Unhandled Error
Traceback (most recent call last):
  File "/opt/graphite/lib/carbon/writer.py", line 170, in startWriter
    schemaReloadTask.start(60)
  File "/usr/lib64/python2.4/site-packages/twisted/internet/task.py", line 83, in start
    self()
  File "/usr/lib64/python2.4/site-packages/twisted/internet/task.py", line 114, in __call__
    d = defer.maybeDeferred(self.f, *self.a, **self.kw)
  File "/usr/lib64/python2.4/site-packages/twisted/internet/defer.py", line 106, in maybeDeferred
    result = f(*args, **kw)
--- <exception caught here> ---
  File "/opt/graphite/lib/carbon/writer.py", line 159, in reloadStorageSchemas
    schemas = loadStorageSchemas()
  File "/opt/graphite/lib/carbon/storage.py", line 109, in loadStorageSchemas
    config.read(STORAGE_SCHEMAS_CONFIG)
  File "/opt/graphite/lib/carbon/conf.py", line 47, in read
    for line in open(path):
exceptions.IOError: [Errno 2] No such file or directory: 'conf/storage-schemas.conf'

Seems like my call to --config should work. I stumbled upon this while creating an init.d script. My current workaround is to cd into /opt/graphite prior to calling carbon-cache.py. This is similar to the documentation bug I filed earlier.

Pete

chrismd (chrismd)
Changed in graphite:
status: New → Confirmed
Revision history for this message
chrismd (chrismd) wrote :

The --config option actually does work but it only applies to carbon.conf, not storage-schemas.conf. There probably ought to just be an option to specify the config directory instead of an option for each individual file honestly. Anyways, the reason your startup failed was because of Bug #591504, which I just fixed.

Changed in graphite:
status: Confirmed → Fix Committed
chrismd (chrismd)
Changed in graphite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.