Bug 1026652 - openshift-origin-cartridge-perl/bin/build tries to update dependencies it cannot build (DB_File)
openshift-origin-cartridge-perl/bin/build tries to update dependencies it can...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michal Fojtik
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-05 02:15 EST by mephinet
Modified: 2015-05-14 20:34 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-29 19:49:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mephinet 2013-11-05 02:15:21 EST
In order to get a simple persistent cache for my database update script in my perl-cartridge based openshift app, I decided to use DB_File. As it's part of perl 5, I did not add it to the deplist.txt. However, after a git push, deploying fails. It turns out that the reason for this is that the deploy script detects DB_File as a depencency and adds it to the modules to be cpanm'ed. cpanm realizes that the DB_File of perl5 is not up-to-date (1.820 vs. 1.830) and tries to install it - resulting in:

Note (probably harmless): No library found for -ldb
...
version.c:30:16: error: db.h: No such file or directory

This makes it impossible to use DB_File with openshift. Possible solutions I could think of:
* Excluding this module from the update list
* More general, adding a blocklist.txt for purposes where I do not want to have a dependency updated
* installing db-devel on the openshift nodes so that building DB_File is successful

Steps to reproduce:

* create an empty perl cartridge
* add a script to the repository that contains "use DB_File;"
* call git push

Expected result:
* git push is successful

Actual result:
* git push fails when trying to update DB_File
Comment 4 Michal Fojtik 2013-11-06 15:16:37 EST
I reproduced this issues on devenv, after installing db4-devel I was able to successfully push the perl app with 'use DB_File;'. The DB_File module is compiled without errors.

remote: Building Perl cartridge
remote: --> Working on DB_File
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/DB_File-1.830.tar.gz ... OK
remote: Configuring DB_File-1.830 ... OK
remote: Building DB_File-1.830 ... OK
remote: Successfully installed DB_File-1.830 (upgraded from 1.820)
remote: 1 distribution installed
remote: Preparing build for deployment
remote: Deployment id is b450a780
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://527aa2e1f3f3dddb1e0004b2@perl01-mfojtik.dev.rhcloud.com/~/git/perl01.git/
   8efe8b2..4bc1948  master -> master
Comment 5 Michal Fojtik 2013-11-06 15:20:55 EST
mephinet: I asked Operations guys to push the -devel RPM into OpenShift Online. We will update this bug once it will be ready for consumption. Thanks for reporting this one!
Comment 6 Dan McPherson 2013-11-06 15:29:59 EST
@michal  I think you want to add the require to the rpm.
Comment 7 mephinet 2013-11-06 15:49:05 EST
Great, thanks!
Comment 10 Michal Fojtik 2013-11-07 04:56:37 EST
Meng Bo: Can you please try again? I think I was too fast setting this bug ON_QA. Sorry.
Comment 11 Meng Bo 2013-11-08 01:06:00 EST
Checked on devenv_4003, issue has been fixed.

remote: Building Perl cartridge
remote: --> Working on DB_File
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/DB_File-1.830.tar.gz ... OK
remote: Configuring DB_File-1.830 ... OK
remote: Building DB_File-1.830 ... OK
remote: Successfully installed DB_File-1.830 (upgraded from 1.820)
remote: 1 distribution installed
remote: Preparing build for deployment
remote: Deployment id is 595a81f1
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success

Move bug to verified.
Comment 12 Yan Du 2013-12-24 22:21:26 EST
Test on devenv_4170

create a perl app, add "use DB_File;" to index.pl, and git push 

remote: Building Perl cartridge
remote: ***   Skipping module DB_File install from CPAN (found in system).
remote: ***   Please add DB_File to deplist.txt to install it from CPAN.
remote: Preparing build for deployment
remote: Deployment id is 50ef05d2
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success


then add DB_File to deplist.txt and push again, still show the above information.
Comment 13 Michal Fojtik 2014-01-03 08:52:26 EST
remote: Building Perl cartridge
remote: ***   Skipping module DB_File install from CPAN (found in system).

this means the module was found in system which is what we want :-)
Comment 14 mephinet 2014-01-03 08:59:17 EST
I disagree, it does not work as advertised, as the next line states:

remote: ***   Please add DB_File to deplist.txt to install it from CPAN.

which is what I want to do (because the one found in system is too old for my requirements).
Comment 15 Michal Fojtik 2014-01-03 09:56:38 EST
mephinet: Ah I see, so specifying the module in deplist does not work when the module is found in system. I will take a look.
Comment 16 Michal Fojtik 2014-01-03 10:12:56 EST
https://github.com/openshift/origin-server/pull/4410

This should fix the problem, with this fix all system/local checks are disabled when the module is listed in deplist.txt.
Comment 17 mephinet 2014-01-05 12:43:19 EST
Your fix looks good (it seems to me as if this rather addresses #1046753 then the DB_File issue, though)
Comment 18 openshift-github-bot 2014-01-06 06:44:41 EST
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/605a838475bab6ab1cf6dcbe1cb26aae5cb83b5a
Bug 1026652 - Skip module checks if module exists in perl deplist.txt
Comment 19 Yan Du 2014-01-06 21:28:28 EST
Test on devenv_4191, 

1. Create a perl app, add "use DB_File;" to index.pl, and git push

remote: Stopping Perl cartridge
remote: [Mon Jan 06 21:25:17 2014] [warn] PassEnv variable SHELL was undefined
remote: [Mon Jan 06 21:25:17 2014] [warn] PassEnv variable USER was undefined
remote: [Mon Jan 06 21:25:17 2014] [warn] PassEnv variable LOGNAME was undefined
remote: Waiting for stop to finish
remote: Building git ref 'master', commit bd58898
remote: Building Perl cartridge
remote: ***   Skipping module DB_File install from CPAN (found in system).
remote: ***   Please add DB_File to deplist.txt to install it from CPAN.
remote: Preparing build for deployment
remote: Deployment id is 6e0e71e5
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://52cb64d70b8a3a3c3a000007@perl-111.dev.rhcloud.com/~/git/perl.git/
   a5231c8..bd58898  master -> master

2. Add DB_File to deplist.txt and push again

remote: Stopping Perl cartridge
remote: Waiting for stop to finish
remote: Building git ref 'master', commit b58ce55
remote: Building Perl cartridge
remote: --> Working on DB_File
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/P/PM/PMQS/DB_File-1.831.tar.gz ... OK
remote: Configuring DB_File-1.831 ... OK
remote: Building DB_File-1.831 ... OK
remote: Successfully installed DB_File-1.831 (upgraded from 1.820)
remote: 1 distribution installed
remote: Preparing build for deployment
remote: Deployment id is b7cfa1e3
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://52cb64d70b8a3a3c3a000007@perl-111.dev.rhcloud.com/~/git/perl.git/
   bd58898..b58ce55  master -> master


Issue have been fixed. Move to verified. Thanks.

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