[RESOLVED] WAPT.download_upgrades() had no effect

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
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
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

July 23, 2025 - 4:16 PM

Good morning,

In package y, I need to use the WAPT.download_upgrades() method to update another package x (upgrade to version n+1 of package x installed in version n) and then install it with WAPT.install(x).

However, this doesn't work. During the installation of package y (no error, the package installs correctly), the machine doesn't download the latest version (n+1) of package x and therefore doesn't install it. It remains with version n of package x. I don't understand why, given that version n+1 of package x is available on the WAPT server, and that the machine's agent is correctly configured to retrieve packages from the WAPT server. It's not a problem with the maturity of package x either (the problem occurs regardless of its maturity). Furthermore, if I select the machine in the console, then click "Check for updates" and select "And download packages," the machine does download version n+1 of package x. (Below, this "package x" is "col73-xmind"; I want to update and install it within the installation of another package.)

Here are the corresponding lines of code:

Code: Select all

 
    WAPT.download_upgrades()
    for p in WAPT.installed(include_errors=True):
        if p.package == 'col73-xmind':
            WAPT.install('col73-xmind')
  
These same lines of code worked before (I already did it this way with another package a year ago without any problems)

Where could the problem be coming from?
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

July 24, 2025 - 10:19

I added a few lines of code to perform checks, and indeed, package x is found in version n (actually 16), but strangely, version n+1 (actually 17) available on the server is not seen, downloaded, and installed, according to the log. Instead, wapt re-downloads and reinstalls version n (16) :| as shown in the log below.
However, as stated in my previous message, when I check the package updates for the workstation using the console and download the packages, the workstation does indeed see and download version n+1 (17)!?

Code: Select all

    WAPT.download_upgrades()
    for p in WAPT.installed(include_errors=True):
        if p.package == 'col73-xmind':
            print("paquet col73-xmind détecté")
            version_paquet=(p.version).split("-")[1]
            print('version du paquet wapt de xmind installé=%s - tentative de maj du paquet"' % version_paquet)
            WAPT.install('col73-xmind',force=True)
 
Below is the installation log for the col73-xmind8 package, which contains the preceding lines of code:

package col73-xmind detected,
installed xmind wapt package version=16 - attempting to update package"
col73-xmind_3.7.2.0-16_windows_0f4137ed1502b5045d6083aa258b5c42_PROD_9757a8c0d5a4e8d25c3a08543880461d.wapt: 262144 / 161672722 (0%) (15.62Mb/s)
col73-xmind_3.7.2.0-16_windows_0f4137ed1502b5045d6083aa258b5c42_PROD_9757a8c0d5a4e8d25c3a08543880461d.wapt: 68419584 / 161672722 (42%) (64.22Mb/s)
col73-xmind_3.7.2.0-16_windows_0f4137ed1502b5045d6083aa258b5c42_PROD_9757a8c0d5a4e8d25c3a08543880461d.wapt: 138936320 / 161672722 (86%) (65.72Mb/s)
col73-xmind_3.7.2.0-16_windows_0f4137ed1502b5045d6083aa258b5c42_PROD_9757a8c0d5a4e8d25c3a08543880461d.wapt: 161672722 / 161672722 (100%) (65.78Mb/s)
Installing XMind
Installing: xmind-8-update2-windows.exe (3.7.2.0)
Copying the XMind folder (AppData) to C:\Sources\XMind for future installation...
Copy completed successfully
Installation completed successfully
Copying the XMind8 portable application folder
Installed xmind wapt package version=16
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

July 24, 2025 - 10:24

Good morning
If I check for package updates for the workstation by downloading the packages, the workstation correctly sees and downloads version n+1 (17)!?
So in the code you're doing an update? WAPT.update()
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

July 24, 2025 - 11:43

Hi Simon,

No, I hadn't used WAPT.update() before.

Doing it before WAPT.upgrades() makes it work now, thanks!

Regards
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

July 25, 2025 - 3:27 PM

Hi Brice,

you should be careful to avoid using `download_upgrade` or `update` in an `install` function, because in many cases, when the machine shuts down during installation, there will be no network connection (VPN, Wi-Fi, 802.1x, etc.), and the download, and therefore the installation, will fail.

Regards,

Denis
Denis Cardon - Tranquil IT
Share your experiences on WAPT! Send us your blog and article URLs in the "Your Opinion of the forum, and we'll feature them on the WAPT
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

July 25, 2025 - 7:08 PM

Indeed, it's better to put the second software as a dependency of the first in the control file; it's much cleaner and less prone to problems.
Vincent CARDON
Tranquil IT
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

July 29, 2025 - 09:37

Hello Denis and Vincent,

Thank you for your advice. This case is a bit unusual. Actually, I can't and don't want to make this package a dependency because it's a misnamed package whose uninstall() function doesn't work (error) and which can't be uninstalled as is. So I want to replace it with another package, y. Therefore, I'm using WAPT.update() and WAPT.download_upgrades() to update the faulty package, and in this same replacement package, y, I uninstall package x later after it's updated using WAPT.remove(package x), since package x's uninstall function is then working.

I've already removed this package from all machines, so it won't be reinstalled once the uninstallation is complete.

This allows me to automate its replacement when installing the new, correct package. In any case, it would be far too tedious to have to manually uninstall package x on hundreds of machines after an update (the machines also need to be powered on for this to work). So I'm taking advantage of the installation of the new replacement package to automate this. I already did this a year ago with another package that had the same problem, and everything went smoothly. On hundreds of machines, there were no issues downloading the new version of the package. The download is then performed from a secondary repository on the local network.

But I thought that when the system shuts down, waptexit started downloading updates before installing them?!

Regards,
Brice
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

August 1, 2025 - 8:01 PM

But I thought that when Waptexit shut down, it started downloading updates before installing them?!
No, everything must have been downloaded before launching waptexit because we cannot know the network availability status when the machine is shut down.

What you could have done, now that we know your use case better, is to correct the uninstallation function of the dependency package, push the correction first and then it would have worked well I think with an additional correction to the "control" file of your main package with a "depends: newpackage" and a "conflicts: oldpackage".
Vincent CARDON
Tranquil IT
brice73
Messages: 42
Registration: February 13, 2023 - 8:05 AM

August 5, 2025 - 3:37 PM

Hello Vincent,
What you could have done, now that we know your use case better, is to correct the uninstallation function of the dependency package, push the correction first and then it would have worked well I think with an additional correction to the "control" file of your main package with a "depends: newpackage" and a "conflicts: oldpackage".
Indeed, that seems possible. I thought the machines would remain in error mode because if the new version of the package hasn't been updated by the machine, then its prior uninstallation (via the conflict) will fail, and the new replacement package won't install but will instead return an error. Thinking about it, it should only be temporary, actually, until the machines update the package whose uninstall function is faulty.
WAPT Enterprise 2.6.1.17765
WAPT server under Debian 13
Administration/package creation under Windows 11/10
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

August 5, 2025 - 7:43 PM

The uninstall function can be fixed with a newer version of the package, which is simpler and more reliable than what you're trying to do.

The main thing is that you're able to do what you want with WAPT.
Vincent CARDON
Tranquil IT
Locked