Cannot start Cloudfoundry task - 404 unexpected response

After my application is successfully clicked through cf, I usually need to manually ssh-log into the container and execute some PHP scripts to clear and stretch my cache, it is possible to perform some updates to the database schema, etc.

Today I learned about Cloudfoundry Tasks , which seems to offer a great way to do just such things, and I wanted to test it. I can integrate it into my build and deployment script.

So using cf login, having successfully connected to the correct organization and space, the application was clicked and works, and I tried this command:

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

(tried it with a few changes in the folder, such as app / bin / console, etc.)

and this was the result:

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 may be because I turned on the ELK instance for logging - since I wanted to connect to the ELK to search for logs, I found out that the c-service-connector cf plugin is gone, for whom I will open a new ticket).

Created a new release for this: https://github.com/cloudfoundry/cli/issues/1242

+6
source share
2 answers

This is not a CLI CL issue. Cloudcom Cloudcom does not yet support Cloud Foundry. This explains the 404 that you are currently receiving. We will publish this feature of Cloud Foundry in the upcoming release of the Swisscom Application Cloud.

In the meantime, you may be able to find a way to perform one-time tasks (caching, database migration) when starting the application.

+3
source

As @Mathis Kretz already mentioned, Swisscom has been able to enable cf run-task since the publication of this question. They send emails on November 22, 2018 to announce this feature.

As discussed in your related 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] 
0
source

Source: https://habr.com/ru/post/1272395/


All Articles