Cannot connect to the QAN API.

Hi There,

Sometime when I refresh the dashboard I am getting the error saying (Cannot connect to the QAN API.) at that point of time I was unable to view the details of Queries.

Also. Some queries were getting trimmed. I am unable to view full query.

Thank you,
Akhil

What interface do you use [url]http://pmm-ip/qan/[/url] or [url]http://pmm-ip/qan2/[/url] ?
can you open “Developer Tools” in your browser and check what kind of errors do you have.
Is it network connectivity errors or some wrong response from the server side (“Network” tab)?
is any javascript errors (“Console” tab)?

I am using [URL]http://pmm-ip/qan/[/URL]

The only error which I’m receiving in both the “Network” and “Console” tabs is this →
angular.js:11048 GET [URL=“http://jh.ebutor.com/qan-api/instances?deleted=no”]http://pmm-ip.com/qan-api/instances?deleted=no[/URL] 500 (Internal Server Error)

Now at this time I’m not getting any data in the UI.

do you see any errors in /var/log/qan-api.log ?
do you have enough free space?

Yes, I have a look at log and found that the user have crosses the limit to connect. “max_user_connections” configured to 10 and user we have set that to 0.

After setting to 0, we found that pmm user is acquiring more connection on database, say 25 as of now. How to restrict this?

Sorry, do you have too many connections on PMM Client or PMM Server side?

qan-agent works in database server side (PMM Client).
qan-api works inside docker container (PMM Server).

as I can see you have issues with qan-api, so it is needed to inspect log file inside container.

I’ve max_connections configured as 10 to “pmm-user” on PMM Client.

After I set that value to 0, then the error was disappeared, but the Query data was not showing up in Dashboard.

Also could you please let me know how to restrict the “pmm-user” not to acquire more connections;

USER | HOST | CURRENT_CONNECTIONS

pmm | XX.X.XX.XXX | 28

If you see above it has 28 active connections on database. I believe it will only requires max 5

according to FAQ (see GRANT command) recommended MAX_USER_CONNECTIONS value is 10.

can you explain what problem do you have - what exactly doesn’t shown on what Dashboard?

Mykola, the error which I am receiving in dashboard is

QAN API error: “qh.Profile: No query classes for selected instance and time range. Please check whether your MySQL settings match the recommended.”.
Check the /var/log/qan-api.log file in docker container for more information.

Please help me on above. Thank you

root of the issue: QAN cannot find any queries to analyze.
In this case, you have two options: [LIST=1]
[]configure slow log for better results - [URL=“Percona Monitoring and Management”]https://www.percona.com/doc/percona-...w-log-settings[/URL]
[
]more simple way - switch query source to performance schema (see screenshot below)
see also [URL=“Percona Monitoring and Management”]https://www.percona.com/doc/percona-...ormance-schema[/URL]
it is also possible to set during client adding:

[/LIST]

The above all settings you were mentioned are fine. But below are the Errors I found on log.

WARNING agent Cmd fail: Reply[Cmd:Explain Error:‘cmd ‘Explain’ for subsystem ‘mysql’ failed: Error 1345: EXPLAIN/SHOW can not be issued; lacking privileges for underlying table’ Id:e274d5ca-0c84-4557-7225-8c9b1f936132]

WARNING qan-analyzer-mysql-757a86ea-worker Interval out of sequence: got 1, expected 113

ERROR agent Executable file not found in $PATH

WARNING agent Cmd fail: Reply[Cmd:GetServerSummary Error:‘Executable file not found in $PATH’

please configure privileges according to FAQ recommendations (see GRANT command) - [url]Percona Monitoring and Management

anyway, I created ticket PMM-1160 about this issue, I think privileges should be checked by pmm-admin tool.

Thank you very much.

Please close this ticket