Bug 963828 - Error message with a Hash as the "field" attribute
Error message with a Hash as the "field" attribute
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Master (Show other bugs)
2.x
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Lili Nader
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-16 11:56 EDT by Fabiano Franz
Modified: 2015-05-14 20:54 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 23:59:03 EDT
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)

  None (edit)
Description Fabiano Franz 2013-05-16 11:56:43 EDT
Description of problem: 

When trying to create an app based on an invalid initial Git url the REST API will return a Hash where the field name attribute is expected. This is likely to happen in other REST API calls too. Example response body:

{
    "data": null, 
    "errors": {}, 
    "messages": [
        {
            "exit_code": 130, 
            "field": {
                "appInfoIO": [], 
                "cart_commands": [], 
                "data": "", 
                "debugIO": [], 
                "errorIO": [], 
                "exitcode": 130, 
                "hasUserActionableError": true, 
                "messageIO": [], 
                "properties": {}, 
                "resultIO": []
            }, 
            "severity": "error", 
            "text": "Source Code repository URL type must be one of: git:// http:// https:// file:// ftp:// ftps:// rsync://\n"
        }
    ], 
    "status": "unprocessable_entity", 
    "supported_api_versions": [
        1.0, 
        1.1, 
        1.2, 
        1.3, 
        1.4
    ], 
    "type": null, 
    "version": "1.4"
}

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

How reproducible: always

Steps to Reproduce:
1. curl -X POST -k --user "user:pass" https://openshift.redhat.com/broker/rest/domains/mydomain/applications -d "name=foo&cartridge=php-5.3&initial_git_url=bar" | python -mjson.tool
  
Actual results: message body with invalid "field" attribute in the JSON.

Expected results: the "field" attribute must return the field name involved in the error (in this case specifically 'git_initial_url').

Additional info:
Comment 2 Xiaoli Tian 2013-05-17 08:48:16 EDT
(In reply to comment #1)
> https://github.com/openshift/origin-server/pull/2519


Seems above pull request is for stage only, but seems no pull request for master, and related code is not merged in devenv_3238.
Comment 3 Rony Gong 2013-05-20 04:26:38 EDT
As comment2, I still can't find the code merged into the latest build devenv_3247
Comment 6 Rony Gong 2013-05-20 22:42:46 EDT
Verified on 3251 --PASS
[qgong@dhcp-8-154 dev]$ curl -X POST -k --user "qgong@redhat.com:pass" https://ec2-54-224-81-227.compute-1.amazonaws.com/broker/rest/domains/qgong4/applications -d "name=foo&cartridge=php-5.3&initial_git_url=bar" | python -mjson.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
143   241  120   241    0    46    174     33  0:00:01  0:00:01 --:--:--   596
{
    "data": null, 
    "errors": {}, 
    "messages": [
        {
            "exit_code": 216, 
            "field": "initial_git_url", 
            "severity": "error", 
            "text": "Invalid initial git URL"
        }
    ], 
    "status": "unprocessable_entity", 
    "supported_api_versions": [
        1.0, 
        1.1, 
        1.2, 
        1.3, 
        1.4
    ], 
    "type": null, 
    "version": "1.4"

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