Page 1 sur 1

agent linux register erreur

Publié : 25 avr. 2020 - 17:06
par gly
Bonjour,

Serveur WAPT 1.8.1.6756
Client Debian Jessie 8 à jour

Au moment du wapt-get register, j'obtiens:

FATAL ERROR : IndexError: list index out of range

J'ai refais de A à Z mais toujours pareil, une idée?

Merci à vous

Re: agent linux register erreur

Publié : 27 avr. 2020 - 10:11
par sfonteneau
Bonjour

La première version de l'agent linux wapt n'est pas très tolérante sur certain point, la prochaine version (qui devrait sortir bientôt) résoudra pas mal de soucis.

A mon avis c'est le hostname du poste qui va pas, pour être certain, pouvez-vous executer la commande:

Code : Tout sélectionner

wapt-get register -ldebug

Re: agent linux register erreur

Publié : 27 avr. 2020 - 14:26
par gly
Voici le résultat de la commande:

Code : Tout sélectionner

2020-04-27 14:24:34,670 DEBUG Default encoding : ascii 
2020-04-27 14:24:34,670 DEBUG Setting encoding for stdout and stderr to UTF-8 
2020-04-27 14:24:34,671 DEBUG Python path ['/opt/wapt', '/opt/wapt', '/opt/wapt/lib/python2.7', '/opt/wapt/lib/python2.7/plat-x86_64-linux-gnu', '/opt/wapt/lib/python2.7/lib-tk', '/opt/wapt/lib/python2.7/lib-old', '/opt/wapt/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/opt/wapt/lib/python2.7/site-packages']
2020-04-27 14:24:34,671 INFO Using local waptservice configuration /opt/wapt/wapt-get.ini 
2020-04-27 14:24:34,671 DEBUG Config file: /opt/wapt/wapt-get.ini
Using config file: /opt/wapt/wapt-get.ini
2020-04-27 14:24:34,676 DEBUG Thread 140231084709632 is connecting to wapt db
2020-04-27 14:24:34,704 DEBUG Using host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem for repo global auth
2020-04-27 14:24:34,718 DEBUG Thread 140231084709632 is connecting to wapt db
2020-04-27 14:24:34,719 DEBUG DB Start transaction
2020-04-27 14:24:34,719 DEBUG DB commit
2020-04-27 14:24:34,748 DEBUG Using host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem for repo wapt auth
2020-04-27 14:24:34,761 INFO Main repository: https://waptserv.there.lyc50.ac-caen.fr/wapt
2020-04-27 14:24:34,803 DEBUG Using host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem for repo wapt-host auth
2020-04-27 14:24:34,816 INFO User Groups:[]
2020-04-27 14:24:34,816 DEBUG WAPT base directory : /opt/wapt
2020-04-27 14:24:34,816 DEBUG Package cache dir : /opt/wapt/cache
2020-04-27 14:24:34,816 DEBUG WAPT DB Structure version;: 20190606
Registering host against server: https://waptserv.there.lyc50.ac-caen.fr/
2020-04-27 14:24:34,817 DEBUG DB Start transaction
2020-04-27 14:24:34,817 DEBUG DB commit
2020-04-27 14:24:34,826 DEBUG DB Start transaction
2020-04-27 14:24:34,826 DEBUG DB commit
2020-04-27 14:24:34,828 DEBUG DB Start transaction
2020-04-27 14:24:34,828 DEBUG DB commit
2020-04-27 14:24:35,948 DEBUG DB Start transaction
2020-04-27 14:24:35,949 DEBUG DB commit
2020-04-27 14:24:35,958 DEBUG Stores cert chain check in cache
FATAL ERROR : IndexError: list index out of range
Traceback (most recent call last):
  File "/opt/wapt//wapt-get.py", line 1431, in <module>
    main()
  File "/opt/wapt//wapt-get.py", line 1213, in main
    description=(" ".join(args[1:])).decode(sys.getfilesystemencoding()),
  File "/opt/wapt/common.py", line 5477, in register_computer
    inv = self._get_host_status_data(old_hashes, new_hashes, force=True, include_dmi=True, include_wmi=True)
  File "/opt/wapt/common.py", line 5770, in _get_host_status_data
    _add_data_if_updated(inv,'installed_softwares',setuphelpers.installed_softwares(''),old_hashes,new_hashes)
  File "/opt/wapt/setuphelpers_linux.py", line 95, in installed_softwares
    pkg_dict={'key':'','name':pkg.name,'version':str(pkg.installed).split('=',1)[1],'install_date':install_date,'install_location':'','uninstall_string':'','publisher':pkg.versions[0].homepage,'system_component':''}
IndexError: list index out of range

Re: agent linux register erreur

Publié : 28 avr. 2020 - 12:04
par sfonteneau
Effectivement il doit y avoir une correction de code a faire ici:

Dans le fichier:

Code : Tout sélectionner

/opt/wapt/setuphelpers_linux.py
Pouvez-vous remplacer la ligne:

Code : Tout sélectionner

pkg_dict={'key':'','name':pkg.name,'version':str(pkg.installed).split('=',1)[1],'install_date':install_date,'install_location':'','uninstall_string':'','publisher':pkg.versions[0].homepage,'system_component':''}
par ceci ? :

Code : Tout sélectionner

