Bug 1122027 - unspecified error when creating app based on custom cartridge [NEEDINFO]
Summary: unspecified error when creating app based on custom cartridge
Keywords:
Status: CLOSED EOL
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 11:55 UTC by Oleg Fayans
Modified: 2017-01-13 22:49 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-13 22:49:19 UTC
mmasters: needinfo? (ofayans)


Attachments (Terms of Use)
broker log (46.14 KB, application/octet-stream)
2014-07-22 11:55 UTC, Oleg Fayans
no flags Details

Description Oleg Fayans 2014-07-22 11:55:06 UTC
Created attachment 919889 [details]
broker log

Description of problem:
I have created and successfully installed a custom cartridge for R language, named "shiny". When I try to create a new app with this cartridge, I get the following error:

$ rhc app create dontfail shiny-1.1
Application Options
-------------------
Domain:     testr
Cartridges: shiny-1.1
Gear Size:  default
Scaling:    no

Creating application 'dontfail' ... 
Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server ip-10-136-69-171.  This indicates an unexpected problem during the execution of your
request.
Reference ID: 9042a5800bccd0956437d8f0bbc82d63

The logs also do not tell much, except that post-configure action failed saying: "No such file or directory - chdir"

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


How reproducible:
Always

Steps to Reproduce:
1. in Enterprise or Origin: yum install R -y
2. R -e "install.packages('shiny', repos='http://cran.rstudio.com/')"
3. wget http://download3.rstudio.org/centos-6.3/x86_64/shiny-server-1.2.1.362-x86_64.rpm
4. yum install --nogpgcheck shiny-server-1.1.0.49-x86_64.rpm
5. cp /opt/shiny-server/config/init.d/redhat/shiny-server /etc/init.d/
6. chkconfig --level 345 shiny-server on
7. git clone git@github.com:ofayans/shiny_cartridge.git
8. oo-admin-cartridge --action install --source shiny_cartridge
9. service ruby193-mcollective restart
10. oo-broker oo-admin-broker-cache --clear --console
11. oo-broker oo-admin-ctl-cartridge -c import-node --activate
12. oo-broker oo-admin-broker-cache --clear
13. on a remote machine with configured client tools:
    rhc app create testapp shiny-1.1

Actual results:

Error message displayed: Unable to complete the requested operation due to: An invalid exit code (1) was returned from the server

Expected results:

Most probably the problem is with the cartridge configuration. It would be nice if the system would give somewhat more meaningful information about what went wrong. Like "the cartridge is missing a control script" or something like that

Additional info:

Comment 2 Brenton Leanhardt 2014-07-22 13:05:58 UTC
Hi Chris,

How did you install OpenShift Enterprise?  In your broker logs I see a stack track containing: /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-msg-broker-mcollective-1.26.2/lib/openshift/mcollective_application_container_proxy.rb:2767

That's newer than any version we ship in OpenShift Enterprise.

As for debugging the cartridge, sometimes you have to resort to binary search and add debugging information in places where you think the problem might exist.

Another challenge for debugging these situations is that the gear is often cleaned up on failure so there's nothing to manually inspect.  Since you have root on the Broker (and if this is a development environment) you can modify the Broker to disable rollbacks.  You could try commenting out this code:
https://github.com/openshift/origin-server/blob/master/controller/app/models/application.rb#L1738.

I took a look at your cartridge source and it wasn't obvious to me where "No such file or directory - chdir" could be coming from.  Since chdir isn't a command on RHEL it makes me think something is likely being passed to a shell that is not bash.  It's going to be tricky to track down but the error will likely be something simple.

Comment 3 Oleg Fayans 2014-07-22 13:42:44 UTC
Hi Brenton,

Actually I tried it on devenv instance. So, probably i should have filed this bug against online, not enterprise. However, the same error appears on Origin as well, so, I think, on Enterprise it will be more or less the same. I'll try the steps you advised, and let you know the results.

Comment 4 Miciah Dashiel Butler Masters 2016-05-25 17:29:10 UTC
It looks like the problem has been resolved in intervening releases.  I see useful error messages when I follow the steps to reproduce:

    # rhc app create testapp10 shiny-1.1
    Application Options
    -------------------
    Domain:     testdom
    Cartridges: shiny-1.1
    Gear Size:  default
    Scaling:    no
    
    Creating application 'testapp10' ... Starting Shiny cartridge
    Failed to execute: 'control start' for /var/lib/openshift/5745de30770947bba0000003/shiny
    /var/lib/openshift/5745de30770947bba0000003/shiny/bin/control: line 3: $logf: ambiguous redirect
    /var/lib/openshift/5745de30770947bba0000003/shiny/bin/control: line 13: cartridge_pid: command not found
    /var/lib/openshift/5745de30770947bba0000003/shiny/bin/control: line 13: cartridge_pid: command not found
    /var/lib/openshift/5745de30770947bba0000003/shiny/bin/control: line 13: cartridge_pid: command not found
    /var/lib/openshift/5745de30770947bba0000003/shiny/bin/control: line 23: error: command not found

(Note that in the steps to reproduce, 'shiny-server-1.1.0.49-x86_64.rpm' in the `yum` command should be 'shiny-server-1.2.1.362-x86_64.rpm' to correspondg to the `wget` command, `oo-admin-broker-cache --clear --console` should be replaced by `oo-admin-console-cache --clear`, and `oo-broker` is no longer needed.)

Oleg, are there any remaining concerns, or shall we close this report? Thanks!

Comment 6 Rory Thrasher 2017-01-13 22:49:19 UTC
OpenShift Enterprise v2 has officially reached EoL.  This product is no longer supported and bugs will be closed.

Please look into the replacement enterprise-grade container option, OpenShift Container Platform v3.  https://www.openshift.com/container-platform/

More information can be found here: https://access.redhat.com/support/policy/updates/openshift/


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