Nginx 无法使用--from code选项创建OpenShift应用程序

Nginx 无法使用--from code选项创建OpenShift应用程序,nginx,sinatra,openshift,paas,openshift-client-tools,Nginx,Sinatra,Openshift,Paas,Openshift Client Tools,我正在尝试使用--fromcode选项创建OpenShift应用程序,以从GitHub获取应用程序代码。我已经创建了两个不同的OpenShift快速入门——其中一个是——from code选项起作用,而另一个则不起作用 很明显,我在QuickStart中做了一些不正常的事情。但我看不出我做错了什么。我要么收到错误504要么收到发生的错误,两者都不能告诉我问题出在哪里,而且似乎没有详细标志来获取错误的更多详细信息 Tests-Mac:~ testuser$ rhc app create sonr

我正在尝试使用
--fromcode
选项创建OpenShift应用程序,以从GitHub获取应用程序代码。我已经创建了两个不同的OpenShift快速入门——其中一个是
——from code
选项起作用,而另一个则不起作用

很明显,我在QuickStart中做了一些不正常的事情。但我看不出我做错了什么。我要么收到
错误504
要么收到
发生的错误
,两者都不能告诉我问题出在哪里,而且似乎没有
详细
标志来获取错误的更多详细信息

Tests-Mac:~ testuser$ rhc app create sonr diy-0.1 http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart --from-code https://github.com/citrusbyte/SONR.git
The cartridge 'http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart' will be downloaded and installed

Application Options
-------------------
Domain:      schof
Cartridges:  diy-0.1, http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart
Source Code: https://github.com/citrusbyte/SONR.git
Gear Size:   default
Scaling:     no

Creating application 'sonr' ... Server returned an unexpected error code: 504
Tests-Mac:~ testuser$ rhc app create sonr diy-0.1 http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart --from-code https://github.com/citrusbyte/SONR.git
The cartridge 'http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart' will be downloaded and installed

Application Options
-------------------
Domain:      schof
Cartridges:  diy-0.1, http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart
Source Code: https://github.com/citrusbyte/SONR.git
Gear Size:   default
Scaling:     no

Creating application 'sonr' ... 
An error occurred while communicating with the server. This problem may only be temporary. Check that you have correctly specified your
OpenShift server 'https://openshift.redhat.com/broker/rest/domain/schof/applications'.
Tests-Mac:~ testuser$ 
这是使用以下repo使用
--from code
创建应用程序:。如果我使用此回购协议,它将完美无瑕:

代码本身似乎很好,因为我可以创建一个空的新应用程序,合并SONR代码,它可以完美地工作

我做错了什么

更新:我解决了这个问题,分两个阶段创建应用程序,而不是一个阶段:

rhc app create APPNAME diy-0.1 http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart
cd APPNAME
git remote add github -f https://github.com/citrusbyte/SONR.git
git merge github/master -s recursive -X theirs
git push origin master

不过,我还是想知道为什么一步到位就失败了。

这可能是因为应用程序克隆/安装需要很长时间,而且创建正在超时。您可以尝试在不使用--from代码的情况下创建应用程序,然后在本地克隆它,然后从github合并代码,然后执行git推送。此操作的超时时间要长得多,并且还可以让您查看所出现的错误(如果有),因为与创建应用程序不同,如果应用程序不成功,应用程序不会消失。

@developercorey的想法是正确的

我尝试了一个可笑的99999超时,然后得到了另一个我认为无法更改的超时错误:

$ rhc app create APPNAME diy-0.1 http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart --from-code https://github.com/citrusbyte/SONR.git --timeout 99999
...
Creating application 'APPNAME' ... 
The initial build for the application failed: Shell command '/sbin/runuser -s /bin/sh 5328a9385973ca70150002af -c "exec /usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c5,c974' /bin/sh -c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' exceeded timeout of 229
我在之前的更新中提到的修复程序运行得很好,这就是我建议任何有类似问题的人尝试的方法--我创建的应用程序为空,没有
--从code
选项,然后合并到我想在单独的步骤中使用的代码中:

rhc app create APPNAME diy-0.1 http://cartreflect-claytondev.rhcloud.com/reflect?github=smarterclayton/openshift-redis-cart
cd APPNAME
git remote add github -f https://github.com/citrusbyte/SONR.git
git merge github/master -s recursive -X theirs
git push origin master

谢谢,@developercorey。正如上面的更新所示,我确实做到了这一点。我将听取您关于超时的建议,并尝试更长时间的超时操作。我相信应用程序创建有2分钟的时间,因此如果您正在进行大型构建过程,那么将构建已经存在于存储库中并将其复制到正确的位置可能是值得的,或者将其预编译并作为盒式磁带安装,而不是快速启动。查看
--debug
输出,超时时间似乎以毫秒为单位,如果999999毫秒仅为1.67分钟,则可能比默认时间短(我看到有5分钟超时;但我也尝试了
--timeout 999999
,没有区别。我看不到创建时出现“应用程序的初始构建失败”错误,但在升级到2档(超时200)时确实会出现这些错误。