Bug 1366139

Summary: satellite-installer fails in db:seed when having http_proxy with credentials
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: InstallationAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Sebastian Gräßl <sgraessl>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.0CC: ahumbe, bbuckingham, chrobert, ehelms, hajek, jcallaha, oshtaier, sgraessl
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:17 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 Pavel Moravec 2016-08-11 07:47:55 UTC
Description of problem:
User story: during an upgrade from Sat6.1.9 (but I guess same applies to a fresh installation), satellite-installer failed during execution of foreman-rake db:seed, during 108-ensure_sync_notification.rb (backtrace is below).

The backtrace suggests ruby restclient GET request to https://satellite.example.com/pulp/api/v2/events/ failed - while the user's environment had set:

http_proxy=http://user:password@1.2.3.4:12345

After unsetting this variable, both rake script and installer finished successfully (sic!).


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


How reproducible:
???


Steps to Reproduce:
1. export http_proxy=http://user:password@1.2.3.4:12345
2. foreman-rake db:seed  (or run installer/upgrade)


Actual results:
db:seed / installer fails with backtrace:

[DEBUG 2016-08-09 15:46:49 main]  Executing '/usr/sbin/foreman-rake db:seed'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: rake aborted!
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: Net::HTTPServerException: 407 "Proxy Authentication Required"
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/rbovirt-0.0.37/lib/restclient_ext/request.rb:44:in `transmit'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:64:in `execute'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/request.rb:33:in `execute'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.6.7/lib/restclient/resource.rb:51:in `get'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/base.rb:78:in `get_response'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/base.rb:66:in `call'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/runcible-1.7.0/lib/runcible/resources/event_notifier.rb:48:in `list'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/app/models/katello/glue/pulp/repo.rb:32:in `ensure_sync_notification'
[ WARN 2016-08-09 15:47:19 main]  /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]/returns: /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.68/db/seeds.d/108-ensure_sync_notification.rb:9:in `<top (required)>'
..


Expected results:
No such failure.


Additional info:
- Derived from https://bugzilla.redhat.com/show_bug.cgi?id=1365542#c5
- Attaching sosreport and satellite.log
  - sosreport contains foreman-debug under sos_commands/foreman/foreman-debug dir
  - sosreport was taken with _previous_ error (dealt in bz1365542), the only change done since then is the fix from 1365542
  - attached satellite.log is the current one / failing

Comment 4 Chris Roberts 2016-08-13 20:33:08 UTC
Fixed upstream with 

https://github.com/Katello/katello-installer/pull/353

moving to 6.3

Comment 5 Sebastian Gräßl 2017-08-16 12:50:01 UTC
Verified on Satellite-6.3 Snap 11.

Running "foreman-rake db:seed" is running as expected with a "http_proxy" environment variable set.

Comment 6 Satellite Program 2018-02-21 16:54:17 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, 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-2018:0336