1. Erik van Zijst
  2. dogslow
  3. Issues
Issue #15 new

Inspect.convert throws KeyError

Eleni Lixourioti
created an issue

Some of my requests seem to be triggering this exception. It's only happening on my live environment so it's quite hard for me to try to manually trigger / debug this further, I don't think it's environment related though. Any ideas?

Request watchdog failed

Stacktrace (most recent call last):

File "dogslow/__init__.py", line 134, in peek
    output += '\n\n'
  File "dogslow/__init__.py", line 69, in stack
    if with_locals:
  File "python2.7/inspect.py", line 885, in formatargvalues
    specs.append(strseq(args[i], convert, join))
  File "python2.7/inspect.py", line 838, in strseq
    return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
  File "python2.7/inspect.py", line 838, in <lambda>
    return join(map(lambda o, c=convert, j=join: strseq(o, c, j), object))
  File "python2.7/inspect.py", line 840, in strseq
    return convert(object)
  File "python2.7/inspect.py", line 882, in convert
    return formatarg(name) + formatvalue(locals[name])


Types:  KeyError
Value:  'metric'
Location: python2.7/inspect.py, convert:882

Comments (6)

  1. Erik van Zijst staff repo owner

    I haven't seen that one before and judging from just the stacktrace I don't really have any ideas.

    If you can reproduce this reliably, could you insert a log/print statement at dogslow/__init__.py:69 to see what stack frame is causing the problem?

    FWIW, you can disable the logging of stack local vars (DOGSLOW_STACK_VARS=False) to work around the issue for now.

  2. Eleni Lixourioti reporter

    I had to disable dogslow temporarily at the time for other reasons, I only put it back on a couple of days ago. I'm still getting the same issue periodically with various keys causing the error. I have all the local vars of the trace and offending requests logged on sentry now though, so I'll try to do some debugging on the issue beginning of next week.

  3. Log in to comment