.pem file lost and various other problems

Questions about WAPT Server / Requests and help related to the WAPT server
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
Alan
Messages: 5
Registration: May 5, 2015 - 09:53

May 5, 2015 - 10:03

Good morning,

I installed WAPT on my 700 machines and everything worked until my .pem file was lost (hard drive crash and I forgot to make a backup) :? ).

So, my first idea was to reinstall a workstation with the console, generate a new key pair and therefore a new agent that I would deploy to replace the old one.

But, as a result, in my console, I still see all the old clients that I absolutely cannot control or delete.

When I formatted a workstation and tried to manually reinstall the client via waptdeploy, this is what I got:
Picture

And when manually installing the agent, it does not appear in the console (still the old client of the same name with the latest April update).
A wapt-get register command returns:

Code: Select all

2015-05-05 10:14:50,631 CRITICAL Unable to delete param uuid
FATAL ERROR : OperationalError: attempt to write a readonly database
And so on the console I always get the message: HTTP/1.1 404 NOT FOUND when I try to make an intervention on a client.

I admit that I'm completely lost now and I have no idea how to get out of this... Is it salvageable?

Thanks in advance.

My versions:
WAPT Server version: 1.2.3
WAPT Agent version: 1.1.1
WAPT Setup version: 1.1.1
WAPT Deploy version: 1.2.3.0
Last edited by Alan on May 5, 2015 - 11:16, edited 1 time.
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

May 6, 2015 - 6:10 PM

1 - Regarding the waptdeploy version issue: Apparently, waptsetup.exe and waptagent.exe are at version 1.1.
If it's a Linux server, install the tis-waptsetup package from the console.
On the administration machine, also verify that you are on version 1.2.3 like the server. If not, install version 1.2.3 from http://wapt.tranquil.it/wapt/waptsetup.exe.

From the console, recompile the Wapt agent so that the server has a Waptagent version 1.2.3 with the correct public key.
Waptdeploy should then work.

2- You will need to resign all packages and all client machine configurations (which are also packages).

To resign a package (after having correctly configured your wapt-get.ini with the new private key),
for each package:
`wapt-get edit packagename` and
`wapt-get -i build-upload c:\waptdev\wapt-packagename`.

To resign the machines:
open the machine in the console and save the machine configuration.

There is a cleaner method using a Python script... (see https://github.com/tranquilit/WAPT/blob ... l_hosts.py )
Tranquil IT
Alan
Messages: 5
Registration: May 5, 2015 - 09:53

May 7, 2015 - 10:16

Thanks for the feedback.

I did indeed download version 1.2.3 of waptsetup from your website.

However, I didn't quite understand how to re-sign the workstations. How do I save it?

And finally, if I delete "the machine and its configuration package" from the console, is this action permanent, or will the machine reappear the next time I communicate?

Thanks in advance.
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

May 7, 2015 - 12:23

To resign machine packages, a small script as a bonus... which also shows how to script with a wapt client. ;)

on the management machine (with the private signing key private_key entered in c:\apt\apt-get.ini)
Create the Python file:
c:\wapt\resign.py

Code: Select all

#!/usr/bin/python
# -*- coding: utf-8 -*-

import os
import tempfile
import shutil
from setuphelpers import *
from common import *

class TempDir():
    def __init__(self):
        self.path = None

    def __enter__(self):
        self.path = tempfile.mkdtemp()
        return self.path

    def __exit__(self, exc, value, tb):
        if os.path.isdir(self.path):
            shutil.rmtree(self.path)

wapt = Wapt()

# un object qui represente le depot des paquets machine
hosts = WaptRepo('hosts',wapt.repositories[0].repo_url+'-host')
hosts.load_packages()

# mot de passe du serveur wapt pour uploader les paquets
password = 'xxxx'

for p in hosts.packages:
    with TempDir() as tmpdir:
        try:
            print('resignature de %s dans %s'%(p.package,tmpdir))
            if p.section == 'host':
                res = wapt.edit_host(p.package,use_local_sources=False,target_directory=tmpdir)
            else:
                res = wapt.edit_package(p.package,use_local_sources=False,target_directory=tmpdir)
            wapt.build_upload(res['source_dir'],
                wapt_server_user='admin',
                wapt_server_passwd=password,
                inc_package_release=True)
        except Exception as e:
            print('Erreur pour %s: %s'%(p.package,e))

to launch with:
c:\wapt\waptpython c:\wapt\resign.py
Tranquil IT
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

May 7, 2015 - 3:00 PM

If you "delete the machine," this removes the machine from the inventory, but if the machine still physically exists with wapt pointing to the server, it will re-register at the next communication. And if a package exists in its name, and it hasn't installed it yet, it will install the machine package at the next upgrade.

If you delete "the machine and its configuration package," in addition to deleting the inventory information, this also deletes its package (stored in the repository http://mywaptserver.mydomain/wapt-h ... maine.wapt ).

There are indeed two distinct things:
- the inventory/deployment status information, which the wapt agent on the client machine transmits to the server at the end of each update (upgrade). This is only done if a "wapt_server=" line is present in wapt-get.ini.
- The machine package: which the wapt agent on the client machine retrieves from the repository (it uses the package name as its FQDN) with each update to know what to install. This is only done if "use_hostpackages=1" is specified in wapt-get.ini
Tranquil IT
Locked