Python agent raise ValueError

Hi all,

After my django application intergrating with elastic-apm, I received some errors of apm agent. I can see them in sentry and kibana( /app/apm#/services/<my service>/errors ).

The error is:

ValueError: too many values to unpack(expected 2)

It do not happen each time of calling my application api, I have not catched the rule yet.

Kibana version: 7.6.1

Elasticsearch version: 7.6.1

APM Server version: 7.6.1

APM Agent language and version: python3 + django + elastic-apm 5.6.0

here is the error happening I find on apm board, it seems frames object has too many attributes.
图片

Hello @leslie!

I'm at a bit of a loss as to how you could be seeing this error. I've followed every code path that generates frames, and as far as I can tell it should always be a list of (frame, line_number) tuples. Somehow you're seeing a list of dictionaries, and I honestly have no idea how that could happen.

Could you give us more details on your app, how you installed the elastic-apm library, etc? I'm trying to figure out what's different about your deployment that I'm missing.

hi @basepi

thanks for your reply.

These day we thought it may be caused by too many requests . our application has about 10,000 requests per minute, and load balanced on 4 servers. APM agent is triggered on one of the servers only. So I depressed the weight of the server, but the error keeps appearing on not regular rule:

the apm server is installed by cmd yum localinstall apm-server-7.6.1-x86_64.rpm, and has 2 servers load balanced.

the apm agent is installed by cmd pip install elastic-apm==5.6.0, and the django setting looks as

if os.environ.get('APM_SERVICE_NAME'):

    INSTALLED_APPS += (
        'elasticapm.contrib.django',
    )

    ELASTIC_APM = {
      'SERVICE_NAME': os.environ.get('APM_SERVICE_NAME'),
      'SECRET_TOKEN': '',
      'SERVER_URL': 'http://devops-apm.******.com',
      'DEBUG': True,
    }

    MIDDLEWARE += [
      'elasticapm.contrib.django.middleware.TracingMiddleware',
    ]

You're not doing anything out of the ordinary from what I can see. I opened a PR to suppress these errors for now: https://github.com/elastic/apm-agent-python/pull/837

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.