Bug 1026273 - Unclear error message returns when creating an application with "." or "_" in download cartridge "Name"
Unclear error message returns when creating an application with "." or "_" in...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
2.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michal Fojtik
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-04 05:14 EST by Qiushui Zhang
Modified: 2015-05-14 20:34 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-01-29 19:49:45 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
manifest file used (2.30 KB, text/x-vhdl)
2013-11-04 05:14 EST, Qiushui Zhang
no flags Details

  None (edit)
Description Qiushui Zhang 2013-11-04 05:14:53 EST
Created attachment 819044 [details]
manifest file used

Description of problem:
Prepare an download cartridge, with "." or "_" in cartridge name, for example:

Name: p.hp
Cartridge-Short-Name: PHP
Display-Name: PHP 5.3

Try to create an application with this download cartridge. It will fail, saying "Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server
ex-std-node2.stg.rhcloud.com.  This indicates an unexpected problem during the execution of your request.."


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

How reproducible:
always

Steps to Reproduce:
1. Prepare an download cartridge, with "." or "_" in cartridge name
2. Try to create an application with the download cartridge
rhc app create myapp https://raw.github.com/qiushui/php/master/metadata/manifest.yml
3.

Actual results:
The application will not be created. Error message are show, saying "Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server
ex-std-node2.stg.rhcloud.com.  This indicates an unexpected problem during the execution of your request.."

Expected results:
1. If the characters are not legal, we should return message similar to "Invalid manifest file from url 'https://raw.github.com/qiushui/php/master/metadata/manifest.yml' - 'p?hp' does not match
pattern /\A[a-z0-9](?:[-\.a-z0-9_]*[a-z0-9]|)\z/.: 'Name'"
So that user will know that their cartridge name is illegal.

2. If the characters are expected, the application should be created successfully.

Additional info:
The manifest.yml file used is added to the bug as an attachment.
Comment 1 Rajat Chopra 2013-11-04 14:42:04 EST
The configure call passes just fine. The post-configure fails. Because the cartridge 'name' check is not uniform.

Manifest check seems to allow '_', but v2_cart_model.rb:121 does not -

results = cartridge_name.scan(/([a-zA-Z\d-]+)-([\d\.]+)/).first

The above check is inconsistent with manifest parsing checks in - openshift-origin-common/models/manifest.rb:179
Comment 2 openshift-github-bot 2013-11-08 20:01:43 EST
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/094176408d1a2b9f0211caa05bd5f92cfdc068e6
Bug 1026273 - Allow the '_' character in cartridge name
Comment 4 Qiushui Zhang 2013-11-11 02:49:15 EST
Tested on devenv_4016.

I could create the application successfully with manifest.yml like the following:



---
Name: p_hp
Cartridge-Short-Name: PHP
Display-Name: PHP 5.3
Description: ! 'PHP is a general-purpose server-side scripting language originally
  designed for Web development to produce dynamic Web pages. Popular development frameworks
  include: CakePHP, Zend, Symfony, and Code Igniter.'
Version: '5.3'
License: The PHP License, version 3.0
License-Url: http://www.php.net/license/3_0.txt
Vendor: php.net
Cartridge-Version: 0.0.7
Compatible-Versions: []
Cartridge-Vendor: 88_qiushui
Categories:
- service
- php
- web_framework
Website: http://www.php.net
Help-Topics:
  Developer Center: https://www.openshift.com/developers
Cart-Data:
- Key: OPENSHIFT_TMP_DIR
  Type: environment
  Description: Directory to store application temporary files.
- Key: OPENSHIFT_REPO_DIR
  Type: environment
  Description: Application root directory where application files reside. This directory
    is reset every time you do a git-push
- Key: OPENSHIFT_PHP_PORT
  Type: environment
  Description: Internal port to which the web-framework binds to.
- Key: OPENSHIFT_PHP_IP
  Type: environment
  Description: Internal IP to which the web-framework binds to.
- Key: OPENSHIFT_APP_DNS
  Type: environment
  Description: Fully qualified domain name for the application.
- Key: OPENSHIFT_APP_NAME
  Type: environment
  Description: Application name
- Key: OPENSHIFT_DATA_DIR
  Type: environment
  Description: Directory to store application data files. Preserved across git-pushes.
    Not shared across gears.
- Key: OPENSHIFT_APP_UUID
  Type: environment
  Description: Unique ID which identified the application. Does not change between
    gears.
- Key: OPENSHIFT_GEAR_UUID
  Type: environment
  Description: Unique ID which identified the gear. This value changes between gears.
Provides:
- php-5.3
- php
Publishes:
  get-php-ini:
    Type: FILESYSTEM:php-ini
Subscribes:
  set-env:
    Type: ENV:*
    Required: false
  set-doc-url:
    Type: STRING:urlpath
    Required: false
Scaling:
  Min: 1
  Max: -1
Endpoints:
- Private-IP-Name: IP
  Private-Port-Name: PORT
  Private-Port: 8080
  Public-Port-Name: PROXY_PORT
  Protocols:
  - http
  - ws
  Options:
    primary: true
  Mappings:
  - Frontend: ''
    Backend: ''
    Options:
      websocket: true
  - Frontend: /health
    Backend: ''
    Options:
      health: true

#Source-Url: git://github.com/qiushui/php.git
#Source-Url: https://github.com/qiushui/php.git
#Source-Url: https://github.com/qiushui/php/raw/master/php.zip
#Source-Url: https://github.com/qiushui/php/raw/master/php.tar.gz
Source-Url: https://github.com/qiushui/php/raw/master/php.tar
#Source-Md5: d2149849f4a57fb06dc996db2cb03c2e
#Source-Url: file:///root/php/


Mark the bug as verified.

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