Bug 1086609

Summary: Perl: $OPENSHIFT_REPO_DIR/libs no longer in $PERL5LIB
Product: OpenShift Online Reporter: mephinet <mephinet>
Component: ImageAssignee: Jakub Hadvig <jhadvig>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: erich, jhou, mfojtik, pruan, wzheng, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-15 10:28:14 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:
Attachments:
Description Flags
math.pm
none
test.pl none

Description mephinet 2014-04-11 07:56:51 UTC
Description of problem:

Since 3 days ago, my perl app, hosted at openshift.com, no longer works. When visiting http://kino-gortan.rhcloud.com/bin/check I receive a 400, and in the $OPENSHIFT_PERL_LOG_DIR/perl.log I see:
[error] Can't locate DbConfig.pm in @INC ...
DbConfig.pm exists and is located in $OPENSHIFT_REPO_DIR/libs/DbConfig.pm

Before this week's update, this directory was part of the PERL5LIB environment variable, as exposed to cgi scripts via apache. Now, it is no longer part, as you can verify here:
http://kino-gortan.rhcloud.com/bin/env

How reproducible:
* Create a .pm module in libs/
* Create a cgi-bin script in perl/bin/, importing the .pm
* Visit the cgi-bin script with your browser

Actual results:

500, logfile contains: Can't locate xxx.pm in @INC

Expected results:

.pm file is found by cgi

Comment 1 mephinet 2014-04-11 07:57:40 UTC
sorry, I meant: I receive a 500 (not 400)

Comment 2 Jakub Hadvig 2014-04-11 11:44:47 UTC
Hi mephinet,

thank you for reporting this issue. Found the cause of the bug and working on the fix. Will let you know.

-Jakub

Comment 3 openshift-github-bot 2014-04-11 12:58:14 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a8fa185575b30a17f0fbe50ed156d54537580c7a
Bug 1086609 - Adding $OPENSHIFT_REPO_DIR/libs back into $PERL5LIB for backward compatibility

Comment 4 Peter Ruan 2014-04-11 23:47:24 UTC
Hi Jakub, 

 I'm still seeing the problem.  Not sure if I am following the directions correctly.  Here's the file structure and the attached Math.pm and test.pl file.

[peter@unused-16-138 <DEV> perlapp]# tree
.
├── bin
│   └── test.pl
├── index.pl
├── libs
│   └── Math.pm
└── perl

Comment 5 Peter Ruan 2014-04-11 23:48:56 UTC
Created attachment 885639 [details]
math.pm

Comment 6 Peter Ruan 2014-04-11 23:52:48 UTC
Created attachment 885640 [details]
test.pl

Comment 7 Jakub Hadvig 2014-04-14 07:39:57 UTC
Hi Peter,
the problem has been fixed.
Now we have to wait till it goes to production, which will be today or tommorow.
Afted that it should be working.

-Jakub

Comment 8 Jianwei Hou 2014-04-14 10:11:46 UTC
Verified on devenv-stage_802, OPENSHIFT_REPO_DIR is in PERL5LIB after the fix is merged in.

[perl1-jhou.dev.rhcloud.com 534bb333c2ed88c222000029]\> env|grep PERL5LIB
PERL5LIB=/var/lib/openshift/534bb333c2ed88c222000029/app-root/runtime/repo/libs:/var/lib/openshift/534bb333c2ed88c222000029/perl/perl5lib/lib/perl5/
[perl1-jhou.dev.rhcloud.com 534bb333c2ed88c222000029]\> env|grep OPENSHIFT_REPO_DIR
OPENSHIFT_REPO_DIR=/var/lib/openshift/534bb333c2ed88c222000029/app-root/runtime/repo/

Comment 9 Jianwei Hou 2014-04-14 10:47:27 UTC
Also tried STG, the fix has not made to STG.

[perl1-jhou.stg.rhcloud.com 534bb98f2587c854bd0003dc]\> env|grep PERL5LIB
PERL5LIB=/var/lib/openshift/534bb98f2587c854bd0003dc/perl/perl5lib/lib/perl5/
[perl1-jhou.stg.rhcloud.com 534bb98f2587c854bd0003dc]\> env|grep OPENSHIFT_REPO_DIR
OPENSHIFT_REPO_DIR=/var/lib/openshift/534bb98f2587c854bd0003dc/app-root/runtime/repo/

Comment 10 Jakub Hadvig 2014-04-15 08:39:20 UTC
The changes should be in STG now.
Putting on ON_QA

Comment 11 Wenjing Zheng 2014-04-16 06:52:47 UTC
Verified on INT (devenv_4681), OPENSHIFT_REPO_DIR/libs is in PERL5LIB now like below:
[perl-dm.int.rhcloud.com perl5lib]\> env|grep PERL5LIB
PERL5LIB=/var/lib/openshift/534e1dfb03ef64e50e000909/app-root/runtime/repo/libs:/var/lib/openshift/534e1dfb03ef64e50e000909/perl/perl5lib/lib/perl5/
[perl-dm.int.rhcloud.com perl5lib]\> env|grep OPENSHIFT_REPO_DIR
OPENSHIFT_REPO_DIR=/var/lib/openshift/534e1dfb03ef64e50e000909/app-root/runtime/repo/