Bug 891296 - Perl cartridge does not have the (soft, functional) dependencies of LWP::Protocol::https met
Summary: Perl cartridge does not have the (soft, functional) dependencies of LWP::Prot...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Rob Millner
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-01-02 13:58 UTC by Jan Pazdziora
Modified: 2015-05-14 23:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-02-13 22:36:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Pazdziora 2013-01-02 13:58:20 UTC
Description of problem:

By default, Perl 5.10 cartridge installs LWP and LWP::UserAgent and LWP::Protocol::https (perl-libwww-perl rpm, I assume). So it's possible to make http requests from the application with the stock software. However, it is not possible to make https requests because LWP::Protocol::https needs packages that are not installed.

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

Application with Perl 5.10 cartridge as of today.

How reproducible:

Deterministic.

Steps to Reproduce:
1. > GET -S 'http://www.redhat.com/' | head
2. > GET -S 'https://www.redhat.com/' | head
3. > GET -S 'http://openshift.redhat.com/' | head
4. Even merely use-ing the module fails: perl -e 'use LWP::Protocol::https;'
  
Actual results:

> GET -S 'http://www.redhat.com/' | head
GET http://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head id="head">
    <title>Red Hat | The World's Open Source Leader</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
> GET -S 'https://www.redhat.com/' | head
GET https://www.redhat.com/ --> 501 Protocol scheme 'https' is not supported (Crypt::SSLeay or IO::Socket::SSL not installed)
LWP will support https URLs if either Crypt::SSLeay or IO::Socket::SSL
is installed. More information at
<http://search.cpan.org/dist/libwww-perl/README.SSL>.
> GET -S 'http://openshift.redhat.com/' | head
GET http://openshift.redhat.com/ --> 301 Moved Permanently
GET http://openshift.redhat.com/app/ --> 301 Moved Permanently
GET https://openshift.redhat.com/app/ --> 501 Protocol scheme 'https' is not supported (Crypt::SSLeay or IO::Socket::SSL not installed)
LWP will support https URLs if either Crypt::SSLeay or IO::Socket::SSL
is installed. More information at
<http://search.cpan.org/dist/libwww-perl/README.SSL>.
> perl -e 'use LWP::Protocol::https;'
Can't locate Net/SSL.pm in @INC) at /usr/share/perl5/Net/HTTPS.pm line 19.
Can't locate IO/Socket/SSL.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/share/perl5/Net/HTTPS.pm line 23.
Compilation failed in require at /usr/share/perl5/LWP/Protocol/https.pm line 48.
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
>

Expected results:

> GET -S 'http://www.redhat.com/' | head
GET http://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head id="head">
    <title>Red Hat | The World's Open Source Leader</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
> GET -S 'https://www.redhat.com/' | head
GET https://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head id="head">
    <title>Red Hat | The World's Open Source Leader</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
> GET -S 'http://openshift.redhat.com/' | head
GET http://openshift.redhat.com/ --> 301 Moved Permanently
GET http://openshift.redhat.com/app/ --> 301 Moved Permanently
GET https://openshift.redhat.com/app/ --> 200 OK
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class='no-js' lang='en'>
> perl -e 'use LWP::Protocol::https;'
>

Additional info:

The user can certainly add LWP::Protocol::https to deplist.txt and since even the use of the module fails, it will be re-installed from CPAN. But it brings a lot of dependencies and moves the whole LWP stack to version 6, see below. One could also hand-pick the IO::Socket::SSL to stay on Red Hat supported software as much as possible ... I just think the user shouldn't need to do this.

Here's the output of git pushing application with that deplist.txt amended:

