Page 1 of 1

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

Published: June 9, 2021 - 7:46 PM
by Floflobel
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.

Re: http_proxy: get() takes exactly 3 arguments (4 given)

Published: June 10, 2021 - 4:17 PM
by dcardon
Which agent version, which server version? (see forum rules)

Re: http_proxy: get() takes exactly 3 arguments (4 given)

Published: June 14, 2021 - 11:19
by Floflobel
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

Re: http_proxy: get() takes exactly 3 arguments (4 given)

Published: June 15, 2021 - 10:16
by htouvet
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}

Re: http_proxy: get() takes exactly 3 arguments (4 given)

Published: June 15, 2021 - 11:10
by dcardon
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

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

Published: June 15, 2021 - 12:09 PM
by Floflobel
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?

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

Published: June 15, 2021 - 12:13
by dcardon
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

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

Published: June 15, 2021 - 6:21 PM
by htouvet
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.

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

Published: June 16, 2021 - 2:02 PM
by Floflobel
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.