Carbon-Cache AttributeError: 'function' object has no attribute 'get'

Asked by Nathan Spiegl on 2017-03-01

Hi,

I hope someone is able to help with this, I have searched everywhere and cant seem to find any other cases. I have just installed the graphite package from source and for the most part everything is working fine.

The problem I'm facing is when I view a graph on graphite-web I get this exception in the carbon-cache console log:

01/03/2017 09:13:22 :: Unhandled Error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 103, in callWithLogger
    return callWithContext({"system": lp}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/log.py", line 86, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 122, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/dist-packages/twisted/python/context.py", line 85, in callWithContext
    return func(*args,**kw)
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 597, in _doReadOrWrite
    why = selectable.doRead()
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 208, in doRead
    return self._dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 214, in _dataReceived
    rval = self.protocol.dataReceived(data)
  File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/basic.py", line 765, in dataReceived
    self.stringReceived(packet)
  File "/opt/graphite/lib/carbon/protocols.py", line 202, in stringReceived
    datapoints = MetricCache.get(metric, {}).items()
exceptions.AttributeError: 'function' object has no attribute 'get'

Would anyone be able to advise what might be causing this?

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Nathan Spiegl
Solved:
2017-03-08
Last query:
2017-03-08
Last reply:
2017-03-07
Denis Zhdanov (deniszhdanov) said : #1

Graphite master require django 1.9.x, graphite 0.9.15 - django 1.4.x .. 1.6.x

Nathan Spiegl (nspiegl) said : #2

Hi Denis,

Thanks for the advice. I am running Graphite master and had Django 1.9 already installed, I just upgraded to 1.9.12 to see if this would change anything but I am still getting the exception: "exceptions.AttributeError: 'function' object has no attribute 'get'" in my Carbon-Cache log.

I should mention that graphite-web is rendering the graph's fine without any issue, the metrics are being displayed as expected. I just want to know what is causing this exception that is appearing in the Carbon log.

If it helps these are the Python modules I have installed:

attrs (16.3.0)
Automat (0.5.0)
cairocffi (0.8.0)
cffi (1.9.1)
constantly (15.1.0)
Django (1.9.12)
django-tagging (0.4.3)
incremental (16.10.1)
pip (9.0.1)
pycparser (2.17)
pyparsing (2.1.10)
python-memcached (1.58)
pytz (2016.10)
scandir (1.5)
setuptools (20.7.0)
six (1.10.0)
Twisted (17.1.0)
wheel (0.29.0)
whisper (0.10.0rc1)
whitenoise (3.3.0)
zope.interface (4.3.3)

Denis Zhdanov (deniszhdanov) said : #3

Oops, sorry, looks like mixed up with different issue.
I'm suspecting it's because of this recent commit - https://github.com/graphite-project/carbon/commit/d0c3c31b75777039ad74d6bf6443e282d7a7ba02
Need to check more.

Denis Zhdanov (deniszhdanov) said : #4

Yes, you're right, I tested that and opened an issue - https://github.com/graphite-project/carbon/issues/633

Denis Zhdanov (deniszhdanov) said : #5

Should be fixed now - https://github.com/graphite-project/carbon/pull/634
Thanks for a report!

Nathan Spiegl (nspiegl) said : #6

Thanks Denis, its working okay now.