agent linux register erreur

Share here your tips or issues concerning WAPT Console or WAPT Agent / Venez ici partager vos problèmes et astuces concernants la console et l'agent WAPT
Règles du forum
Règles du forum communautaire
* English support on www.reddit.com/r/wapt
* Le support communautaire en français se fait sur ce forum
* Merci de préfixer le titre du topic par [RESOLU] s'il est résolu.
* Merci de ne pas modifier un topic qui est taggé [RESOLU]. Ouvrez un nouveau topic en référençant l'ancien
* Préciser version de WAPT installée, version complète ET numéro de build (2.2.1.11957 / 2.2.2.12337 / etc.) AINSI QUE l'édition Enterprise / Discovery
* Les versions 1.8.2 et antérieures ne sont plus maintenues. Les seules questions acceptées vis à vis de la version 1.8.2 sont liés à la mise à jour vers une version supportée (2.1, 2.2, etc.)
* Préciser OS du serveur (Linux / Windows) et version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019)
* Préciser OS de la machine d'administration/création des paquets et de la machine avec l'agent qui pose problème le cas échéant (Windows 7 / 10 / 11 / Debian 11 / etc.)
* Eviter de poser plusieurs questions lors de l'ouverture de topic, sinon il risque d'être ignorer. Si plusieurs sujet, ouvrir plusieurs topic, et de préférence les uns après les autres et pas tous en même temps (ie ne pas spammer le forum).
* Inclure directement les morceaux de code, les captures d'écran et autres images directement dans le post. Les liens vers les pastebin, les bitly et autres sites tierces seront systématiquement supprimés.
* Comme tout forum communautaire, le support est fait bénévolement par les membres. Si vous avez besoin d'un support commercial, vous pouvez contacter le service commercial Tranquil IT au 02.40.97.57.55
gly
Messages : 24
Inscription : 30 mai 2019 - 11:45

25 avr. 2020 - 17:06

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
Avatar de l’utilisateur
sfonteneau
Expert WAPT
Messages : 1788
Inscription : 10 juil. 2014 - 23:52
Contact :

27 avr. 2020 - 10:11

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
gly
Messages : 24
Inscription : 30 mai 2019 - 11:45

27 avr. 2020 - 14:26

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
Avatar de l’utilisateur
sfonteneau
Expert WAPT
Messages : 1788
Inscription : 10 juil. 2014 - 23:52
Contact :

28 avr. 2020 - 12:04

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':''}
gly
Messages : 24
Inscription : 30 mai 2019 - 11:45

28 avr. 2020 - 12:34

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
Avatar de l’utilisateur
sfonteneau
Expert WAPT
Messages : 1788
Inscription : 10 juil. 2014 - 23:52
Contact :

28 avr. 2020 - 14:47

Pouvez-vous executer :

Code : Tout sélectionner

rm -f /opt/wapt/private/*.crt
wapt-get register -ldebug
gly
Messages : 24
Inscription : 30 mai 2019 - 11:45

28 avr. 2020 - 15:05

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/.
Verrouillé