Symptoms

During the Azure 3.2 -> 4.2 upgrade procedure, import stage, while running the command:

# python azure/deployment/import.py --host=25 --instance=15 --data=/root/azure-export.zip --verbose

the following error appears:

2017-11-10 11:58:23.399 [DEBUG] Executing command: '['/bin/sh', '-c', 'openssl dgst -sha256 -hex -sign /tmp/tmpImoRDV']'
2017-11-10 11:58:23.405 [DEBUG] SQL: SELECT 1 (())
2017-11-10 11:58:23.405 [DEBUG] SQL: select p.value from hosts h, components c, packages pkg, v_props p where h.host_id=c.host_id and c.pkg_id=pkg.pkg_id and p.component_id=c.component_id and h.htype<>'e' and p.name='communication.ip' and pkg.name='pleskd' and c.host_id = %s ((25,))
2017-11-10 11:58:23.407 [DEBUG] Send REST HCL request to host 25 (10.0.0.25) ...
Traceback (most recent call last):
  File "azure/deployment/import.py", line 763, in <module>
    main()
  File "azure/deployment/import.py", line 724, in main
    app_instance_data = get_application(args.instance_id, open_api, aps_api)
  File "azure/deployment/import.py", line 188, in get_application
    instance_data = aps_api.GET('aps/2/application', headers={'APS-Token': token})
  File "/usr/lib/python2.7/site-packages/poaupdater/apsapi.py", line 195, in GET
    return self.call('GET', path, headers, data, cert)
  File "/usr/lib/python2.7/site-packages/poaupdater/apsapi.py", line 146, in call
    resp = urllib2.urlopen(req, context=context)
  File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib64/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.7/urllib2.py", line 1258, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib64/python2.7/urllib2.py", line 1214, in do_open
    raise URLError(err)

urllib2.URLError:

The same error could also be seen by a direct curl request to the Management Node:

[root@osscore ~]# curl -k  -E /usr/local/pem/APS/certificates/poa.pem "https://localhost:6308/aps/2/application"
connect(3, {sa_family=AF_INET, sin_port=htons(8008), sin_addr=inet_addr("10.0.0.10")}, 16) = -1 
curl: (56) Received HTTP code 503 from proxy after CONNECT

HTTPS proxy environment variable is configured in the system:

[root@osscore ~]# echo $https_proxy
https://10.0.0.10:8008/

Cause

The configured HTTPS proxy server cannot serve the requests.

Resolution

Fix the proxy server to process the requests properly.

Alternatively, remove the http_proxy and https_proxy variables definition:

# unset http_proxy
# unset https_proxy

and comment the lines including setting these variables from one of the following files:

/etc/environment /etc/profile /root/.curlrc /root/.bashrc /root/.bash_profile

Internal content