Bug 1102428

Summary: Ruby cartridge upgrades fail in INT because of .openshift dir->symlink change
Product: OpenShift Online Reporter: Andy Goldstein <agoldste>
Component: ImageAssignee: Vojtech Vitek <vvitek>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: chunchen, hripps, jhonce, jokerman, mmccomas
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:29:48 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:

Description Andy Goldstein 2014-05-29 00:05:12 UTC
Description of problem: Gears using the ruby cartridge fail to upgrade in INT


Version-Release number of selected component (if applicable): openshift-origin-cartridge-ruby-1.25.3-1.el6oso.noarch


How reproducible: 100%


Steps to Reproduce:
1. Create a ruby app prior to upgrading to openshift-origin-cartridge-ruby-1.25.3-1.el6oso.noarch
2. Run gear upgrades

Actual results:

Unhandled shell exception performing step: Shell command '/bin/cp -ad /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/run /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/bin /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/lib /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/logs /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/COPYRIGHT /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/env /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/LICENSE /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/metadata /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/versions /var/lib/openshift/.cartridge_repository/redhat-ruby/0.0.18/README.md /var/lib/openshift/5385e3836cec0e279700009e/ruby' returned an error. rc=1\nreturn code: 1\nstdout: \nstderr: /bin/cp: cannot overwrite directory `/var/lib/openshift/5385e3836cec0e279700009e/ruby/versions/1.9/template/.openshift' with non-directory\n/bin/cp: cannot overwrite directory `/var/lib/openshift/5385e3836cec0e279700009e/ruby/versions/1.8/template/.openshift' with non-directory\n


Expected results: No errors


Additional info:

The fix for https://bugzilla.redhat.com/show_bug.cgi?id=1101779 only fixed the directories in the cartridge repository. It did not fix live gears on the nodes. I believe we'll need to create an upgrade script for ruby that performs similar logic to https://github.com/openshift/origin-server/commit/33b149e66f8dda2f593b4779066766f514ff4344, but have it work on gears instead of the cartridge repository.

Comment 1 Vojtech Vitek 2014-05-29 12:54:46 UTC
Seems like I can't use the upgrade script to fix this, as it's run after the new version of the cartridge is overlaid in the gear (that's where the `cp' error comes from).
http://openshift.github.io/documentation-latest/oo_cartridge_developers_guide.html#compatible-upgrades

I think I need to mark the upgrade incompatible and put the affected directories into setup_rewritten section of the cartridge's managed_files.yml for it's removal.

Comment 2 Vojtech Vitek 2014-05-29 13:29:32 UTC
https://github.com/openshift/origin-server/pull/5461

Comment 3 openshift-github-bot 2014-05-29 15:43:57 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/b759b4537047f3db4dc6caab40421b475fd95ed7
Fix bug 1102428

Remove directories that are to be replaced by symlinks
when the new version of cartridge is overlaid into gear.

Note: Mark ruby for incompatible upgrade.

https://bugzilla.redhat.com/show_bug.cgi?id=1102428

Comment 4 chunchen 2014-05-30 09:00:55 UTC
Checked it when upgrading from devenv_stage_837 to devenv_stage_861, the issue is fixed, so mark it as VERIFIED.

FYI: After upgrading, the latest ruby cartridge package version is openshift-origin-cartridge-ruby-1.25.4-1.el6oso.noarch