macOS : TypeError: _log() got an unexpected keyword argument 'file'

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
marcolefo
Messages : 19
Inscription : 02 oct. 2018 - 11:13

25 juin 2020 - 20:07

Bonjour,

Je teste l'install de l'agent 1.8.2.7265 sous macOS 10.15.5

Ca plante au moment du register. J'imagine que c'est un problème de version de python. Je poste ici au cas où ça aide.
Mais si ça peut se résoudre, je suis preneur ;)

Bonne soirée

Code : Tout sélectionner

# python --version 
Python 2.7.16
# wapt-get register -l debug
2020-06-25 19:55:22,220 DEBUG Default encoding : ascii 
2020-06-25 19:55:22,220 DEBUG Setting encoding for stdout and stderr to UTF-8 
2020-06-25 19:55:22,220 DEBUG Python path ['/opt/wapt', '/opt/wapt', '/opt/wapt/lib/python27.zip', '/opt/wapt/lib/python2.7', '/opt/wapt/lib/python2.7/plat-darwin', '/opt/wapt/lib/python2.7/plat-mac', '/opt/wapt/lib/python2.7/plat-mac/lib-scriptpackages', '/opt/wapt/lib/python2.7/lib-tk', '/opt/wapt/lib/python2.7/lib-old', '/opt/wapt/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/opt/wapt/lib/python2.7/site-packages']
2020-06-25 19:55:22,220 INFO Using local waptservice configuration /opt/wapt/wapt-get.ini 
2020-06-25 19:55:22,220 DEBUG Config file: /opt/wapt/wapt-get.ini
Using config file: /opt/wapt/wapt-get.ini
2020-06-25 19:55:22,224 DEBUG Thread 4514852288 is connecting to wapt db
2020-06-25 19:55:22,228 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:22,253 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:22,256 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:22,392 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:22,421 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:22,448 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:22,450 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:22,585 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:22,589 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:22,625 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:22,626 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:22,755 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:22,760 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:22,784 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:22,786 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:22,918 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:22,920 DEBUG Using host certificate /opt/wapt/private/A35C8C6C-FDCE-5F1F-BDF6-E83297815CB9.pem for repo global auth
2020-06-25 19:55:22,922 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:22,945 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:22,946 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,074 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,078 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,100 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,101 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,234 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,237 DEBUG Thread 4514852288 is connecting to wapt db
2020-06-25 19:55:23,237 DEBUG DB Start transaction
2020-06-25 19:55:23,238 DEBUG DB commit
2020-06-25 19:55:23,242 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,263 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,264 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,447 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,452 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,474 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,478 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,614 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,619 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,644 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,646 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,775 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,780 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,803 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,804 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:23,939 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:23,942 DEBUG Using host certificate /opt/wapt/private/A35C8C6C-FDCE-5F1F-BDF6-E83297815CB9.pem for repo wapt auth
2020-06-25 19:55:23,943 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:23,966 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:23,967 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,104 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,109 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,131 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,132 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,265 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,268 INFO Main repository: https://wapt.domain/wapt
2020-06-25 19:55:24,271 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,295 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,297 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,426 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,429 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,450 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,452 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,587 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,593 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,614 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,615 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,743 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,747 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,770 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,772 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:24,904 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:24,908 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:24,932 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:24,934 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:25,064 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:25,069 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:25,092 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:25,094 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:25,224 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:25,226 DEBUG Using host certificate /opt/wapt/private/A35C8C6C-FDCE-5F1F-BDF6-E83297815CB9.pem for repo wapt-host auth
2020-06-25 19:55:25,228 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:25,251 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:25,252 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:25,382 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:25,386 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:25,410 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:25,411 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:25,535 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:25,538 INFO User Groups:[]
2020-06-25 19:55:25,538 DEBUG WAPT base directory : /opt/wapt
2020-06-25 19:55:25,538 DEBUG Package cache dir : /opt/wapt/cache
2020-06-25 19:55:25,538 DEBUG WAPT DB Structure version;: 20200415
Registering host against server: https://wapt.domain/
2020-06-25 19:55:25,538 DEBUG DB Start transaction
2020-06-25 19:55:25,539 DEBUG DB commit
2020-06-25 19:55:25,545 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:25,571 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:25,572 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:25,707 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:25,709 DEBUG DB Start transaction
2020-06-25 19:55:25,709 DEBUG DB commit
2020-06-25 19:55:25,711 DEBUG DB Start transaction
2020-06-25 19:55:25,711 DEBUG DB commit
2020-06-25 19:55:25,724 INFO Run "route get default"
2020-06-25 19:55:25,738 INFO route get default command returns code 0
2020-06-25 19:55:26,885 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:26,911 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:26,912 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:27,042 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:27,045 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:27,175 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:27,246 DEBUG DB Start transaction
2020-06-25 19:55:27,250 DEBUG DB commit
2020-06-25 19:55:27,253 DEBUG Stores cert chain check in cache
2020-06-25 19:55:27,257 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:27,281 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:27,282 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:27,413 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:27,420 INFO Run "dmidecode -q 2>/dev/null"
2020-06-25 19:55:27,443 INFO dmidecode -q 2>/dev/null command returns code 0
2020-06-25 19:55:27,444 INFO Run "system_profiler SPHardwareDataType -xml"
2020-06-25 19:55:27,579 INFO system_profiler SPHardwareDataType -xml command returns code 0
2020-06-25 19:55:27,585 INFO Run "file /Applications/VLC.app/Contents/Info.plist"
2020-06-25 19:55:27,600 INFO file /Applications/VLC.app/Contents/Info.plist command returns code 0
2020-06-25 19:55:27,630 INFO Run "file /Applications/nextcloud.app/Contents/Info.plist"
2020-06-25 19:55:27,653 INFO file /Applications/nextcloud.app/Contents/Info.plist command returns code 0
FATAL ERROR : TypeError: _log() got an unexpected keyword argument 'file'
Traceback (most recent call last):
  File "/opt/wapt//wapt-get.py", line 1462, in <module>
    main()
  File "/opt/wapt//wapt-get.py", line 1241, in main
    description=(" ".join(args[1:])).decode(sys.getfilesystemencoding()),
  File "/opt/wapt/common.py", line 5621, 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 5945, in _get_host_status_data
    _add_data_if_updated(inv,'installed_softwares',self.merge_installed_softwares_and_wua_list(),old_hashes,new_hashes)
  File "/opt/wapt/common.py", line 6110, in merge_installed_softwares_and_wua_list
    soft_inventory = setuphelpers.installed_softwares()
  File "/opt/wapt/setuphelpers_macos.py", line 433, in installed_softwares
    logger.warning("Application data acquisition failed for {} :".format(plist_file), file=sys.stderr)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 1186, in warning
    self._log(WARNING, msg, args, **kwargs)
