Page 1 sur 1

[RESOLU] Unable to create waptagent

Posté : 02 juin 2024 - 20:39
par moritz1234
Hi there,

I am trying to create a custom windows waptagent.exe on linux with the following command:

Code : Tout sélectionner

wapt-get build-waptagent --private-key-passwd="pass" --wapt-server-user="admin" --wapt-server-passwd="password" -l debug --config-name=default

The output looks like this:

Code : Tout sélectionner

Logging to /opt/wapt/log/
Building customized waptagent.exe installer
--- Embedded json configuration ----
global: 
        repo_url: "https://repo.wapt/",
        wapt_server: "https://wapt",
        verify_cert: "1",
        use_kerberos: true,
        use_fqdn_as_uuid: true,
        include_dmi_inventory: true,
        include_wmi_inventory: true

certificates: "moritz"
server_certificates: 

------------------------------------
20240602 18312414  ! info  SetThreadName 7fdcb2813040 140585864343616=Main
20240602 18312414  !  +    mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340).DBOpen waptdb.sqlite
20240602 18312414  ! SQL        mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340) 27us waptdb.sqlite PRAGMA page_size=4096 = true
20240602 18312414  ! SQL        mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340) 266us waptdb.sqlite PRAGMA cache_size=10000 = true
20240602 18312414  ! SQL        mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340) 23us waptdb.sqlite select count(*) from sqlite_master = true
20240602 18312414  ! DB         mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340) "/opt/wapt/db/waptdb.sqlite" database file (92 KB) opened with PageSize=4096 CacheSize=10000 (39 MB)
20240602 18312414  !  -    00.000.522
Server: https://wapt
20240602 18312414  !  +    TWaptServer.HttpGetString URL https://wapt/ping?with_version=%s
20240602 18312414  ! debug      Get httpclient
20240602 18312414  !  +         TWaptServer.GetHttpClient(ping?with_version=%s)
20240602 18312414  !  +                 InitHttpTlsContext(TLSContext 7fdcb2780d80, Url https://wapt, ServerCABundle 1, ClientCertificatePath , ClientPrivateKeyPath , OnGetPrivateKeyPassword 7ffc690e7330, OnPeerCertValidate 7ffc690e7340)
20240602 18312414  !  +                         BuildFullPeerCertChainFromServer https://wapt
20240602 18312414  !  +                                 GetSystemCABundlePath
20240602 18312414  ! debug                                      GetSystemCABundlePath: /etc/ssl/certs/ca-certificates.crt
20240602 18312414  !  -                                 00.000.028
20240602 18312414  !  +                                 AddPemFromFile /etc/ssl/certs/ca-certificates.crt
20240602 18312414  !  +                                         TX509CertificatesChainHelper.InitFromPEM
20240602 18312415  ! trace                                              141 loaded certificates from pemdata
20240602 18312415  !  -                                         00.012.889
20240602 18312415  !  +                                         AddCertificates
20240602 18312415  !  -                                         00.000.380
20240602 18312415  !  -                                 00.013.395
20240602 18312415  !  +                                 GetPeerCertChainFromServer https://wapt
20240602 18312438  !  -                                 00.361.697
20240602 18312438  !  +                                 GetCertificatesChainFromFingerprint 94521002032d188630f2c776775672d5fd78797a3b1068ee450d0f5217a68d7d
20240602 18312438  !  -                                 00.000.073
20240602 18312438  !  -                         00.376.497
20240602 18312438  !  -                 00.380.396
20240602 18312460  !  -         00.727.630
20240602 18312460  ! debug      mormot.net.client.THttpClientSocket(7fdcb2791310) done httpclient
20240602 18312504  !  -    00.838.766
Server UUID: 943f3e6e-e68d-11eb-a5ee-00163effba82
Server CABundle: 1
Server client certificate: 
Server client key: 

20240602 18312504  !  +    uwaptserverconnection.TWaptServer(7fdcb2780a70).Login server:https://wapt user:admin 
20240602 18312508  !  +         TWaptServer.HttpGetString URL https://wapt/api/v3/login
20240602 18312508  ! debug              Get httpclient
20240602 18312508  !  +                 TWaptServer.GetHttpClient(api/v3/login)
20240602 18312508  !  +                         InitHttpTlsContext(TLSContext 7fdcb2780d80, Url https://wapt, ServerCABundle 1, ClientCertificatePath , ClientPrivateKeyPath /tmp/tc-961f4fe3ad1f27d76a3acdaad061cc2e.pem, OnGetPrivateKeyPassword 7ffc690e7110, OnPeerCertValidate 7ffc690e7120)
20240602 18312508  !  -                         00.000.030
20240602 18312529  !  -                 00.337.583
20240602 18312529  ! debug              mormot.net.client.THttpClientSocket(7fdcb20f7370) done httpclient
20240602 18312561  !  -         00.853.608
20240602 18312561  !  -    00.918.080
20240602 18312561  !  +    TWaptServer.GetHttpClient(api/v3/add_configurations?set_waptagent=%s)
20240602 18312561  !  +         InitHttpTlsContext(TLSContext 7fdcb2780d80, Url https://wapt, ServerCABundle 1, ClientCertificatePath /tmp/tc-961f4fe3ad1f27d76a3acdaad061cc2e.crt, ClientPrivateKeyPath /tmp/tc-961f4fe3ad1f27d76a3acdaad061cc2e.pem, OnGetPrivateKeyPassword 7ffc690e7910, OnPeerCertValidate 7ffc690e7920)
20240602 18312561  !  -         00.000.050
20240602 18312621  !  -    00.358.012
20240602 18312635  !  +    TWaptServer.JsonGetDV api/v3/get_hash_json_content
20240602 18312635  !  +         TWaptServer.HttpGetString URL https://wapt/api/v3/get_hash_json_content
20240602 18312635  ! debug              Get httpclient
20240602 18312635  !  +                 TWaptServer.GetHttpClient(api/v3/get_hash_json_content)
20240602 18312635  !  -                 00.000.019
20240602 18312635  ! debug              mormot.net.client.THttpClientSocket(7fdcb20f6f70) done httpclient
20240602 18312643  !  -         00.136.144
20240602 18312643  !  -    00.136.237
20240602 18312643  !  +    TX509CertificatesChainHelper.InitFromPEM
20240602 18312643  ! trace      1 loaded certificates from pemdata
20240602 18312643  !  -    00.000.320
20240602 18312643  !  +    AddCertificates
20240602 18312643  !  -    00.000.025
20240602 18312643  !  +    GetCertificatesChainFromFingerprint Tranquil I.T. Systems
20240602 18312643  !  -    00.000.009
20240602 18312643  !  +    TWaptServer.GetHttpClient(wapt/waptagent/waptsetup.exe)
20240602 18312643  !  -    00.000.019
Downloading waptsetup.exe:                                                                                                                                                        20240602 18312656  ! EXC   EKeyNotFoundException {Message:"Key 'InternalName' not found"} [Main] at 686bdd 
20240602 18312656  !  +    UpdatePackageIndex 0
20240602 18312656  !  +         NeedUpdate https://repo.wapt
20240602 18312656  !  +                 FileIsNewerOrDifferentOnServer Packages /root/.config/wapt-get/cache/repo.wapt-/Packages
20240602 18312656  !  +                         WaptWget_Try https://repo.wapt/Packages
20240602 18312656  !  +                                 InitHttpTlsContext(TLSContext 7ffc690e7440, Url https://repo.wapt/Packages, ServerCABundle 1, ClientCertificatePath /tmp/tc-961f4fe3ad1f27d76a3acdaad061cc2e.crt, ClientPrivateKeyPath /tmp/tc-961f4fe3ad1f27d76a3acdaad061cc2e.pem, OnGetPrivateKeyPassword 7ffc690e7250, OnPeerCertValidate 7ffc690e7260)
20240602 18312656  !  +                                         BuildFullPeerCertChainFromServer https://repo.wapt/Packages
20240602 18312656  !  +                                                 GetSystemCABundlePath
20240602 18312656  ! debug                                                      GetSystemCABundlePath: /etc/ssl/certs/ca-certificates.crt
20240602 18312656  !  -                                                 00.000.077
20240602 18312656  !  +                                                 AddPemFromFile /etc/ssl/certs/ca-certificates.crt
20240602 18312656  !  +                                                         TX509CertificatesChainHelper.InitFromPEM
20240602 18312657  ! trace                                                              141 loaded certificates from pemdata
20240602 18312657  !  -                                                         00.016.515
20240602 18312657  !  +                                                         AddCertificates
20240602 18312657  !  -                                                         00.000.469
20240602 18312657  !  -                                                 00.017.318
20240602 18312657  !  +                                                 GetPeerCertChainFromServer https://repo.wapt/Packages
20240602 18312710  !  -                                                 00.245.932
20240602 18312710  !  +                                                 GetCertificatesChainFromFingerprint 94521002032d188630f2c776775672d5fd78797a3b1068ee450d0f5217a68d7d
20240602 18312710  !  -                                                 00.000.059
20240602 18312710  !  -                                         00.264.804
20240602 18312710  !  -                                 00.270.457
20240602 18312734  !  -                         00.647.862
20240602 18312734  !  -                 00.647.938
20240602 18312734  ! debug              https://repo.wapt needs update: 0
20240602 18312734  !  -         00.647.980
20240602 18312735  !  -    00.661.799
20240602 18312735  !  +    ReadAndParsePackagesIndex
20240602 18312736  !  -    00.022.695
20240602 18312741  !  +    TX509CertificatesChainHelper.InitFromPEM
20240602 18312741  ! trace      1 loaded certificates from pemdata
20240602 18312741  !  -    00.000.105
20240602 18312743  ! EXC   Exception {Message:"2.5.5.15602         -0 is not a valid version string"} [Main] at 78d54d 
Exception at 000000000078D54D: Exception:
2.5.5.15602         -0 is not a valid version string.
20240602 18312743  !  +    TWaptServer.HttpGetString URL https://wapt/api/v3/logout
20240602 18312743  ! debug      Get httpclient
20240602 18312743  !  +         TWaptServer.GetHttpClient(api/v3/logout)
20240602 18312743  !  -         00.000.016
20240602 18312743  ! debug      mormot.net.client.THttpClientSocket(7fdcb20f6f70) done httpclient
20240602 18312751  !  -    00.124.705
20240602 18312751  !  +    mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340).Destroy waptdb.sqlite
20240602 18312751  !  +         mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340).DBClose
20240602 18312751  ! DB                 mormot.db.raw.sqlite3.TSqlDatabase(7fdcb2743340) closing [/opt/wapt/db/waptdb.sqlite] 92 KB
20240602 18312751  !  -         00.000.150
20240602 18312751  !  -    00.000.177


It fails with 20240602 18312743 ! EXC Exception {Message:"2.5.5.15602 -0 is not a valid version string"} [Main] at 78d54d


There is clearly some spacing when adding the build number, this is broken in wapt. Please fix it.

Re: Unable to create waptagent

Posté : 03 juin 2024 - 09:26
par dcardon
Guten Tag Moritz,

WAPT version / Edition, serveur OS, client OS, etc. (cf. forum rules)
moritz1234 a écrit : 02 juin 2024 - 20:39 [...] Please fix it.
I was told that Germans were more polite than that... And that they were better to follow guidelines than Frenchmen... Ah those damned stereotypes...

If you are using the Enterprise version, please refer to your commercial contact. If you are using the Discovery version, please reformulate because you are not making people willing to answer your message.

Cheers,

Denis

Re: Unable to create waptagent

Posté : 03 juin 2024 - 11:33
par moritz1234
Sorry.

The version noted is already included in the log

Code : Tout sélectionner

2.5.5.15602
. Its not a server issue, its really just the agent not being able to build it. So I intentionally left out this information, but its the same server...on linux.

Its not about politeness, imho this is not rude. Sorry if you though this. I did hours of debugging (I eventually loaded it into ghidra but could not spot the error). The documentation about using wapt on the command line is pretty bad (yes, there is a list of commands).

I am using wapt for a couple of devices and built a lot of toolchain to make software updates via gitlab ci possible and I am trying to make the same thing for the waptagent (which uses a different endpoint). I already had to patch a lot of files to make it work (because I don't have systemd, ...). Pretty bored of it, that is the downsite of closed source and just a public forum with mostly french documentation and no information that I really need.


> If you are using the Enterprise version, please refer to your commercial contact. If you are using the Discovery version, please reformulate because you are not making people willing to answer your message.

I am just using the discovery edition, but the tool is not really enterprise ready. The console is sometimes pretty broken and slow. But it mostly does its job. If that all is more user/admin friendly I might consider the enterprise edition. Sorry for saying that.

So, can you please fix my rare edge case? There seems to be a couple of spaces to much when appending the build number to the version string of the waptagent.

Re: Unable to create waptagent

Posté : 10 juin 2024 - 15:31
par htouvet
Fixed in master branch and fix will be avaliable in next release.

Re: Unable to create waptagent

Posté : 11 juin 2024 - 20:19
par moritz1234
Thanks!

Re: Unable to create waptagent

Posté : 12 juin 2024 - 09:37
par dcardon
Hi Moritz,
moritz1234 a écrit : 03 juin 2024 - 11:33 I am using wapt for a couple of devices and built a lot of toolchain to make software updates via gitlab ci possible and I am trying to make the same thing for the waptagent (which uses a different endpoint). I already had to patch a lot of files to make it work (because I don't have systemd, ...). Pretty bored of it, that is the downsite of closed source and just a public forum with mostly french documentation and no information that I really need.
Please be careful that the WAPT licence explicitly prohibit derivative products. I don't know if what you are doing is just a home project or a service product for your employer to sell to your employer's clients, but you may double check the licence terms before investing too much time.

By the way, the version up to 1.8.2 was on dual licensing (GPLv3 and proprietary) so you could use that GPLv3 version to make a derivative product if necessary. In 2018 we switch to proprietary only because there was no contribution at all on the community version (4 minor contributions in 8 years), so there was no point to keep having a GPLv3 version since it was not a community project at all.


Cheers,

Denis

Re: Unable to create waptagent

Posté : 20 juin 2024 - 14:23
par dcardon
Hi,

the issue is fixed in latest WAPT 2.5.5 release.

Cheers,

Denis