Página 1 de 1

Error de registro del agente de Linux

Publicado: 25 de abril de 2020 - 17:06
por gly
Hola,

un servidor WAPT (versión 1.8.1.6756)
y un cliente Debian Jessie 8 actualizado.

Al ejecutar `wapt-get register`, obtengo el siguiente error:

ERROR FATAL: IndexError: índice de lista fuera de rango.

He intentado de todo, pero el problema persiste. ¿Alguna idea?

Gracias.

Re: Error de registro del agente de Linux

Publicado: 27 de abril de 2020 - 10:11 a. m.
por sfonteneau
Buen día

La primera versión del agente wapt de Linux no es muy tolerante en ciertos puntos, la próxima versión (que debería lanzarse pronto) resolverá bastantes problemas.

En mi opinión, el problema está en el nombre de host del equipo. Para confirmarlo, ¿podría ejecutar el siguiente comando?

Código: Seleccionar todo

wapt-get register -ldebug

Re: Error de registro del agente de Linux

Publicado: 27 de abril de 2020 - 14:26
por gly
Aquí está el resultado del comando:

Código: Seleccionar todo

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: Error de registro del agente de Linux

Publicado: 28 de abril de 2020 - 12:04 p. m.
por sfonteneau
De hecho, debe hacerse una corrección de código aquí:

En el archivo:

Código: Seleccionar todo

/opt/wapt/setuphelpers_linux.py
¿Puedes reemplazar la línea:

Código: Seleccionar todo

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':''}
¿Con esto?

Código: Seleccionar todo

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: Error de registro del agente de Linux

Publicado: 28 de abril de 2020 - 12:34 p. m.
por gly
Hola Simon,

después de reemplazar la línea y ejecutar `wapt-get register`, obtengo un nuevo error:

ERROR FATAL: Error: [('rutinas de certificado x509', 'X509_check_private_key', 'valores de clave no coinciden')]

Gracias

Re: Error de registro del agente de Linux

Publicado: 28 de abril de 2020 - 14:47
por sfonteneau
¿Puedes correr?:

Código: Seleccionar todo

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

Re: Error de registro del agente de Linux

Publicado: 28 de abril de 2020 - 15:05
por gly
¡Funcionó, muchas gracias!

Aquí está el resultado del comando:

Código: Seleccionar todo

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