remote: Running .openshift/action_hooks/pre_build
remote: --> Working on LWP::Protocol::https
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/LWP-Protocol-https-6.03.tar.gz ... OK
remote: Configuring LWP-Protocol-https-6.03 ... OK
remote: ==> Found dependencies: Mozilla::CA, IO::Socket::SSL, LWP::UserAgent, Net::HTTPS
remote: --> Working on Mozilla::CA
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/A/AB/ABH/Mozilla-CA-20120823.tar.gz ... OK
remote: Configuring Mozilla-CA-20120823 ... OK
remote: Building Mozilla-CA-20120823 ... OK
remote: Successfully installed Mozilla-CA-20120823
remote: --> Working on IO::Socket::SSL
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/S/SU/SULLR/IO-Socket-SSL-1.81.tar.gz ... OK
remote: Configuring IO-Socket-SSL-1.81 ... OK
remote: ==> Found dependencies: Net::SSLeay
remote: --> Working on Net::SSLeay
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/M/MI/MIKEM/Net-SSLeay-1.51.tar.gz ... OK
remote: Configuring Net-SSLeay-1.49 ... OK
remote: Building Net-SSLeay-1.49 ... OK
remote: Successfully installed Net-SSLeay-1.49
remote: Building IO-Socket-SSL-1.81 ... OK
remote: Successfully installed IO-Socket-SSL-1.81
remote: --> Working on LWP::UserAgent
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/libwww-perl-6.04.tar.gz ... OK
remote: Configuring libwww-perl-6.04 ... OK
remote: ==> Found dependencies: LWP::MediaTypes, Encode::Locale, HTTP::Status, HTTP::Negotiate, File::Listing, HTTP::Daemon, Net::HTTP, HTTP::Cookies, HTTP::Date, HTTP::Request::Common, HTTP::Response, WWW::RobotRules, HTTP::Request
remote: --> Working on LWP::MediaTypes
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/LWP-MediaTypes-6.02.tar.gz ... OK
remote: Configuring LWP-MediaTypes-6.02 ... OK
remote: Building LWP-MediaTypes-6.02 ... OK
remote: Successfully installed LWP-MediaTypes-6.02 (upgraded from 5.822)
remote: --> Working on Encode::Locale
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/Encode-Locale-1.03.tar.gz ... OK
remote: Configuring Encode-Locale-1.03 ... OK
remote: Building Encode-Locale-1.03 ... OK
remote: Successfully installed Encode-Locale-1.03
remote: --> Working on HTTP::Status
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/HTTP-Message-6.06.tar.gz ... OK
remote: Configuring HTTP-Message-6.06 ... OK
remote: ==> Found dependencies: IO::HTML, HTTP::Date, IO::Compress::Bzip2, IO::Uncompress::Bunzip2
remote: --> Working on IO::HTML
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/C/CJ/CJM/IO-HTML-0.04.tar.gz ... OK
remote: Configuring IO-HTML-0.04 ... OK
remote: Building IO-HTML-0.04 ... OK
remote: Successfully installed IO-HTML-0.04
remote: --> Working on HTTP::Date
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/HTTP-Date-6.02.tar.gz ... OK
remote: Configuring HTTP-Date-6.02 ... OK
remote: Building HTTP-Date-6.02 ... OK
remote: Successfully installed HTTP-Date-6.02 (upgraded from 5.831)
remote: --> Working on IO::Compress::Bzip2
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/IO-Compress-2.059.tar.gz ... OK
remote: Configuring IO-Compress-2.059 ... OK
remote: ==> Found dependencies: Compress::Raw::Bzip2, Compress::Raw::Zlib
remote: --> Working on Compress::Raw::Bzip2
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/Compress-Raw-Bzip2-2.059.tar.gz ... OK
remote: Configuring Compress-Raw-Bzip2-2.059 ... OK
remote: Building Compress-Raw-Bzip2-2.059 ... OK
remote: Successfully installed Compress-Raw-Bzip2-2.059
remote: --> Working on Compress::Raw::Zlib
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/Compress-Raw-Zlib-2.059.tar.gz ... OK
remote: Configuring Compress-Raw-Zlib-2.059 ... OK
remote: Building Compress-Raw-Zlib-2.059 ... OK
remote: Successfully installed Compress-Raw-Zlib-2.059 (upgraded from 2.020)
remote: Building IO-Compress-2.059 ... OK
remote: Successfully installed IO-Compress-2.059
remote: Building HTTP-Message-6.06 ... OK
remote: Successfully installed HTTP-Message-6.06 (upgraded from 5.817)
remote: --> Working on HTTP::Negotiate
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/HTTP-Negotiate-6.01.tar.gz ... OK
remote: Configuring HTTP-Negotiate-6.01 ... OK
remote: Building HTTP-Negotiate-6.01 ... OK
remote: Successfully installed HTTP-Negotiate-6.01 (upgraded from 5.813)
remote: --> Working on File::Listing
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/File-Listing-6.04.tar.gz ... OK
remote: Configuring File-Listing-6.04 ... OK
remote: Building File-Listing-6.04 ... OK
remote: Successfully installed File-Listing-6.04 (upgraded from 5.814)
remote: --> Working on HTTP::Daemon
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/HTTP-Daemon-6.01.tar.gz ... OK
remote: Configuring HTTP-Daemon-6.01 ... OK
remote: Building HTTP-Daemon-6.01 ... OK
remote: Successfully installed HTTP-Daemon-6.01 (upgraded from 5.827)
remote: --> Working on Net::HTTP
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/Net-HTTP-6.05.tar.gz ... OK
remote: Configuring Net-HTTP-6.05 ... OK
remote: Building Net-HTTP-6.05 ... OK
remote: Successfully installed Net-HTTP-6.05 (upgraded from 5.833)
remote: --> Working on HTTP::Cookies
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/HTTP-Cookies-6.01.tar.gz ... OK
remote: Configuring HTTP-Cookies-6.01 ... OK
remote: Building HTTP-Cookies-6.01 ... OK
remote: Successfully installed HTTP-Cookies-6.01 (upgraded from 5.833)
remote: --> Working on WWW::RobotRules
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/G/GA/GAAS/WWW-RobotRules-6.02.tar.gz ... OK
remote: Configuring WWW-RobotRules-6.02 ... OK
remote: Building WWW-RobotRules-6.02 ... OK
remote: Successfully installed WWW-RobotRules-6.02 (upgraded from 5.832)
remote: Building libwww-perl-6.04 ... OK
remote: Successfully installed libwww-perl-6.04 (upgraded from 5.833)
remote: Building LWP-Protocol-https-6.03 ... OK
remote: Successfully installed LWP-Protocol-https-6.03
remote: 19 distributions installed
remote: Running .openshift/action_hooks/build
remote: Running .openshift/action_hooks/deploy

