Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QAN Explain cause agent crash #3005

Open
1 task done
wesleywu opened this issue May 28, 2024 · 3 comments
Open
1 task done

QAN Explain cause agent crash #3005

wesleywu opened this issue May 28, 2024 · 3 comments
Assignees
Labels
bug Bug report

Comments

@wesleywu
Copy link

Description

I'm using PMM for monitoring MongoDB v4.4 in replica-set (no sharding) configuration.
In PMM Query Analytics, select a query, then click Explain tab.
Will see crash log in corresponding agent:

time="2024-05-28T09:25:57.302+00:00" level=info msg="Action finished." component=runner duration="582.651µs" id=/action_id/04548a59-3b4a-4594-b3b9-f022c675967f type=mongodb-explain
panic: runtime error: index out of range [8] with length 8

goroutine 961791 [running]:
github.com/percona/percona-toolkit/src/go/mongolib/proto.ExampleQuery.ExplainCmd({{0xc001005520, 0xf}, {0xc00100550a, 0x5}, {0x0, 0x0, 0x0}, {0xc000b1e600, 0x9, 0x10}, ...})
        /tmp/go/pkg/mod/github.com/percona/[email protected]+incompatible/src/go/mongolib/proto/system.profile.go:166 +0xe45
github.com/percona/pmm/agent/runner/actions.(*mongodbExplainAction).Run(0xc000f78d80, {0x164ee48?, 0xc000f7b3b0})
        /tmp/go/src/github.com/percona/pmm/agent/runner/actions/mongodb_explain_action.go:97 +0x55d
github.com/percona/pmm/agent/runner.(*Runner).handleAction.func1({0x164eda0?, 0xc000f78f60?})
        /tmp/go/src/github.com/percona/pmm/agent/runner/runner.go:238 +0x254
runtime/pprof.Do({0x164ee48?, 0xc000f7b3b0?}, {{0xc000eae300?, 0x164ee80?, 0x2361ee0?}}, 0xc00083c000)
        /usr/local/go/src/runtime/pprof/runtime.go:51 +0x9d
created by github.com/percona/pmm/agent/runner.(*Runner).handleAction in goroutine 14
        /tmp/go/src/github.com/percona/pmm/agent/runner/runner.go:252 +0x738

I have to manually restart agent to make metrics pushing working again.

Expected Results

Explain Query will not crash the agent.

Actual Results

Explain Query will not crash the agent.

Version

PMM Server v2.41.2, PMM Agent v2.41.1

Steps to reproduce

No response

Relevant logs

No response

Code of Conduct

  • I agree to follow Percona Community Code of Conduct
@wesleywu wesleywu added the bug Bug report label May 28, 2024
@BupycHuk
Copy link
Member

Hello @wesleywu could you provide an example of the query so we can investigate it.

@wesleywu
Copy link
Author

wesleywu commented Jun 4, 2024

from QAN example:

{
  "ns": "pdcast.track",
  "op": "query",
  "command": {
    "find": "track",
    "filter": {
      "tid": {
        "$in": [
          {
            "$numberInt": "280736241"
          }
        ]
      }
    },
    "projection": {
      "es_key": {
        "$numberInt": "1"
      },
      "pid": {
        "$numberInt": "1"
      },
      "feed": {
        "$numberInt": "1"
      },
      "tid": {
        "$numberInt": "1"
      }
    },
    "lsid": {
      "id": {
        "$binary": {
          "base64": "U51mkw83SaKpYnUCa+S+ug==",
          "subType": "04"
        }
      }
    },
    "$clusterTime": {
      "clusterTime": {
        "$timestamp": {
          "t": 1717489979,
          "i": 356
        }
      },
      "signature": {
        "hash": {
          "$binary": {
            "base64": "AAAAAAAAAAAAAAAAAAAAAAAAAAA=",
            "subType": "00"
          }
        },
        "keyId": {
          "$numberLong": "0"
        }
      }
    },
    "$db": "pdcast",
    "$readPreference": {
      "mode": "secondaryPreferred"
    }
  }
}

sample document:

{
  _id: ObjectId('579607068a41b08404b9aaaa'),
  feed: 'f697b9cfff42c4729cad43f529c870274e44xxxx',
  key: 'e819c0ee9ca5331a3238a87faba4ecd4fa66xxxx',
  hash: 1880830089,
  title: 'caesura',
  url: 'http://media.merriam-webster.com/word/podcast/wd20160716.mp3',
  release_date_parsed: ISODate('2016-07-16T05:00:01.000Z'),
  es_key: 'f697b9cfff42c4729cad43f529c870274e449544_e819c0ee9ca5331a3238a87faba4ecd4fa66xxxx',
  tid: 93970,
  link: 'http://www.merriam-webster.com/word-of-the-day/caesura-2016-07-16',
  description: 'Merriam-Webster's Word of the Day for July 16, 2016',
  author: 'Merriam-Webster',
  url_data: { 'Content-Length': '2400276', 'Content-Type': 'audio/mpeg' },
  parsedDate: ISODate('2017-03-03T00:30:13.122Z'),
  cover: '',
  duration: 160,
  parsed: 1,
  size: 3100000,
  url_type: 'audio/mpeg',
  url_ok: true,
  pid: 1011502,
  dd_title_sign: Long('4716419079289417303'),
  dd_desc_sign: Long('7261426517913053846'),
  dd_ldesc_sign: 0
}

@BupycHuk
Copy link
Member

BupycHuk commented Jun 4, 2024

great, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

2 participants