[SOLVED] http_proxy: get() takes exactly 3 arguments (4 given)

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
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

June 9, 2021 - 7:46 PM

Good morning,

We noticed today that all of our workstations behind a proxy were no longer communicating with the WAPT server.
After many hours of research, it seems we have understood the problem.

The WAPT service was down on the workstations with this error:
Picture

We looked at the code in common.py and found a difference between two versions:
1.8.2

Code: Select all

            if config.has_option(section,'use_http_proxy_for_server') and config.getboolean(section,'use_http_proxy_for_server'):
                if config.has_option(section,'http_proxy'):
                    self.proxies = {'http':config.get(section,'http_proxy',''),'https':config.get(section,'http_proxy','')}
                else:
                    self.proxies = {'http':'','https':''}
            else:
                self.proxies = {'http':'','https':''}
1.7.4

Code: Select all

      self.use_kerberos =  config.getboolean(section,'use_kerberos')
            if config.has_option(section,'use_http_proxy_for_server') and config.getboolean(section,'use_http_proxy_for_server'):
                if config.has_option(section,'http_proxy'):
                    self.proxies = {'http':config.get(section,'http_proxy'),'https':config.get(section,'http_proxy')}
                else:
                    self.proxies = None
I noticed that we're calling the `config.get` function with an empty argument. I don't know if that's the cause of the problem...
After downgrading the agent version on the machine, we were able to regain control of it.

Is this a known issue on your end?
Thanks in advance.
Last edited by Floflobel on June 14, 2021 - 11:29, edited 1 time.
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 10, 2021 - 4:17 PM

Which agent version, which server version? (see forum rules)
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
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

June 14, 2021 - 11:19

Version with the problem:
WAPT Server version: 1.8.2
WAPT Agent version: 1.8.2.7334

Example version without the problem:
WAPT Server version: 1.8.2
WAPT Agent version: 1.5.1.26
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

June 15, 2021 - 10:16

Good morning,
Yes, that is indeed a mistake.
The third parameter '' must be removed from the get() call
Thank you for your feedback.

ps. In version 2, the call works correctly (same as 1.7)

Code: Select all

            if config.has_option(section, 'use_http_proxy_for_server') and config.getboolean(section, 'use_http_proxy_for_server'):
                if config.has_option(section, 'http_proxy'):
                    self.proxies = {'http': config.get(section, 'http_proxy'), 'https': config.get(section, 'http_proxy')}
                else:
                    self.proxies = None
            else:
                self.proxies = {'http': None, 'https': None}
Tranquil IT
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 15, 2021 - 11:10

Floflobel wrote: June 14, 2021 - 11:19 AM Version with the problem:
WAPT Server version: 1.8.2
WAPT Agent version: 1.8.2.7334

Example version without the problem:
WAPT Server version: 1.8.2
WAPT Agent version: 1.5.1.26
The fix has been pushed to the 1.8.2 branch. It will be available in the next 1.8.2 release (no date announced yet). Alternatively, you can upgrade to 2.0; the bug is not present there.

Sincerely,

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
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

June 15, 2021 - 12:09

Thank you for your feedback and quick response regarding the fix in version 1.8.2.

Since my workstations are no longer reachable, is a manual update or one using another tool required? Is the fix not only server-side but also agent-side?
User avatar
dcardon
WAPT Expert
Messages: 1929
Registration: June 18, 2014 - 09:58
Location: Saint Sébastien sur Loire
Contact :

June 15, 2021 - 12:13

If you have an Active Directory domain, the Group Policy Object (GPO) will be able to update the workstations and you will regain the connection
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
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

June 15, 2021 - 6:21 PM

The bug appears to affect the connection to the server, but not the downloading of packages from the repository.
If the machines apply the packages while shut down, they will install the new package, waptupgrade version 1.8.2.7367.
Tranquil IT
Floflobel
Messages: 135
Registration: Oct 15, 2015 - 5:32 p.m.

June 16, 2021 - 2:02 PM

Unfortunately, there's no domain on these machines.

I'll run my tests when the new version is available.

Thanks again for your feedback and quick response.
Locked