Hide Forgot
Description of problem: When add invalid cartridge like "*##" to a exist app with the rhc 1.16.0, it reveals some error messages as follow: /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:54:in `match_cart': invalid regular expression; there's no previous pattern, to which '*' would define cardinality at 3: /\b*##\b/ (RegexpError) from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/application.rb:64:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `each' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `match_cart' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `select' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:9:in `map' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:9:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/cartridge.rb:310:in `cartridge_action' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/cartridge.rb:153:in `stop' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `send' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `execute' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:276:in `to_commander' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:383:in `run_active_command' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/command_runner.rb:73:in `run!' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cli.rb:37:in `start' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/bin/rhc:20 from /usr/bin/rhc:23:in `load' from /usr/bin/rhc:23 But if the Client is "rhc 1.15.6", it reveals "There are no cartridges that match '*##'". Version-Release number of selected component (if applicable): devenv_3885 rhc 1.16.0 How reproducible: always Steps to Reproduce: 1. Create a app #rhc app create app2 jbossews-1.0. 2. Try to add/stop/reload/start/restart an invalid cartridge to the app #rhc cartridge add *## -a app2 Actual results: /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:54:in `match_cart': invalid regular expression; there's no previous pattern, to which '*' would define cardinality at 3: /\b*##\b/ (RegexpError) from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/rest/application.rb:64:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `each' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:53:in `match_cart' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `select' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:9:in `map' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cartridge_helpers.rb:9:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/cartridge.rb:310:in `cartridge_action' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands/cartridge.rb:153:in `stop' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `send' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:285:in `execute' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/commands.rb:276:in `to_commander' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:383:in `run_active_command' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/command_runner.rb:73:in `run!' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/lib/rhc/cli.rb:37:in `start' from /usr/lib/ruby/gems/1.8/gems/rhc-1.16.0/bin/rhc:20 from /usr/bin/rhc:23:in `load' from /usr/bin/rhc:23 Expected results: There are no cartridges that match '*##' Additional info:
I can't reproduce this on rhc version 1.16.9, can you re-test and see if you are still able to recreate it.
[weinan@dhcp-65-25 test]$ rhc --version rhc 1.17.0 [weinan@dhcp-65-25 test]$ rhc app show pl pl @ http://pl-nweidomain.ose-1107.com.cn/ (uuid: 5282045e37df70e4c2000464) --------------------------------------------------------------------------- Domain: nweidomain Created: Nov 12 6:35 PM Gears: 1 (defaults to small) Git URL: ssh://5282045e37df70e4c2000464.com.cn/~/git/pl.git/ SSH: 5282045e37df70e4c2000464.com.cn Deployment: auto (on git push) perl-5.10 (Perl 5.10) --------------------- Gears: Located with jenkins-client-1 jenkins-client-1 (Jenkins Client) --------------------------------- Gears: Located with perl-5.10 Job URL: https://jk-nweidomain.ose-1107.com.cn/job/pl-build/ [weinan@dhcp-65-25 test]$ rhc cartridge add *## -a pl /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:54:in `match_cart': invalid regular expression; there's no previous pattern, to which '*' would define cardinality at 3: /\b*##\b/ (RegexpError) from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/rest/client.rb:506:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:53:in `each' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:53:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:53:in `match_cart' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:15:in `select' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:9:in `map' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cartridge_helpers.rb:9:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/commands/cartridge.rb:78:in `add' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/commands.rb:285:in `send' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/commands.rb:285:in `execute' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/commands.rb:276:in `to_commander' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:383:in `run_active_command' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/command_runner.rb:73:in `run!' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/lib/rhc/cli.rb:37:in `start' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.0/bin/rhc:20 from /usr/bin/rhc:19:in `load' from /usr/bin/rhc:19 It can reproduce this on rhc version 1.17.0.
[weinan@dhcp-65-25 test]$ rhc --version rhc 1.17.4 [weinan@dhcp-65-25 test]$ rhc cartridge add *## -a pl /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:54:in `match_cart': invalid regular expression; there's no previous pattern, to which '*' would define cardinality at 3: /\b*##\b/ (RegexpError) from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/rest/client.rb:506:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:53:in `each' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:53:in `any?' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:53:in `match_cart' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:15:in `select' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:15:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:9:in `map' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cartridge_helpers.rb:9:in `check_cartridges' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/commands/cartridge.rb:79:in `add' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/commands.rb:285:in `send' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/commands.rb:285:in `execute' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/commands.rb:276:in `to_commander' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:383:in `run_active_command' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/command_runner.rb:73:in `run!' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/lib/rhc/cli.rb:37:in `start' from /usr/lib/ruby/gems/1.8/gems/rhc-1.17.4/bin/rhc:20 from /usr/bin/rhc:19:in `load' from /usr/bin/rhc:19
Specific to ruby 1.8, will add test and fix
Will merge in https://github.com/openshift/rhc/pull/511
Commit pushed to master at https://github.com/openshift/rhc https://github.com/openshift/rhc/commit/557c8d0e4c71782cab99b7614909fd47d5d3ca95 Fix bug 1018077: Regex-breaking cartridge name search
Version-Release number of selected component (if applicable): int.openshift.redhat.com rhc 1.17.5 [weinan@dhcp-65-25 test]$ rhc app create ruby18 ruby-1.8 [weinan@dhcp-65-25 test]$ rhc cartridge add *## -a ruby18 Short Name Full name ========== ========= cron-1.4 Cron 1.4 jenkins-client-1 Jenkins Client mysql-5.1 MySQL 5.1 postgresql-8.4 PostgreSQL 8.4 postgresql-9.2 PostgreSQL 9.2 haproxy-1.4 Web Load Balancer There are no cartridges that match '*##'. [weinan@dhcp-65-25 test]$ rhc cartridge add @##~*#####$~~~% -a ruby18 Short Name Full name ========== ========= cron-1.4 Cron 1.4 jenkins-client-1 Jenkins Client mysql-5.1 MySQL 5.1 postgresql-8.4 PostgreSQL 8.4 postgresql-9.2 PostgreSQL 9.2 haproxy-1.4 Web Load Balancer There are no cartridges that match '@##~*#####$~~~%'.