Bug 980253 - Validate cartridge version
Summary: Validate cartridge version
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-01 21:23 UTC by Dan McPherson
Modified: 2015-05-14 23:22 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-07 22:54:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan McPherson 2013-07-01 21:23:01 UTC
Description of problem:

According to the writers guide, cart versions should be of the form:

<number>[.<number>[.<number>[...]]]


But we don't validate against this in the runtime.  It should fail if you have letters in your versions for example.

Comment 1 Jhon Honce 2013-07-02 22:32:39 UTC
Fixed in https://github.com/openshift/origin-server/pull/2979

Comment 2 Xiaoli Tian 2013-07-09 05:56:58 UTC
(In reply to Jhon Honce from comment #1)
> Fixed in https://github.com/openshift/origin-server/pull/2979

Hi, Jhon

Just fyi that above pull request has failed the merge testing, not sure if you've already noted.

Thanks for checking.

Comment 3 Xiaoli Tian 2013-07-10 03:01:35 UTC
Assign it back to get more attention since related pull request is not merged yet.

Comment 4 Jhon Honce 2013-07-10 21:07:19 UTC
Fixed in https://github.com/openshift/origin-server/pull/2979

Comment 5 openshift-github-bot 2013-07-11 00:57:24 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/d9323dfffe5e57b3fa427e726e08ad2d37ae0d66
Bug 980253 - Validate version numbers from manifest

* Add Manifest.sort_versions to sort version numbers meaningfully
* Rebase for LXC container

Comment 6 Yan Du 2013-07-11 10:52:15 UTC
test on devenv_3483, there is warning message shown when create app with invalid version cartridge. but the Reference ID should not be shown 


steps:
1. prepare a download cartridge, eg: ruby
2. change the Versions: ['1.9', '1.8'] in manifest.yml 
   (eg: change to Versions: ['a1.9', '1.8'])
3. create the app with download cartridge prepared in step1&2
4. modify the Version: '1.9' in manifest.yml 
   (eg:change to Version: '1.9c')
5. create the app with download cartridge again
6. modify the  Cartridge-Version number 0.0.4 in manifest.yml
   (eg: change to Cartridge-Version number 0.a0.4 )
7. repeat step5


step3:
[root@ip-10-147-221-130 dyruby]# rhc app create -a rubyapp1 https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml -l yaXX -p XXX
The cartridge 'https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml' will be downloaded and
installed

Application Options
-------------------
  Namespace:  ccc
  Cartridges: https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'rubyapp1' ... 
Unable to complete the requested operation due to: Version number a1.9 is invalid: 'Versions'.
Reference ID: fc7fcc40313e61a65b8527858b60dc5e


step5:
[root@ip-10-147-221-130 dyruby]# rhc app create -a rubyapp1 https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml -l yaXX -p XXX
The cartridge 'https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml' will be downloaded and
installed

Application Options
-------------------
  Namespace:  ccc
  Cartridges: https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'rubyapp1' ... 
Unable to complete the requested operation due to: Version number 1.9c is invalid: 'Version'.
Reference ID: 49e1d03ec479debf2c6478e5fa701417


step7:
[root@ip-10-147-221-130 dyruby]# rhc app create -a rubyapp1 https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml -l yaXX -p XXX
The cartridge 'https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml' will be downloaded and
installed

Application Options
-------------------
  Namespace:  ccc
  Cartridges: https://raw.github.com/duyanyan/dyruby/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'rubyapp1' ... 
Unable to complete the requested operation due to: Cartridge-Version number 0.a0.4 is invalid: 'Version'.
Reference ID: 0e00e7c95fb314dc0a37b670eb60786c

Comment 7 openshift-github-bot 2013-07-16 21:08:35 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/0fa67c104e4cf0a6e7ad79d588dd3520925801d2
Bug 980253 - Map illegal versions to 0.0.0

* Raising exception broke CDK which uses illegal version numbers

Comment 8 Qiushui Zhang 2013-07-29 03:26:05 UTC
According to defect 988727, we should not use invalid cartridge version.

Comment 9 Qiushui Zhang 2013-07-29 04:15:28 UTC
If invalid cartridge version used, error message pops up, for example,
"cp: cannot stat `/var/lib/openshift/51f5d7e16cec0e27be000235/perl//versions/0.0.0/etc/*': No such file or directory"

Comment 10 Jhon Honce 2013-07-29 15:47:29 UTC
The CDK created invalid cartridge version numbers and to continue to support those cartridges created by the CDK we now map invalid cartridge numbers to 0.0.0.

For this test to work you must support version 0.0.0.

Comment 11 Meng Bo 2013-07-30 12:03:04 UTC
For custom cartridge with invalid version format, it will redirect to 0.0.0 and popup error about dir does not exist.

Manually create 0.0.0 dir under versions dir. App will be created successfully.

[root@dhcp-10-180 openshiftest]# rhc app create appperl https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml
The cartridge 'https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml' will be downloaded and installed

Application Options
-------------------
  Namespace:  bmengdev
  Cartridges: https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'appperl' ... cp: cannot stat `/var/lib/openshift/109784612893244197437440/perl//versions/0.0.0/etc/*': No such file or directory
[root@dhcp-10-180 openshiftest]# rhc app create appperl https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml
The cartridge 'https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml' will be downloaded and installed

Application Options
-------------------
  Namespace:  bmengdev
  Cartridges: https://github.com/bmeng/bmeng_cart_perl/raw/master/metadata/manifest.yml
  Gear Size:  default
  Scaling:    no

Creating application 'appperl' ... done


Waiting for your DNS name to be available ... done

Cloning into 'appperl'...
Warning: Permanently added 'appperl-bmengdev.dev.rhcloud.com' (RSA) to the list of known hosts.

Your application 'appperl' is now available.

  URL:        http://appperl-bmengdev.dev.rhcloud.com/
  SSH to:     a5d08c24f90f11e299cc12313d2d26a2.rhcloud.com
  Git remote: ssh://a5d08c24f90f11e299cc12313d2d26a2.rhcloud.com/~/git/appperl.git/
  Cloned to:  /root/openshiftest/appperl

Run 'rhc show-app appperl' for more details about your app.


Move bug to verified.


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