Not the answer you need?
Register and ask your own question!

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

Comments

  • MykolaMykola Percona Percona Staff Role
    What interface do you use http://pmm-ip/qan/ or http://pmm-ip/qan2/ ?
    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)?
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    I am using http://pmm-ip/qan/

    The only error which I'm receiving in both the "Network" and "Console" tabs is this ->
    angular.js:11048 GET http://pmm-ip.com/qan-api/instances?deleted=no 500 (Internal Server Error)

    Now at this time I'm not getting any data in the UI.
  • MykolaMykola Percona Percona Staff Role
    do you see any errors in /var/log/qan-api.log ?
    do you have enough free space?
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    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?
  • MykolaMykola Percona Percona Staff Role
    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.
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    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
  • MykolaMykola Percona Percona Staff Role
    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?
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    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
  • MykolaMykola Percona Percona Staff Role
    root of the issue: QAN cannot find any queries to analyze.
    In this case, you have two options:
    1. configure slow log for better results - https://www.percona.com/doc/percona-...w-log-settings
    2. more simple way - switch query source to performance schema (see screenshot below)
      see also https://www.percona.com/doc/percona-...ormance-schema
      it is also possible to set during client adding:
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    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'
  • MykolaMykola Percona Percona Staff Role
    please configure privileges according to FAQ recommendations (see GRANT command) - https://www.percona.com/doc/percona-monitoring-and-management/faq.html#what-privileges-are-required-to-monitor-a-mysql-instance

    anyway, I created ticket PMM-1160 about this issue, I think privileges should be checked by pmm-admin tool.
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    Thank you very much.
  • akhilr@ebutor[email protected] Contributor Current User Role Beginner
    Please close this ticket
This discussion has been closed.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.