Pagina 1 di 1

Errore di registrazione dell'agente Linux

Pubblicato: 25 aprile 2020 - 17:06
di gly
Salve,

un server WAPT (versione 1.8.1.6756)
e un client Debian Jessie 8 aggiornato.

Quando eseguo `wapt-get register`, ricevo il seguente errore:

FATAL ERROR: IndexError: list index out of range.

Ho provato di tutto da zero, ma il problema persiste. Avete qualche suggerimento?

Grazie.

Re: Errore di registrazione dell'agente Linux

Pubblicato: 27 aprile 2020 - 10:11
di sfontenau
Buongiorno

La prima versione dell'agente Linux wapt non è molto tollerante su alcuni punti, la prossima versione (che dovrebbe essere rilasciata a breve) risolverà parecchi problemi.

A mio parere, il problema è il nome host del computer. Per esserne certi, potresti eseguire il seguente comando:

Codice: Seleziona tutto

wapt-get register -ldebug

Re: Errore di registrazione dell'agente Linux

Pubblicato: 27 aprile 2020 - 14:26
di gly
Ecco il risultato del comando:

Codice: Seleziona tutto

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: Errore di registrazione dell'agente Linux

Pubblicato: 28 aprile 2020 - 12:04
di sfontenau
In effetti, qui bisogna apportare una correzione al codice:

Nel file:

Codice: Seleziona tutto

/opt/wapt/setuphelpers_linux.py
Puoi sostituire la riga:

Codice: Seleziona tutto

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 questo?

Codice: Seleziona tutto

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: Errore di registrazione dell'agente Linux

Pubblicato: 28 aprile 2020 - 12:34
di gly
Ciao Simon,

dopo aver sostituito la riga ed eseguito `wapt-get register`, ricevo un nuovo errore:

ERRORE FATALE: Errore: [('x509 certificate routines', 'X509_check_private_key', 'key values ​​​​mismatch')]

Grazie

Re: Errore di registrazione dell'agente Linux

Pubblicato: 28 aprile 2020 - 14:47
di sfontenau
Puoi correre:

Codice: Seleziona tutto

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

Re: Errore di registrazione dell'agente Linux

Pubblicato: 28 aprile 2020 - 15:05
di gly
Ha funzionato, grazie mille!

Ecco il risultato del comando:

Codice: Seleziona tutto

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