# QAN is not working - RELOAD grant not enabled, cannot rotate slowlog with disabled log rotation

**URL:** <https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948>\
**Category:** PMM 2.x\
**Tags:** pmm, mysql\
**Created:** [February 6, 2023, 7:09pm UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948 "2023-02-06T19:09:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roman\_Ovchinnikov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roman_ovchinnikov/32/9214_2.png) [@Roman\_Ovchinnikov](https://forums.percona.com/u/Roman_Ovchinnikov)\
**Post date:** [February 6, 2023, 7:09pm UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948/1 "2023-02-06T19:09:40Z")

</div>

I have fresh install (less than 2 weeks, version 2.33.0 of PMM server and pmm-agent/pmm-admin both 2.33.0 as well on DB servers) and among other things, wanted to see how well QAN works.

I have once a day `pt-query-digest` based slow log processing and QAN supposed to be addition to it.

Based on docs (not very much detailed in operations), I’ve added agent with `pmm-admin add mysql --query-source=slowlog --size-slow-logs=-1GiB` which to my understanding should:

1. Tell agent do not mess with any tries of log rotation - it’s already handled by logrotate
2. Take data from the slowlog file

( I couldn’t find any config file where this is saved, so it’s from my bash history and may be not really applied )

Problem:

QAN dashboard is empty. On server ( Linux machine where pmm-agent/client runs )

```auto
root@prod-db-4:~# pmm-admin status --wait=30s|fgrep slow
        /agent_id/XXXXXX-4e7c-9dbd-6e13b378e265 mysql_slowlog_agent Agent_status_invalid 0

```

systemd unit logs:

```auto
root@prod-db-4:~# journalctl -u pmm-agent.service -n 1|tail
Feb 06 19:04:24 prod-db-4 pmm-agent[604561]: ERRO[2023-02-06T19:04:24.864+00:00] RELOAD grant not enabled, cannot rotate slowlog agentID=/agent_id/XXXXXXXX-4e7c-9dbd-6e13b378e265 component=agent-builtin type=qan_mysql_slowlog_agent

```

This error makes not much sense to me - I’ve stated I don’t want to PMM deal with log rotation and why it’s trying to do RELOAD is unclear for me.

Please advise.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [February 7, 2023, 1:08am UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948/2 "2023-02-07T01:08:01Z")

</div>

Hi @Roman_Ovchinnikov welcome to the Percona forums!

Interesting scenario. Would you be willing to experiment by assigning the `RELOAD` privilege to the PMM user, and then validate if the slow log is being consumed and then displayed in QAN?

---

<div class="post-metadata">

**Author:** ![Roman\_Ovchinnikov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roman_ovchinnikov/32/9214_2.png) [@Roman\_Ovchinnikov](https://forums.percona.com/u/Roman_Ovchinnikov)\
**Post date:** [February 7, 2023, 5:09am UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948/3 "2023-02-07T05:09:41Z")

</div>

Yes, I’ve did such test and QAN started to be populated on all 3 servers ( 1 master + 2 replica servers). Yet, I see area for improvement here - granting more than needed privs should be avoided.

In my particular case, this is “monitoring” db account, basically readonly, used by Collectd, Zabbix and now PMM.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [February 7, 2023, 6:11am UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948/4 "2023-02-07T06:11:29Z")

</div>

Hi @Roman_Ovchinnikov

Thank you very much for testing this. I agree this is a missed opportunity to minimize the security concern of the monitoring agent. I have filed a Percona JIRA bug. Please follow it and comment if I missed anything, thank you again for bringing this to our attention!  
[https://jira.percona.com/browse/PMM-11562](https://jira.percona.com/browse/PMM-11562)

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [February 7, 2023, 6:11am UTC](https://forums.percona.com/t/qan-is-not-working-reload-grant-not-enabled-cannot-rotate-slowlog-with-disabled-log-rotation/19948/5 "2023-02-07T06:11:41Z")

</div>


