# Packetbeat handle error when exec show databases

**URL:** <https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [January 28, 2021, 9:29am UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469 "2021-01-28T09:29:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![282857484](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/282857484/32/83037_2.png) [@282857484](https://discuss.elastic.co/u/282857484)\
**Post date:** [January 28, 2021, 9:29am UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469/1 "2021-01-28T09:29:47Z")

</div>

- Version:  
master(newest)
- Operating System:  
macos 11.1
- Steps to Reproduce:  
env:mysql5.7,mysql8.0  
packetbeat  
when exec "show databases"  
then the program will never recovery.  
because the var complete return false,and cause foller-up always wrong.

packetbeat/protos/mysql/mysql.go mysqlMessageParser :

```auto
table /* table */, _ /*off*/, complete, err := readLstring(s.data, off)

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/4/146ee649490ae4a986607cc4776740b4635a92c0.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/5/c5ebc1958a9d0099cf3843599b8af64e325f2ee4.png)

---

<div class="post-metadata">

**Author:** ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)\
**Post date:** [February 1, 2021, 1:06pm UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469/2 "2021-02-01T13:06:05Z")

</div>

Could you please share the error message from Packetbeat?

---

<div class="post-metadata">

**Author:** ![282857484](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/282857484/32/83037_2.png) [@282857484](https://discuss.elastic.co/u/282857484)\
**Post date:** [February 2, 2021, 11:58am UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469/3 "2021-02-02T11:58:05Z")

</div>

no error message  
when i was debug, and find this bug

---

<div class="post-metadata">

**Author:** ![282857484](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/282857484/32/83037_2.png) [@282857484](https://discuss.elastic.co/u/282857484)\
**Post date:** [February 3, 2021, 10:28am UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469/4 "2021-02-03T10:28:22Z")

</div>

just add this block

```auto
if s.fieldOffset == m.numberOfFields {
	s.parseState = mysqlStateEatRows
}

```

in the end of "case mysqlStateEatFields:"

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 3, 2021, 12:29pm UTC](https://discuss.elastic.co/t/packetbeat-handle-error-when-exec-show-databases/262469/5 "2021-03-03T12:29:07Z")

</div>

Closed on March 3, 2021, 12:29pm UTC

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