Bug 950731 - --from-code doesn't work even when old method does
Summary: --from-code doesn't work even when old method does
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Dan McPherson
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-10 18:47 UTC by Dis
Modified: 2015-05-14 23:17 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-04 14:49:02 UTC


Attachments (Terms of Use)

Description Dis 2013-04-10 18:47:13 UTC
When creating an app with --from-code, it runs for a while and then aborts. The same repo can be deployed to an existing, blank app with no problems. Diff shows no file differences between the two methods.

Creating application 'ttrss2' ... DEBUG: Creating application 'ttrss2' with these options - {:initial_git_url=>"git://github.com/disconn3ct/tiny_tiny_rss-openshift-quickstart.git", :cartridges=>["php-5.3", "postgresql-8.4"]}
DEBUG: Adding application ttrss2 to domain XX
DEBUG: Request POST https://openshift.redhat.com/broker/rest/domains/XX/applications 
DEBUG:    code 422 33176 ms
Node execution failure (invalid exit code from node).  If the problem persists
please contact Red Hat support.

The same repo can be used to override a manually-created empty app with no problems:

$ diff -urN --exclude .git tiny_tiny_rss-openshift-quickstart/ ttrss2/|diffstat 
 0 files changed

$ git push
Counting objects: 65, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (57/57), done.
Writing objects: 100% (57/57), 9.03 KiB, done.
Total 57 (delta 26), reused 0 (delta 0)
remote: restart_on_add=false
remote: Waiting for stop to finish
remote: Done
remote: restart_on_add=false
remote: Initialized empty Git repository in /tmp/submodules/.git/
remote: Submodule 'php' (https://github.com/gothfox/Tiny-Tiny-RSS.git) registered for path 'php'
remote: Initialized empty Git repository in /tmp/submodules/php/.git/
remote: Submodule path 'php': checked out '9fb91a20437c0a53a7d6aaf8b020ab051fbf9ce2'
remote: Entering 'php'
remote: Running .openshift/action_hooks/build
remote: hot_deploy_added=false
remote: PostgreSQL server instance already running
remote: Done
remote: Running .openshift/action_hooks/post_deploy
...
remote: Schema deployed successfully.
To ssh://##@##.rhcloud.com/~/git/ttrss2.git/
   e6e2e7f..e4674c5  master -> master

Comment 1 Clayton Coleman 2013-04-11 23:38:04 UTC
Node execution failure is a problem on the broker

Comment 2 Dan McPherson 2013-04-13 22:12:25 UTC
Looks like you are hitting the same race condition being addressed with this card:

https://trello.com/c/aw5zGDui

The work around for now is to create the app up front as you are already doing.  We hope to have the issue addressed soon though.

Comment 3 Dan McPherson 2013-05-14 14:39:18 UTC
Dis,

  Can you please try this again.  We believe the issue should have been fixed with the latest release.

Comment 4 Dis 2013-05-14 15:23:05 UTC
Thanks for the update, but still no luck. (I'm not sure if the reference id helps, but feel free to run instances of that quickstart. It is self-contained.)

$ rhc app create ttrss2 --from-code=https://github.com/disconn3ct/tiny_tiny_rss-openshift-quickstart.git php-5.3 postgresql-8.4 cron-1.4
Application Options
-------------------
  Namespace:   foo
  Cartridges:  php-5.3, postgresql-8.4, cron-1.4
  Source Code: https://github.com/disconn3ct/tiny_tiny_rss-openshift-quickstart.git
  Gear Size:   default
  Scaling:     no

Creating application 'ttrss2' ... Unable to complete the requested operation due to: Node execution failure (invalid exit code from node).  If the problem persists please contact Red Hat support..
Reference ID: a0236d74f6569a770062f68c099bff5b

Running again in debug mode, there is a long pause after:
DEBUG: Request POST https://openshift.redhat.com/broker/rest/domains/foo/applications

Then:
DEBUG:    code 500 192775 ms
Node execution failure (error getting fact).  If the problem persists please contact Red Hat support.

(strangely, there is no reference id in debug mode..)

Comment 5 Dan McPherson 2013-05-14 17:34:57 UTC
Looked into the logs from your failure.  The further bug is submodules don't work with --from-code.  Will work to get this fixed.

Comment 6 Dan McPherson 2013-05-29 00:11:29 UTC
@Dis,

  In our latest code we have fixed the submodule issue but your build script is returning an exit code of 1 on these lines:


${OPENSHIFT_REPO_DIR}/.openshift/cron/daily/sphinx
${OPENSHIFT_REPO_DIR}/.openshift/cron/hourly/sphinx


Ex:



[ttrss2-danmcp9.dev.rhcloud.com 109037038811252061634560]\> /var/lib/openshift/109037038811252061634560/app-root/runtime/repo//.openshift/cron/daily/sphinx
[ttrss2-danmcp9.dev.rhcloud.com 109037038811252061634560]\> echo $?


And if I run the command in sphinx directly I get:

[ttrss2-danmcp9.dev.rhcloud.com 109037038811252061634560]\> ${OPENSHIFT_REPO_DIR}/sphinx/bin/indexer --rotate --config ${OPENSHIFT_DATA_DIR}/sphinx/etc/sphinx.conf ${OPENSHIFT_APP_NAME}
Sphinx 2.0.7-release (r3759)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/var/lib/openshift/109037038811252061634560/app-root/data//sphinx/etc/sphinx.conf'...
indexing index 'ttrss2'...
ERROR: index 'ttrss2': sql_connect: could not connect to server: Connection refused
	Is the server running on host "127.1.3.130" and accepting
	TCP/IP connections on port 5432?
 (DSN=pgsql://adminr3wylar:***@127.1.3.130:5432/ttrss2).
total 0 docs, 0 bytes
total 0.000 sec, 0 bytes/sec, 0.00 docs/sec
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
[ttrss2-danmcp9.dev.rhcloud.com 109037038811252061634560]\> echo $?




It looks like it's failing because it needs postgres running.  If you need your db running for these steps you should add what you have now into deploy instead of build.  So I did:

git mv .openshift/action_hooks/build .openshift/action_hooks/deploy

But then I got:

using config file '/var/lib/openshift/109037038811252061634560/app-root/data//sphinx/etc/sphinx.conf'...
indexing index 'ttrss2'...
ERROR: index 'ttrss2': sql_query: ERROR:  relation "ttrss_entries" does not exist
LINE 1: ...,    author, ttrss_user_entries.owner_uid    FROM ttrss_entr...


because your db create logic is in post_deploy and hasn't happened yet.  So I am not sure exactly what order you are looking for these operations to happen in.  But from an OpenShift perspective the order is:

stop everything
pre_build
build
start dbs and other secondary carts
deploy
start primary cart
post_deploy

If you want to ignore the errors you could also return a 0 exit code at the end of build/deploy with exit 0 and it will also work.

Comment 7 Dan McPherson 2013-05-29 00:12:33 UTC
Also if you change the top of your scripts to be:

#!/bin/bash -ex 


it should be a lot easier to find these sorts of issues.

Comment 8 Dis 2013-06-06 14:14:54 UTC
Two quick points. First, how is it notabug if something was broken and is now fixed upstream..?

The other is (maybe this needs a new ticket) it would be nice to get something back on failure beyond "oh well better luck next time". Something as simple as "stage post_deploy returned code 4" would make app creation issues possible to debug on my own.

Comment 9 Dan McPherson 2013-06-06 15:24:37 UTC
Sorry for any confusion caused be the reason code.  The original problem was a bug and was fixed.  The current state appears to be an issue with your app which is why I closed as NOTABUG.  I'll change to CURRENTRELEASE.

I agree the latest debug output still leaves a little to be desired.  Want to open a new bug on that?

-Dan


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