TypeError: _log() got an unexpected keyword argument 'file'
WAPT Enterprise Server : 2.4.0.14143 / OS Serveur : Debian bullseye
OS de la machine d'administration/création des paquets : Windows 10
Avatar de l’utilisateur
sfonteneau
Expert WAPT
Messages : 1783
Inscription : 10 juil. 2014 - 23:52
Contact :

25 juin 2020 - 22:20

problème visiblement lors de l'inventaire avec l'application nextcloud (je ne suis pas certain)

il faudrait qu'on fasse un try except lors de l'inventaire pour éviter que cela ne plante.

Je vais installer nextcloud sur le mac pour voir si c'est bien ça

Simon
Avatar de l’utilisateur
sfonteneau
Expert WAPT
Messages : 1783
Inscription : 10 juil. 2014 - 23:52
Contact :

25 juin 2020 - 22:48

Effectivement le code a besoin d'un petit patch:

Dans le fichier /opt/wapt/setuphelpers_macos.py ligne 433

Code : Tout sélectionner

else:
            #logger.warning("Application data acquisition failed for {} :".format(plist_file), file=sys.stderr)
            logger.warning("Application data acquisition failed for {} :".format(plist_file))
L'application nextcloud n'a visiblement pas de CFBundleName
https://developer.apple.com/documentati ... bundlename
MisterP
Messages : 6
Inscription : 28 mai 2020 - 12:10

02 juil. 2020 - 15:13

Bonjour ,

Effectivement je rencontre le même problème, la modification de la ligne corrige le problème.
Avez vous une version à me donner qui inclut directement le correctif ?


Merci
Verrouillé