Bug 1875426

Summary: Azure VM provision fails with error `requests.exceptions.HTTPError: 502 Server Error: Proxy Error for url`
Product: Red Hat Satellite Reporter: vijsingh
Component: Compute ResourcesAssignee: Eric Helms <ehelms>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: apatel, apuntamb, ehelms, lhellebr, lzap, mhulan, oprazak
Target Milestone: 6.8.0Keywords: AutomationBlocker, Regression, TestBlocker, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-installer-2.1.2.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-10-27 13:08:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description vijsingh 2020-09-03 14:07:07 UTC
Description of problem:

Azure VM provision fails with error `requests.exceptions.HTTPError: 502 Server Error: Proxy Error for url`


Version-Release number of selected component (if applicable):

6.8.0 Snap 11

How reproducible:

Always

Steps to Reproduce:
1. Try to provision a VM using Azure CR using CLI/API/UI
2.
3.

Actual results:

requests.exceptions.HTTPError: 502 Server Error: Proxy Error for url`

Expected results:

 VM should provision 

Additional info:

 a. After setting the 'ProxyTimeout 600' all scenarios works well 

 b. More could refer from here : https://bugzilla.redhat.com/show_bug.cgi?id=1850934

Comment 1 Brad Buckingham 2020-09-03 14:56:59 UTC
Is this a regression from 6.7?

Comment 2 vijsingh 2020-09-03 15:02:45 UTC
yes it more looks regression.

Comment 4 Anurag Patel 2020-09-04 15:36:30 UTC
I believe this could be happening from 6.8 due to Apache which now runs as a proxy, and times out for long-running calls such as those to Cloud provisioning APIs. Increasing proxy timeout globally may not be a good choice.

Vijay, did you try switching to passenger via `--foreman-passenger true` as mentioned in the referenced BZ?

Comment 8 vijsingh 2020-09-05 15:37:09 UTC
as https://community.theforeman.org/t/issues-since-upgrade-to-2-1-1/20238/38 same issue impacting to GCE as well

Comment 12 Lukáš Hellebrandt 2020-09-08 13:30:09 UTC
I tried to reproduce this on Sat 6.8 snap 14.

I could NOT reproduce this with CRs of types: RHEV, VMWare.

I could reproduce this with a CR of type EC2.

I thinks this depends on how long the call lasts and thus is more dependent on the speed of the resource than on its type => this is a general bug for Compute Resources.

Comment 13 Lukáš Hellebrandt 2020-09-08 13:32:32 UTC
The error in log was:

==> /var/log/httpd/foreman-ssl_error_ssl.log <==
[Tue Sep 08 15:27:53.773208 2020] [proxy_http:error] [pid 3120] (70007)The timeout specified has expired: [client <IP>:45230] AH01102: error reading status line from remote server 127.0.0.1:3000, referer: https://<FQDN>/hosts/new
[Tue Sep 08 15:27:53.773256 2020] [proxy:error] [pid 3120] [client <IP>:45230] AH00898: Error reading from remote server returned by /hosts, referer: https://<FQDN>/hosts/new

The error in WebUI was:

Proxy Error
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /hosts.
Reason: Error reading from remote server

Comment 14 Anurag Patel 2020-09-08 15:26:22 UTC
Agreed - This may happen with any long running action, not just compute resources. It looks like there are two workarounds:

1. Switch to passenger via satellite-installer --foreman-passenger true
2. Increase proxy timeout in Apache.

Comment 17 Eric Helms 2020-09-08 16:59:51 UTC
Created redmine issue https://projects.theforeman.org/issues/30802 from this bug

Comment 19 Jitendra Yejare 2020-09-14 13:22:05 UTC
Verified!

@ Satellite 6.8 snap 15


Steps:
------------
1. Attempt to Provision a VM(Finish Template) from Satellite UI on Azure Cloud.


Observation:
--------------
1. The provisioning to Azure CR is successful without Proxy Error.
2. The provision host showed installed status as expected.

Comment 20 Lukas Zapletal 2020-09-17 15:08:30 UTC
Guys, if you want to run Satellite on Passenger with SElinux enabled, you need to enable boolean passenger_run_foreman optional flag. It is false by default. This will solve all the mentioned denials.

Comment 23 errata-xmlrpc 2020-10-27 13:08:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.8 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4366