Comment 1 Rob Millner 2013-01-03 01:54:57 UTC
Added the perl-IO-Socket-SSL package to the list of cartridge dependencies:

# yum -y install perl-IO-Socket-SSL.noarch
...

# GET -S https://www.redhat.com/

GET https://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

...


Pull request https://github.com/openshift/origin-server/pull/1115

Comment 2 Jianwei Hou 2013-01-04 02:16:19 UTC
Verified on devenv_2632

perl-IO-Socket-SSL.noarch is installed on instance now

[root@ip-10-151-48-251 ~]# rpm -q perl-IO-Socket-SSL
perl-IO-Socket-SSL-1.31-2.el6.noarch

[perl1-2632t1.dev.rhcloud.com ~]\> GET -S 'http://www.redhat.com/' | head
GET http://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head id="head">
    <title>Red Hat | The World's Open Source Leader</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

[perl1-2632t1.dev.rhcloud.com ~]\> GET -S 'https://www.redhat.com/' | head
^LGET https://www.redhat.com/ --> 200 OK
<!DOCTYPE html 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
  <head id="head">
    <title>Red Hat | The World's Open Source Leader</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />


[perl1-2632t1.dev.rhcloud.com ~]\>  GET -S 'http://openshift.redhat.com/' | head
GET http://openshift.redhat.com/ --> 301 Moved Permanently
GET http://openshift.redhat.com/app/ --> 301 Moved Permanently
GET https://openshift.redhat.com/app/ --> 200 OK
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie6 no-js" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="ie7 no-js" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="ie8 no-js" lang="en"> <![endif]-->
<!--[if IE 9]>    <html class="ie9 no-js" lang="en"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class='no-js' lang='en'>


[perl1-2632t1.dev.rhcloud.com ~]\> perl -e 'use LWP::Protocol::https;'
[perl1-2632t1.dev.rhcloud.com ~]\>


Note You need to log in before you can comment on or make changes to this bug.