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

Problem with Mariadb 10.5.6 Centos 7 #65

Open
thaidh1907 opened this issue Oct 30, 2020 · 6 comments
Open

Problem with Mariadb 10.5.6 Centos 7 #65

thaidh1907 opened this issue Oct 30, 2020 · 6 comments

Comments

@thaidh1907
Copy link

Hello,
Centos 7.8.2003
Mariadb 10.5.6

File "/usr/lib/python2.7/site-packages/amplify/ext/mysql/managers.py", line 152, in _find_local
ps, _ = (ps, None) if ps is not None else subp.call(PS_CMD)
File "/usr/lib/python2.7/site-packages/amplify/agent/common/util/subp.py", line 32, in call
raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode, error=raw_err))
AmplifySubprocessError: (message=ps xao pid,ppid,command | grep -E 'mysqld( |$)', payload={'returncode': 1, 'error': ''})

@qwertynik
Copy link

Receiving the same error.
Is there a setting in the config file to be modified to make nginx amplify look at a different process?

2020-11-25 06:16:22,290 [1732] supervisor failed to find running mysqld via "ps xao pid,ppid,command | grep -E 'mysqld( |$)'" due to AmplifySubprocessError
2020-11-25 06:16:22,290 [1732] supervisor additional info:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/amplify/ext/mysql/managers.py", line 152, in _find_local
    ps, _ = (ps, None) if ps is not None else subp.call(PS_CMD)
  File "/usr/lib/python2.7/site-packages/amplify/agent/common/util/subp.py", line 32, in call
    raise AmplifySubprocessError(message=command, payload=dict(returncode=process.returncode, error=raw_err))
AmplifySubprocessError: (message=ps xao pid,ppid,command | grep -E 'mysqld( |$)', payload={'returncode': 1, 'error': ''})

@RalfvdEnden
Copy link

There isn't as far as I know. I did try to set remote = True and fill out both 'host' and 'port', but that still fails to get stats with the following error:

2020-11-25 13:57:18,066 [10359] mysql_metrics failed to collect MySQLd metrics due to AttributeError
2020-11-25 13:57:18,066 [10359] mysql_metrics additional info:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/amplify/ext/mysql/collectors/metrics.py", line 65, in mysql_status
with conn as cursor:
AttributeError: exit
2020-11-25 13:57:18,067 [10359] mysql_metrics mysql_metrics failed to collect: mysql_status raised KeyError
2020-11-25 13:57:18,067 [10359] mysql_metrics additional info:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/amplify/agent/collectors/abstract.py", line 129, in collect
method(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/amplify/ext/mysql/collectors/metrics.py", line 86, in mysql_status
counted_vars['mysql.global.update'] +
KeyError: 'mysql.global.insert'
2020-11-25 13:57:18,067 [10359] mysql_metrics 2368003db38ab9501e2361349341f8abfad990da9fe96a46527359b852f0ae1c collect in 0.003

Haven't been able to figure out why.

@handymenny
Copy link

handymenny commented Nov 26, 2020

Can you try appying this change https://github.com/nginxinc/nginx-amplify-agent/pull/189 ?
With that change I have no problem with MariaDB 10.5.8 on ubuntu bionic and focal.

@RalfvdEnden
Copy link

With the patch it does detect mariadb, but I still get the KeyError

@handymenny
Copy link

handymenny commented Nov 26, 2020

With the patch it does detect mariadb, but I still get the KeyError

What is the output of SHOW GLOBAL STATUS LIKE "Com_insert"; with the user configured in amplify-agent?

@RalfvdEnden
Copy link

I dug into the pyMySQL documentation and found out how to fix the issue. In both meta.py and metric.py (in ext/mysql/collectors/) the following change was necessary:

with conn as cursor:
should be:
with conn.cursor() as cursor:

FreeBSD probably comes with a (slightly?) newer version of the module than CentOS

@defanator defanator transferred this issue from another repository Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants