carbon-relay exception in instrumentation.py

Bug #878674 reported by Scott Smith
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Undecided
Unassigned

Bug Description

I just updated graphite and am testing some things. Just saw this in the relay:

19/10/2011 23:23:01 :: [console] Unhandled error in Deferred:
19/10/2011 23:23:01 :: [console] Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1162, in run
    self.mainLoop()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1171, in mainLoop
    self.runUntilCurrent()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 793, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/task.py", line 194, in __call__
    d = defer.maybeDeferred(self.f, *self.a, **self.kw)
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 133, in maybeDeferred
    result = f(*args, **kw)
  File "/opt/graphite/lib/carbon/instrumentation.py", line 107, in recordMetrics
    record('metricsReceived', myStats.get('metricsReceived', 0))
exceptions.UnboundLocalError: local variable 'record' referenced before assignment

Looks like it's due to this commit?

http://bazaar.launchpad.net/~graphite-dev/graphite/main/revision/581

Revision history for this message
Darrell Bishop (darrellb) wrote :

I just fixed this in my installation (see attached patch).

Revision history for this message
Michael Leinartas (mleinartas) wrote :

Thanks for the fix, applied in r694

Changed in graphite:
milestone: none → 0.9.10
status: New → Fix Committed
Revision history for this message
auxbuss (launchpad-auxbuss) wrote :

I've just run to exactly this problem.

I have no idea which version I'm on, I'm afraid. I installed via pip, but there doesn't appear to be a way to list installed packages and their versions. I'm not a python dev, so don't know my way around pip.

Is there a workround for this in lieu of the fix being deployed? It's a show stopper for me, because I need to keep the graphics generation off the box collecting the metrics. Thanks.

Revision history for this message
Michael Leinartas (mleinartas) wrote :

If you've installed via pip you're likely on 0.9.9 which was released last October. To fix it you'll need to apply the patch attached to this bug.

A new release which has the fix should be out in a day or two if you'd rather wait and upgrade

Changed in graphite:
status: Fix Committed → Fix Released
Revision history for this message
bhardy (bhardy) wrote : Re: Re: [Bug 878674] carbon-relay exception in instrumentation.py

I will be out of the office and unreachable on 6/7 and 6/8. I will return to the office on 6/11.

Please reach out to the ESM team for any concerns. Thanks.

--Bryant

On May 29, 2012, at 3:37 AM, Michael Leinartas <email address hidden> wrote:

> If you've installed via pip you're likely on 0.9.9 which was released
> last October. To fix it you'll need to apply the patch attached to this
> bug.
>
> A new release which has the fix should be out in a day or two if you'd
> rather wait and upgrade
>
> --
> You received this bug notification because you are subscribed to
> Graphite.
> https://bugs.launchpad.net/bugs/878674
>
> Title:
>  carbon-relay exception in instrumentation.py
>
> Status in Graphite - Enterprise scalable realtime graphing:
>  Fix Committed
>
> Bug description:
>  I just updated graphite and am testing some things. Just saw this in
>  the relay:
>
>  19/10/2011 23:23:01 :: [console] Unhandled error in Deferred:
>  19/10/2011 23:23:01 :: [console] Unhandled Error
>  Traceback (most recent call last):
>    File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1162, in run
>      self.mainLoop()
>    File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1171, in mainLoop
>      self.runUntilCurrent()
>    File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 793, in runUntilCurrent
>      call.func(*call.args, **call.kw)
>    File "/usr/lib/python2.7/dist-packages/twisted/internet/task.py", line 194, in __call__
>      d = defer.maybeDeferred(self.f, *self.a, **self.kw)
>  --- <exception caught here> ---
>    File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line 133, in maybeDeferred
>      result = f(*args, **kw)
>    File "/opt/graphite/lib/carbon/instrumentation.py", line 107, in recordMetrics
>      record('metricsReceived', myStats.get('metricsReceived', 0))
>  exceptions.UnboundLocalError: local variable 'record' referenced before assignment
>
>  Looks like it's due to this commit?
>
>  http://bazaar.launchpad.net/~graphite-dev/graphite/main/revision/581
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/graphite/+bug/878674/+subscriptions

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.