Re: CR Push failure
Dan Wendorf
Hi shahc,
toggle quoted messageShow quoted text
Dan's answer covers most of the details. Cloud Foundry applications are intended to be long-lived (endless until you explicitly stop them) processes that respond to web requests. The health-check is attempting to confirm this by connecting to the application via the HTTP port provided to the application by the PORT variable. Because you've set your start command to a non-web command (a MySQL task), it will not respond on that port and Cloud Foundry considers that to be a failure. If you want to perform one-off tasks during app start (e.g. seeding your database), that's best done as part of your application's startup process. A common pattern in pseudo-code is something like: ``` class MyApplicationBootstrap { function start() { if (migrationsNeeded()) { runMigrations(); } MyApplication.new().start(); } } ``` There will be support for one-off tasks (what you are attempting to do) in the near-future (see the current documentation for tasks <http://v3-apidocs.cloudfoundry.org/version/release-candidate/index.html#tasks> in the experimental V3 API — note that it is subject to change and not yet stable), but until then, the in-app startup bootstrap is the best solution. Additionally, take care to not copy-paste credentials when posting in a public forum. I recommend cycling the credentials for your service as soon as possible. Hope this helps, (the other) Dan
On Mon, May 9, 2016 at 4:56 AM, Daniel Mikusa <dmikusa(a)pivotal.io> wrote:
On Mon, May 9, 2016 at 2:41 AM, Stanley Shen <meteorping(a)gmail.com> wrote:From the message "failed to accept connections within health checkDon't be led astray here. With the DEA when an app crashes, you will
|
|