Bug 1028960

Summary: Perl modules Image::Magick not building correctly. The openshift ImageMagick-perl version seem is not the latest CPAN version. When deploying,it will auto install,but failed.
Product: OpenShift Online Reporter: rexdf <rexdf>
Component: ImageAssignee: Michal Fojtik <mfojtik>
Status: CLOSED NEXTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: yadu
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: 2013-11-12 13:25:24 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:
Attachments:
Description Flags
the build.log none

Description rexdf 2013-11-11 10:55:24 UTC
Description of problem:
Perl modules Image::Magick not building correctly. The openshift ImageMagick-perl version seem is not the latest CPAN version. When deploying,it will auto install,but failed.

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


How reproducible:


Steps to Reproduce:
1.$rhc app create perl perl-10.0
2.$rhc git-clone perl
3.$vim perl/perl/index.pl
   And change it to following:
#!/usr/bin/perl
 
use Image::Magick;
 
print "Hello, world!";

4.$git push

Then we will see the error. And I didn't even leave blank in deplist.txt .



Actual results:

$ git push
Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 356 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Stopping Perl cartridge
remote: Waiting for stop to finish
remote: Building git ref 'master', commit 0da0981
remote: Building Perl cartridge
remote: --> Working on Image::Magick
remote: Fetching http://mirror1.ops.rhcloud.com/mirror/perl/CPAN/authors/id/J/JC/JCRISTY/PerlMagick-6.86.tar.gz ... OK
remote: Configuring PerlMagick-6.86 ... OK
remote: Building Image-Magick-6.86 ... FAIL
remote: ! Installing Image::Magick failed. See /var/lib/openshift/528093994382ecda4700021d/.cpanm/build.log for details.
remote: An error occurred executing 'gear postreceive' (exit code: 1)
remote: Error message: Failed to execute: 'control build' for /var/lib/openshift/528093994382ecda4700021d/perl
remote:
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://528093994382ecda4700021d.com/~/git/perl.git/
   c6d960f..0da0981  master -> master

Expected results:

It should use perllibs, but not try to download CPAN any thing!! I just want it to work.


Additional info:
$rhc ssh perl
[text-maoweiy.rhcloud.com 527fc7175973cadbb70005ac]\> perl -e "use Image::Magick; print Image::Magick->QuantumDepth"
16[text-maoweiy.rhcloud.com 527fc7175973cadbb70005ac]\>

So there is a ImageMagick-perl installed.

Comment 1 rexdf 2013-11-11 12:52:05 UTC
Created attachment 822390 [details]
the build.log

Comment 2 Michal Fojtik 2013-11-11 17:13:03 UTC
Hi,

I have pull request that fixes this problem:

https://github.com/openshift/origin-server/pull/4155

Comment 3 rexdf 2013-11-11 20:42:30 UTC
(In reply to Michal Fojtik from comment #2)
> Hi,
> 
> I have pull request that fixes this problem:
> 
> https://github.com/openshift/origin-server/pull/4155

When will it update? The problem still exists.

Comment 4 rexdf 2013-11-11 21:01:07 UTC
(In reply to Michal Fojtik from comment #2)
> Hi,
> 
> I have pull request that fixes this problem:
> 
> https://github.com/openshift/origin-server/pull/4155

I'm glad to see the patch

    if perl -e "use $f;" 2> /dev/null; then
echo "*** Skipping module $f install from CPAN (found in system)."
      echo "*** Please add $f to deplist.txt to install it from CPAN."
      continue;
    fi

if perl -e "use $f;" 2> /dev/null; then

the condition is opposite.

If there is a module installed 
then         perl -e "use $f;" 2> /dev/null;              is false.
And it will not exec continue

Comment 5 openshift-github-bot 2013-11-11 22:11:14 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/036e54c0cac5a70bf81f0c9a13a5de242bd297f4
Bug 1028960 - Prefer perl modules installed on system over CPAN install

Comment 6 Michal Fojtik 2013-11-11 22:27:40 UTC
The update will go live once the new version of OpenShift is released to production.

You can use --from-code if you want to use updated perl cartrige right now.

Comment 7 rexdf 2013-11-12 05:30:42 UTC
(In reply to Michal Fojtik from comment #6)
> The update will go live once the new version of OpenShift is released to
> production.
> 
> You can use --from-code if you want to use updated perl cartrige right now.

The bug still exists. The reproducible process works.

But maybe I temporary find a solution to this bug.

1.remove the deplist.txt
2. ssh to openshift
3. cpanm to install the dependency manually.

Comment 8 Yan Du 2013-11-12 10:37:48 UTC
Test on devenv_4022, issue has been fixed.


[root@localhost perl]# git add .; git commit -m"1";git push
[master c43d6b3] 1
 1 file changed, 6 insertions(+), 160 deletions(-)
 rewrite perl/index.pl (99%)
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 363 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
remote: Stopping Perl cartridge
remote: [Tue Nov 12 05:33:18 2013] [warn] PassEnv variable SHELL was undefined
remote: [Tue Nov 12 05:33:18 2013] [warn] PassEnv variable USER was undefined
remote: [Tue Nov 12 05:33:18 2013] [warn] PassEnv variable LOGNAME was undefined
remote: Waiting for stop to finish
remote: Building git ref 'master', commit c43d6b3
remote: Building Perl cartridge
remote: ***   Skipping module Image::Magick install from CPAN (found in system).
remote: ***   Please add Image::Magick to deplist.txt to install it from CPAN.
remote: Preparing build for deployment
remote: Deployment id is 3f63806d
remote: Activating deployment
remote: Starting Perl cartridge
remote: Result: success
remote: Activation status: success
remote: Deployment completed with status: success
To ssh://5282038ec465ee861b0000d3.rhcloud.com/~/git/perl.git/
   e78975d..c43d6b3  master -> master

Comment 9 rexdf 2013-11-12 13:25:24 UTC
I'm sorry that I don't know how to use --from-code.
So it should work until next update.