Bug 1018027 - Failed to create scalable application
Summary: Failed to create scalable application
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: ---
Assignee: Jason DeTiberus
QA Contact: libra bugs
URL:
Whiteboard:
: 1019495 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-11 03:24 UTC by Gaoyun Pei
Modified: 2017-03-08 17:35 UTC (History)
7 users (show)

Fixed In Version: ruby193-rubygem-json-1.7.3-5.el6op
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-16 09:11:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Gaoyun Pei 2013-10-11 03:24:04 UTC
Description of problem:
When trying to create a scalable app, got an error "Unexpected error: A JSON text must at least contain two octets!"

Version-Release number of selected component (if applicable):
2.0/2013-10-10.2

How reproducible:
Always

Steps to Reproduce:
1.create a scalable app via rhc client or REST API
[root@dhcp-8-133 workspace]# rhc app-create app3 jbosseap-6 --scaling
Application Options
-------------------
  Domain:     121
  Cartridges: jbosseap-6
  Gear Size:  default
  Scaling:    yes

Creating application 'app3' ... Unexpected error: A JSON text must at least contain two octets!

[root@dhcp-8-133 workspace]# curl -k -H 'Accept: application/xml' --user gpei:redhat  https://broker.ose1010.com.cn/broker/rest/domains/121/applications/ -d name=app4 -d cartridge=php-5.3 -d scale=true
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>unprocessable_entity</status>
  <type nil="true"></type>
  <data>
    <datum nil="true"></datum>
  </data>
  <messages>
    <message>
      <severity>error</severity>
      <text>Unexpected error: A JSON text must at least contain two octets!</text>
      <exit-code>1</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

Actual results:


Expected results:
Create scalable app successfully

Additional info:

Comment 2 nsun 2013-10-11 06:29:57 UTC
Access still failed on puddle [2.0/2013-10-10.2].

Comment 3 Jason DeTiberus 2013-10-14 16:54:45 UTC
Tagged and built a new puddle with ruby193-rubygem-json-1.7.3-5.el6op, the version of ruby193-rubygem-json shipped with the SCL fails to open an empty file.

Comment 4 Gaoyun Pei 2013-10-15 02:27:56 UTC
Still failed with ruby193-rubygem-json-1.7.3-5.el6op.x86_64 on puddle 2.0/2013-10-14.3

[root@dhcp-8-133 workspace]# rhc app create app1 jbosseap -s 
Using jbosseap-6 (JBoss Enterprise Application Platform 6.1.0) for 'jbosseap'

Application Options
-------------------
  Domain:     12345
  Cartridges: jbosseap-6
  Gear Size:  default
  Scaling:    yes

Creating application 'app1' ... 
Unable to complete the requested operation due to: undefined method `external_port' for nil:NilClass.
Reference ID: 2bed5d05babb61919fcdf200b0fe0184

Error logs in /var/log/ruby193-mcollective.log on node:
...
E, [2013-10-14T19:24:20.843480 #1403] ERROR -- : openshift.rb:313:in `rescue in with_container_from_args' System proxy set for 65231=>127.12.148.1:8080 failed(1): stdout: -I rhc-app-comm 1 -d 127.12.148.1 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65231
 stderr: iptables: No chain/target/match by that name.
