Errore di registrazione dell'agente Linux

Condividi qui i tuoi suggerimenti o problemi riguardanti la console WAPT o l'agente WAPT
Regole del forum
Regole del forum della community
* Supporto in inglese su www.reddit.com/r/wapt
* Supporto della community in francese disponibile su questo forum
* Si prega di anteporre [RISOLTO] al titolo dell'argomento se è stato risolto.
* Si prega di non modificare un argomento contrassegnato con [RISOLTO]. Aprire un nuovo argomento facendo riferimento a quello precedente.
* Specificare la versione di WAPT installata, la versione completa e il numero di build (2.2.1.11957 / 2.2.2.12337 / ecc.) nonché l'edizione Enterprise/Discovery.
* Le versioni 1.8.2 e precedenti non sono più supportate. Le uniche domande accettate relative alla versione 1.8.2 riguardano l'aggiornamento a una versione supportata (2.1, 2.2, ecc.).
* Specificare il sistema operativo del server (Linux/Windows) e la versione (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specificare il sistema operativo della macchina di amministrazione/creazione dei pacchetti e della macchina con l'agente problematico, se applicabile (Windows 7/10/11/Debian 11/ecc.).
* Evitare di porre più domande quando si apre una discussione, altrimenti potrebbe essere ignorata. Se ci sono più discussioni, aprirle separatamente, preferibilmente una dopo l'altra e non tutte contemporaneamente (ovvero, non intasare il forum).
* Includere frammenti di codice, screenshot e altre immagini direttamente nel post. I link a Pastebin, Bitly e altri siti di terze parti verranno sistematicamente rimossi.
* Come in qualsiasi forum della community, il supporto è fornito volontariamente dai membri. Se si necessita di supporto commerciale, è possibile contattare il reparto vendite di Tranquil IT al numero 02.40.97.57.55
Bloccato
glicerina
Messaggi: 24
Registrazione: 30 maggio 2019 - 11:45

25 aprile 2020 - 17:06

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.
Avatar utente
sfontenau
Esperto WAPT
Messaggi: 2312
Registrato: 10 luglio 2014 - 23:52
Contatto:

27 aprile 2020 - 10:11

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
glicerina
Messaggi: 24
Registrazione: 30 maggio 2019 - 11:45

27 aprile 2020 - 14:26

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
Avatar utente
sfontenau
Esperto WAPT
Messaggi: 2312
Registrato: 10 luglio 2014 - 23:52
Contatto:

28 aprile 2020 - 12:04

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':''}
glicerina
Messaggi: 24
Registrazione: 30 maggio 2019 - 11:45

28 aprile 2020 - 12:34

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
Avatar utente
sfontenau
Esperto WAPT
Messaggi: 2312
Registrato: 10 luglio 2014 - 23:52
Contatto:

28 aprile 2020 - 14:47

Puoi correre:

Codice: Seleziona tutto

rm -f /opt/wapt/private/*.crt
wapt-get register -ldebug
glicerina
Messaggi: 24
Registrazione: 30 maggio 2019 - 11:45

28 aprile 2020 - 15:05

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