Bug 971403 - [upgrade] perl app fail to git push after migrate
Summary: [upgrade] perl app fail to git push after migrate
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 1.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Johnny Liu
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-06 12:46 UTC by Johnny Liu
Modified: 2017-03-08 17:35 UTC (History)
4 users (show)

Fixed In Version: openshift-origin-cartridge-perl-0.4.8-1.el6op
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-28 15:47:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Johnny Liu 2013-06-06 12:46:08 UTC
Description of problem:
After upgrade, do git push in perl app repo.
[jialiu@jialiu-pc1 perlapp]$ git commit -a -mx; git push
[master 75e44da] x
 1 file changed, 1 insertion(+), 1 deletion(-)
Warning: Permanently added 'perlapp-jialiu.ose11test.com,10.4.59.180' (RSA) to the list of known hosts.
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 340 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: httpd (no pid file) not running
remote: Can't write to cpanm home '/.cpanm': You should fix it with chown/chmod first.
remote: An error occurred executing 'gear postreceive'
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://78c9f478adec43b89b0c4550bbc035ac.com/~/git/perlapp.git/
   af5bb3e..75e44da  master -> master


Version-Release number of selected component (if applicable):
1.2/2013-06-05.9

How reproducible:
Always

Steps to Reproduce:
1. Setup ose-1.1.3 env
2. Create a perl app
3. Following http://etherpad.corp.redhat.com/OSE-1-2-upgrade-notes to do upgrade testing
4. After upgrade, in app repo, do some change to git push.

Actual results:
Fail to git push

Expected results:
git push should PASS.

Additional info:

Comment 2 John W. Lamb 2013-06-07 21:12:52 UTC
The "appname.git" directory in the scaled gear folder(s) differs from that in the base gear folder, post-upgrade.

Comment 3 Johnny Liu 2013-06-09 03:01:05 UTC
This is a non-scalable app, it is not relative with scalable or non-scalable.

I am using the following script to create perl test app, give the git url for you, maybe it is helpful to reproduce it.

$ git clone git://qe-git.englab.nay.redhat.com/hss-qe/openshift/openshift-express/automation
$ cd automation/prepare_testing_data/
$ ./create_test_data.sh

Comment 4 John W. Lamb 2013-06-11 21:34:25 UTC
Could not replicate with a non-scaled perl app. git push for scaled perl app failed, but that seems to be an unrelated bug.

Will look more closely at this to determine if it was fixed by any recent merges.

Comment 5 Luke Meyer 2013-06-13 19:34:06 UTC
I managed to get this from my testbed, with the scaled "perls" app owned by "loaded". I had to remove the jenkins plugin, since that doesn't work, but then with pushing a whitespace change, I got:

remote: + rsync -v --delete-after -az /var/lib/openshift/57906ebbec3341e9a01beb10b7ad2526/perl//perl5lib/ e661ff483fe543a1b4891cf1250ba01b.59.187:perl-5.10/perl5lib/
remote: building file list ... done
remote: 
remote: sent 123 bytes  received 12 bytes  38.57 bytes/sec
remote: total size is 0  speedup is 0.00
remote: + for subd in '"${OPENSHIFT_SYNC_GEARS_DIRS[@]}"'
remote: + '[' -d /var/lib/openshift/57906ebbec3341e9a01beb10b7ad2526/perl//phplib ']'
remote: + for rpccall in '"${OPENSHIFT_SYNC_GEARS_POST[@]}"'
remote: + ssh e661ff483fe543a1b4891cf1250ba01b.59.187 'gear remotedeploy'
remote: No such file or directory - /var/lib/openshift/e661ff483fe543a1b4891cf1250ba01b/git/perls.git
remote: Exit code: 
remote: An error occurred executing 'gear postreceive'
remote: 
remote: For more details about the problem, try running the command again with the '--trace' option.
To ssh://57906ebbec3341e9a01beb10b7ad2526.example.com/~/git/perls.git/

Not certain it's related...

Comment 6 John W. Lamb 2013-06-14 22:02:38 UTC
I really can't reproduce this for non-scaled perl apps, even using the create_test_data.sh script. Please review the ticket and include more detailed instructions to reproduce.

Comment 8 John W. Lamb 2013-06-18 18:30:54 UTC
I was able to reproduce this bug yesterday. The key to reproducing it is to deploy an app that has CPAN dependencies. I used this quickstart to meet this requirement: https://github.com/openshift/dancer-example

This bug arises because the HOME env var is empty in the post-migration app, and the perl cartridge bin/build script references the .cpanm directory like so:
  rm -rf  ${OPENSHIFT_PERL_DIR}/perl5lib/* ~/.cpanm/*
which expands to "/.cpanm/*". It should actually be "${OPENSHIFT_HOME_DIR}/.cpanm/*"

This script probably needs to be fixed (this is also upstream in Origin) but the bug will be masked when the fix for https://bugzilla.redhat.com/show_bug.cgi?id=972394 is merged into enterprise. That fix will populate a migrated app with env vars that are created for v2 carts but which (to this point) have been missing from migrated v1 carts. Among these is $HOME, which will be the same value as $OPENSHIFT_HOME_DIR.

Comment 9 John W. Lamb 2013-06-18 19:02:54 UTC
Actually 2 problems; the first is the rm command, the second is the invocation of cpanm at the bottom of the script. That line needs to be fixed by ensuring $HOME is set appropriately, since we can't/shouldn't control the internals of the cpanm script.

Comment 10 John W. Lamb 2013-06-18 20:07:41 UTC
Fix merged in https://github.com/openshift/enterprise-server/pull/86

Comment 11 Luke Meyer 2013-06-20 18:06:51 UTC
Building in puddle now.
openshift-enterprise-upgrade-1.2-1.git.80.4490c24.el6op

Comment 12 Johnny Liu 2013-06-21 11:22:12 UTC
Verified this bug with openshift-origin-cartridge-perl-0.4.8-1.el6op.noarch in 1.2/2013-06-20.5, and PASS.

Now git push for perl app that has CPAN dependencies successfully.

Comment 13 Luke Meyer 2013-06-28 15:47:32 UTC
Closing all bugs introduced, fixed, and verified during 1.2 release work (thus never shipped).


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