: uid=6440
E, [2013-10-14T19:24:20.843762 #1403] ERROR -- : openshift.rb:314:in `rescue in with_container_from_args' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/frontend_proxy.rb:173:in `block in add'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/frontend_proxy.rb:153:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/frontend_proxy.rb:153:in `add'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-container-selinux-0.3.0/lib/openshift/runtime/containerization/selinux_container.rb:217:in `create_public_endpoint'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/application_container_ext/cartridge_actions.rb:204:in `create_public_endpoint'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/application_container_ext/cartridge_actions.rb:163:in `block in create_public_endpoints'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/application_container_ext/cartridge_actions.rb:154:in `each'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/application_container_ext/cartridge_actions.rb:154:in `create_public_endpoints'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:833:in `block in oo_expose_port'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:302:in `with_container_from_args'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:832:in `oo_expose_port'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:140:in `execute_action'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:196:in `block in execute_parallel_action'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:189:in `each'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:189:in `execute_parallel_action'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/agent.rb:86:in `handlemsg'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:126:in `block (2 levels) in dispatch'
/opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:125:in `block in dispatch'
...
...
E, [2013-10-14T19:24:21.374178 #1403] ERROR -- : openshift.rb:313:in `rescue in with_container_from_args' Backup file does not exist
E, [2013-10-14T19:24:21.374350 #1403] ERROR -- : openshift.rb:314:in `rescue in with_container_from_args' /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/gear_registry.rb:141:in `restore_from_backup'
/opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.16.0/lib/openshift-origin-node/model/application_container_ext/cartridge_actions.rb:1155:in `update_cluster'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:1000:in `block in oo_update_cluster'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:302:in `with_container_from_args'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:999:in `oo_update_cluster'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:140:in `execute_action'
/opt/rh/ruby193/root/usr/libexec/mcollective/mcollective/agent/openshift.rb:105:in `cartridge_do_action'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/rpc/agent.rb:86:in `handlemsg'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:126:in `block (2 levels) in dispatch'
/opt/rh/ruby193/root/usr/share/ruby/timeout.rb:69:in `timeout'
/opt/rh/ruby193/root/usr/share/ruby/mcollective/agents.rb:125:in `block in dispatch'
I, [2013-10-14T19:24:21.374498 #1403]  INFO -- : openshift.rb:151:in `execute_action' Finished executing action [update-cluster] (1)
I, [2013-10-14T19:24:21.382827 #1403]  INFO -- : openshift.rb:115:in `cartridge_do_action' cartridge_do_action failed (1)
------
Backup file does not exist
------)
...

Comment 5 Johnny Liu 2013-10-16 06:05:25 UTC
*** Bug 1019495 has been marked as a duplicate of this bug. ***

Comment 6 Miciah Dashiel Butler Masters 2013-10-17 21:22:42 UTC
From the debug output, it appears that the rhc-app-comm chain had not been created:

    E, [2013-10-14T19:24:20.843480 #1403] ERROR -- : openshift.rb:313:in `rescue in with_container_from_args' System proxy set for 65231=>127.12.148.1:8080 failed(1): stdout: -I rhc-app-comm 1 -d 127.12.148.1 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65231
     stderr: iptables: No chain/target/match by that name.

It turns out there was a tiny typo in the installation script that prevented it from creating the iptables chain.  That typo has been fixed by the following commit:

https://github.com/openshift/openshift-extras/commit/52519bf82fb2d9c32fc8d79872616922a9f59589

Comment 7 Gaoyun Pei 2013-10-18 02:30:11 UTC
Verify this bug with this fix.

Scalable app could be created successfully now.

[root@broker ~]# rhc app create app jbosseap -s
Using jbosseap-6 (JBoss Enterprise Application Platform 6.1.0) for 'jbosseap'

Application Options
-------------------
  Domain:     1
  Cartridges: jbosseap-6
  Gear Size:  default
  Scaling:    yes

Creating application 'app' ... done


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

Initialized empty Git repository in /root/app/.git/
The authenticity of host 'app-1.example.com (192.168.59.209)' can't be established.
RSA key fingerprint is 13:7f:0f:8a:d4:51:55:22:58:34:ce:f9:83:4c:da:ed.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'app-1.example.com' (RSA) to the list of known hosts.

Your application 'app' is now available.

  URL:        http://app-1.example.com/
  SSH to:     52609c9b6892df826b00003b.com
  Git remote: ssh://52609c9b6892df826b00003b.com/~/git/app.git/
  Cloned to:  /root/app

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

[root@broker ~]# rhc show-app app
app @ http://app-1.example.com/ (uuid: 52609c9b6892df826b00003b)
----------------------------------------------------------------
  Domain:  1
  Created: 10:27 PM
  Gears:   1 (defaults to small)
  Git URL: ssh://52609c9b6892df826b00003b.com/~/git/app.git/
  SSH:     52609c9b6892df826b00003b.com

  jbosseap-6 (JBoss Enterprise Application Platform 6.1.0)
  --------------------------------------------------------
    Scaling: x1 (minimum: 1, maximum: available) on small gears

  haproxy-1.4 (Web Load Balancer)
  -------------------------------
    Gears: Located with jbosseap-6

Comment 11 Gaoyun Pei 2013-10-31 04:24:40 UTC
Checked the latest installation script, the error was fixed.

Verified on puddle 2.0/2013-10-29.2, create scalable app successfully.


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