Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
439 views
in Technique[技术] by (71.8m points)

cloud foundry - Cannot run Cloudfoundry Task - Unexpected Response 404

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.

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.

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

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

and this was the output:

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

Uses CF CLI: 6.32.0

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).

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is not a CF CLI issue. Swisscom Application Cloud does not yet support the Cloud Foundry tasks. This explains the 404 you are currently receiving. We will expose this feature of Cloud Foundry in an upcoming release of Swisscom Application Cloud.

In the meantime, maybe you can find a way to execute your one-off tasks (cache warming, DB migrations) at application startup.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...