无法运行Cloudfoundry任务-意外响应404 [英] Cannot run Cloudfoundry Task - Unexpected Response 404

查看:97
本文介绍了无法运行Cloudfoundry任务-意外响应404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过cf成功推送我的应用程序后,通常需要手动ssh-log到容器中,并执行几个PHP脚本来清除和预热我的缓存,并可能执行一些数据库架构更新等.

After my app is successfully pushed via cf I usually need do manually ssh-log into the container and execute a couple of PHP scripts to clear and warmup my cache, potentially execute some DB schema updates etc.

今天,我发现了有关 Cloudfoundry任务的方法,该方法似乎提供了一种不错的方法完全可以做这种事情,我想测试一下是否可以将其集成到我的构建和部署脚本中.

Today I found out about Cloudfoundry Tasks which seems to offer a pretty way to do exactly this kind of things and I wanted to test it whether I can integrate it into my build&deploy script.

因此使用cf登录,成功连接到正确的组织和空间,应用已推送并正在运行,我尝试了以下命令:

So used cf login, got successfully connected to the right org and space, app has been pushed and is running and I tried this command:

cf run-task MYAPP "bin/console doctrine:schema:update --dump-sql --env=prod" --name dumpsql

(尝试了几次文件夹更改,例如app/bin/console等)

(tried it with a couple of folder changes like app/bin/console etc.)

这是输出:

Creating task for app MYAPP in org MYORG / space MYSPACE as me@myemail...
Unexpected Response
Response Code: 404 FAILED

Creating task for app MYAPP in org MYORG / space MYSPACE as me@myemail...
Unexpected Response
Response Code: 404 FAILED

使用CF CLI:6.32.0

Uses CF CLI: 6.32.0

cf logs ArcticTenTestBackend --recent不输出任何内容(可能是这种情况,因为我已启用了ELK实例进行日志记录-因为我想通过服务连接到ELK来查找日志,所以我发现service-connector cf插件已经消失了,我将为它打开一张新票.

cf logs ArcticTenTestBackend --recent does not output anything (this might be the case because I have enabled an ELK instance for logging - as I wanted to service-connect to ELK to look up the logs I found out that the service-connector cf plugin is gone for which I will open a new ticket).

为此创建了新的问题: https://github.com/cloudfoundry/cli/issues/1242

Created new Issue for that: https://github.com/cloudfoundry/cli/issues/1242

推荐答案

自@Mathis提到以来,自发布此问题以来,Kretz Swisscom就已经启用了cf run-task.他们于2018年11月22日发送电子邮件以宣布该功能.

As mentioned by @Mathis Kretz Swisscom has gotten around to enable cf run-task since this question was posted. They send out e-mails on 22. November 2018 to announce the feature.

如在链接文档中所讨论的,您使用以下命令来管理tasks:

As discussed on your linked documentation you use the following commands to manage tasks:

cf tasks [APP_NAME]
cf run-task [APP_NAME] [COMMAND]
cf terminate-task [APP_NAME] [TASK_ID]

这篇关于无法运行Cloudfoundry任务-意外响应404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