Bug 796287 - [REST API] POST app with empty name returns 500 error, stack trace
Summary: [REST API] POST app with empty name returns 500 error, stack trace
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Lili Nader
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-22 15:59 UTC by Clayton Coleman
Modified: 2015-05-15 01:46 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-02 21:56:20 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Clayton Coleman 2012-02-22 15:59:24 UTC
Looks like there is a missing validation check on empty application names - server returns a 500 instead of 422 with error.

Started POST "/broker/rest/domains/domain23/applications.json" for 127.0.0.
1 at Wed Feb 22 10:54:28 -0500 2012
  Processing by ExtendedApplicationsController#create as JSON
  Parameters: {"name"=>"", "cartridge"=>"raw-0.1", "domain_id"=>"domain23",
 "application_type"=>"raw-0.1"}
MongoDataStore.find(CloudUser, test4, test4)

DEBUG: [#<MCollective::RPC::Result:0x7fed29ea2478 @results={:data=>{:output
=>".  Please destroy then recreate, or pick a new name: /var/lib/libra/e21b
c598280a4c9680e182adfff04624/\n", :exitcode=>132}, :statusmsg=>"cartridge_d
o_action failed 132.  Output .  Please destroy then recreate, or pick a new
 name: /var/lib/libra/e21bc598280a4c9680e182adfff04624/\n", :statuscode=>1,
 :sender=>"ip-10-224-27-88"}, @action="cartridge_do", @agent="libra">]
DEBUG: server results: .  Please destroy then recreate, or pick a new name:
 /var/lib/libra/e21bc598280a4c9680e182adfff04624/
Node execution failure (invalid exit code from node).  If the problem persi
sts please contact Red Hat support.
#<Cloud::Sdk::NodeException: Node execution failure (invalid exit code from
 node).  If the problem persists please contact Red Hat support.>
["/var/www/libra/broker/lib/express/broker/application_container_proxy.rb:858:in `run_cartridge_command'", "/var/www/libra/broker/lib/express/broker/application_container_proxy.rb:184:in

Comment 1 Meng Bo 2012-02-27 06:26:37 UTC
verified on devenv_1642,
the return is as following:
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>unprocessable_entity</status>
  <data nil="true"></data>
  <messages>
    <message>
      <field>name</field>
      <exit-code>105</exit-code>
      <severity>error</severity>
      <text>Application name is required and cannot be blank</text>
    </message>
  </messages>
  <version>1.0</version>
  <type nil="true"></type>
</response>

Mark bug as VERIFIED.


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