thingswise / tw-etcdstat

Apache License 2.0
0 stars 0 forks source link

tw-etcdstat is not able to run #4

Open theggs opened 2 years ago

theggs commented 2 years ago

On app-dev master, I try to fix etcdctl.

8月 11 20:56:44 dev-work02 systemd[1]: Started Etcdstat - VM stats agent.
8月 11 20:56:44 dev-work02 python[4352]: DEBUG:root:{'LANG': 'en_US.utf8', 'SHELL': '/bin/bash', 'ETCDCTL_KEY_FILE': '/etc/etcd-clients/ssl/skydns/etcdstat-key.pem', 'ETCDCTL_ENDPOINT': 'https://dev-datanode:2379', 'LOGNAME': 'etcdstat', 'USER': 'etcdstat', 'HOME': '/home/etcdstat', 'ETCDCTL_CACERT': '/etc/etcd-clients/ssl/skydns/ca.pem', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin', 'ETCDCTL_CERT_FILE': '/etc/etcd-clients/ssl/skydns/etcdstat.pem'}
8月 11 20:56:44 dev-work02 python[4352]: detected unhandled Python exception in '/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py'
8月 11 20:56:45 dev-work02 python[4352]: can't communicate with ABRT daemon, is it running? [Errno 2] No such file or directory
8月 11 20:56:45 dev-work02 python[4352]: Traceback (most recent call last):
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
8月 11 20:56:45 dev-work02 python[4352]: "__main__", fname, loader, pkg_name)
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
8月 11 20:56:45 dev-work02 python[4352]: exec code in run_globals
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 281, in <module>
8月 11 20:56:45 dev-work02 python[4352]: main()
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 269, in main
8月 11 20:56:45 dev-work02 python[4352]: with create_etcdstat(endpoints, cert, ca_cert, args.interval, items, handlers, defaults) as etcdstat:
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
8月 11 20:56:45 dev-work02 python[4352]: return self.gen.next()
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 274, in create_etcdstat
8月 11 20:56:45 dev-work02 python[4352]: etcdstat = EtcdStat(endpoints, cert, ca_cert, interval, items, handlers, defaults)
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 151, in __init__
8月 11 20:56:45 dev-work02 python[4352]: scheme, cert, ca_cert)
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 58, in __init__
8月 11 20:56:45 dev-work02 python[4352]: import etcd
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcd/__init__.py", line 2, in <module>
8月 11 20:56:45 dev-work02 python[4352]: from .client import Client
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/etcd/client.py", line 22, in <module>
8月 11 20:56:45 dev-work02 python[4352]: import dns.resolver
8月 11 20:56:45 dev-work02 python[4352]: File "/usr/lib/python2.7/site-packages/dns/resolver.py", line 19, in <module>
8月 11 20:56:45 dev-work02 python[4352]: from urllib.parse import urlparse
8月 11 20:56:45 dev-work02 python[4352]: ImportError: No module named parse
8月 11 20:56:45 dev-work02 systemd[1]: etcdstat.service: main process exited, code=exited, status=1/FAILURE
8月 11 20:56:45 dev-work02 systemd[1]: Unit etcdstat.service entered failed state.
8月 11 20:56:45 dev-work02 systemd[1]: etcdstat.service failed.

I uprgade tw-etcdctl to the newest version, it raise another error

8月 18 12:58:43 dev-master systemd[1]: Started Etcdstat - VM stats agent.
8月 18 12:58:43 dev-master python[21090]: detected unhandled Python exception in '/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py'
8月 18 12:58:43 dev-master python[21090]: can't communicate with ABRT daemon, is it running? [Errno 2] No such file or directory
8月 18 12:58:43 dev-master python[21090]: Traceback (most recent call last):
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
8月 18 12:58:43 dev-master python[21090]: "__main__", fname, loader, pkg_name)
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
8月 18 12:58:43 dev-master python[21090]: exec code in run_globals
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 282, in <module>
8月 18 12:58:43 dev-master python[21090]: main()
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 270, in main
8月 18 12:58:43 dev-master python[21090]: with create_etcdstat(endpoints, cert, ca_cert, args.interval, items, handlers, defaults) as etcdstat:
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib64/python2.7/contextlib.py", line 17, in __enter__
8月 18 12:58:43 dev-master python[21090]: return self.gen.next()
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 275, in create_etcdstat
8月 18 12:58:43 dev-master python[21090]: etcdstat = EtcdStat(endpoints, cert, ca_cert, interval, items, handlers, defaults)
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 151, in __init__
8月 18 12:58:43 dev-master python[21090]: scheme, cert, ca_cert)
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcdstat/etcdstat.py", line 58, in __init__
8月 18 12:58:43 dev-master python[21090]: import etcd
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcd/__init__.py", line 2, in <module>
8月 18 12:58:43 dev-master python[21090]: from .client import Client
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/etcd/client.py", line 22, in <module>
8月 18 12:58:43 dev-master python[21090]: import dns.resolver
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/dns/resolver.py", line 32, in <module>
8月 18 12:58:43 dev-master python[21090]: import dns.exception
8月 18 12:58:43 dev-master python[21090]: File "/usr/lib/python2.7/site-packages/dns/exception.py", line 141
8月 18 12:58:43 dev-master python[21090]: raise self.exception_class(str(exc_val)) from exc_val
8月 18 12:58:43 dev-master python[21090]: ^
8月 18 12:58:43 dev-master python[21090]: SyntaxError: invalid syntax
8月 18 12:58:43 dev-master systemd[1]: etcdstat.service: main process exited, code=exited, status=1/FAILURE
theggs commented 2 years ago

update:

The dependency of etcd, dnspython end its support for python2 after 1.16.0. But when install the package, it will install the newest version. So it would be incompatible.

After install dnspython 1.16.0, it start normally.

We need to move etcdstat to python3, or specify the version of package in setup.py.

Holm78 commented 2 years ago

@theggs How did you upgraded it? You have to use latest tw-ansible-role for it. Did you re-run ansible playbook?

theggs commented 2 years ago

No, I reinstall the packages.

[centos@dev-work01 ~]$ sudo pip install dnspython==1.16.0 tw-etcdstat==0.1.1.post25

Should I rerun tw-ansible-role for it?

theggs commented 2 years ago

The roles are mantains by support team. I need to ask them to do that.

Holm78 commented 2 years ago

@theggs yes, etcdstat should be updated using by running ansible role from latest tw-ansible-roles repository.