pkg_dict={'key':'','name':pkg.name,'version':str(pkg.installed).rsplit('=',1)[-1],'install_date':install_date,'install_location':'','uninstall_string':'','publisher':pkg.versions[0].homepage,'system_component':''}

Re: agent linux register erreur

Publié : 28 avr. 2020 - 12:34
par gly
Bonjour Simon,

Après avoir remplacer la ligne et lancer wapt-get register j'obtiens une nouvelle erreur:

FATAL ERROR : Error: [('x509 certificate routines', 'X509_check_private_key', 'key values mismatch')]

Merci à vous

Re: agent linux register erreur

Publié : 28 avr. 2020 - 14:47
par sfonteneau
Pouvez-vous executer :

Code : Tout sélectionner

rm -f /opt/wapt/private/*.crt
wapt-get register -ldebug

Re: agent linux register erreur

Publié : 28 avr. 2020 - 15:05
par gly
Ca a fonctionné, merci bcp

Voici le résultat de la commande:

Code : Tout sélectionner

2020-04-28 15:01:43,948 DEBUG Default encoding : ascii 
2020-04-28 15:01:43,948 DEBUG Setting encoding for stdout and stderr to UTF-8 
2020-04-28 15:01:43,948 DEBUG Python path ['/opt/wapt', '/opt/wapt', '/opt/wapt/lib/python2.7', '/opt/wapt/lib/python2.7/plat-x86_64-linux-gnu', '/opt/wapt/lib/python2.7/lib-tk', '/opt/wapt/lib/python2.7/lib-old', '/opt/wapt/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/opt/wapt/lib/python2.7/site-packages']
2020-04-28 15:01:43,949 INFO Using local waptservice configuration /opt/wapt/wapt-get.ini 
2020-04-28 15:01:43,949 DEBUG Config file: /opt/wapt/wapt-get.ini
Using config file: /opt/wapt/wapt-get.ini
2020-04-28 15:01:43,953 DEBUG Thread 140160346814208 is connecting to wapt db
2020-04-28 15:01:43,968 DEBUG Warning : Host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem not found, not using it for auth on repo global
2020-04-28 15:01:43,968 DEBUG Thread 140160346814208 is connecting to wapt db
2020-04-28 15:01:43,969 DEBUG DB Start transaction
2020-04-28 15:01:43,969 DEBUG DB commit
2020-04-28 15:01:43,986 DEBUG Warning : Host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem not found, not using it for auth on repo wapt
2020-04-28 15:01:43,986 INFO Main repository: https://waptserv.there.lyc50.ac-caen.fr/wapt
2020-04-28 15:01:44,015 DEBUG Warning : Host certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.pem not found, not using it for auth on repo wapt-host
2020-04-28 15:01:44,015 INFO User Groups:[]
2020-04-28 15:01:44,015 DEBUG WAPT base directory : /opt/wapt
2020-04-28 15:01:44,015 DEBUG Package cache dir : /opt/wapt/cache
2020-04-28 15:01:44,015 DEBUG WAPT DB Structure version;: 20190606
Registering host against server: https://waptserv.there.lyc50.ac-caen.fr/
2020-04-28 15:01:44,015 DEBUG DB Start transaction
2020-04-28 15:01:44,016 DEBUG DB commit
2020-04-28 15:01:44,033 DEBUG DB Start transaction
2020-04-28 15:01:44,033 DEBUG DB commit
2020-04-28 15:01:44,035 DEBUG DB Start transaction
2020-04-28 15:01:44,035 DEBUG DB commit
2020-04-28 15:01:45,150 DEBUG DB Start transaction
2020-04-28 15:01:45,151 DEBUG DB commit
2020-04-28 15:01:45,159 DEBUG Stores cert chain check in cache
2020-04-28 15:01:47,400 INFO Creates host keys pair and x509 certificate /opt/wapt/private/44454C4C-5A00-1058-8051-C4C04F42344A.crt
2020-04-28 15:01:47,417 DEBUG DB Start transaction
2020-04-28 15:01:47,418 DEBUG DB commit
2020-04-28 15:01:47,421 DEBUG DB Start transaction
2020-04-28 15:01:47,422 DEBUG DB commit
2020-04-28 15:01:47,483 DEBUG Starting new HTTPS connection (1): waptserv.there.lyc50.ac-caen.fr:443
2020-04-28 15:01:48,302 DEBUG https://waptserv.there.lyc50.ac-caen.fr:443 "POST //add_host HTTP/1.1" 200 2162
2020-04-28 15:01:48,303 DEBUG DB Start transaction
2020-04-28 15:01:48,303 DEBUG DB commit
2020-04-28 15:01:48,306 DEBUG DB Start transaction
2020-04-28 15:01:48,306 DEBUG DB commit
2020-04-28 15:01:48,308 DEBUG DB Start transaction
2020-04-28 15:01:48,308 DEBUG DB commit
2020-04-28 15:01:48,310 INFO Got signed certificate from server. Issuer: waptserv.there.lyc50.ac-caen.fr. CN: 44454C4C-5A00-1058-8051-C4C04F42344A
2020-04-28 15:01:48,334 DEBUG DB Start transaction
2020-04-28 15:01:48,335 DEBUG DB commit
2020-04-28 15:01:48,338 DEBUG DB Start transaction
2020-04-28 15:01:48,338 DEBUG DB commit
Host correctly registered against server https://waptserv.there.lyc50.ac-caen.fr/.