cloudfoundry-attic / dea_ng

Droplet Execution Agent for Cloud Foundry v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cf logs improvement when manifest.yml has an incorrect start command specified

DennisDenuto opened this issue · comments

When trying to push a golang application with a manifest.yml containing a bad start command
i.e.

applications:
- name: syslog-drain-listener
  env:
    GOVERSION: go1.6
    GOPACKAGENAME: main
  command: main-wrong-start-command

The error message present in the logs do not reflect the actual issue (the command is wrong). This makes debugging difficult.
The following is the output from cf logs --recent

2016-06-14T15:52:58.07-0700 [DEA/0]      ERR Instance (index 0) failed to start accepting connections
2016-06-14T15:52:58.07-0700 [API/0]      OUT App instance exited with guid 4ee1c94a-a0c2-4568-8b30-84a750a8e69b payload: {"cc_partition"=>"default", "droplet"=>"4ee1c94a-a0c2-4568-8b30-84a750a8e69b", "version"=>"44d5ffd6-b5c4-488c-b7af-4578439dfed1", "instance"=>"d363ab43edee4326b5d36007da4ff4e2", "index"=>0, "reason"=>"CRASHED", "exit_status"=>127, "exit_description"=>"failed to accept connections within health check timeout", "crash_timestamp"=>1465944778}

We suggest that it might be better to have a message that is more specific to the root cause. In the example above, the binary main-wrong-start-command does not exist.

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/121543965

The labels on this github issue will be updated when the story is started.

Hey there,

While this would be good to have, this is a bit difficult to implement due to how the Warden container API functions. When your app's start command fails, the Warden container is broken down before loggregator is connected to begin streaming output out of it, so there's no way to get the output off the container. It might be possible to rework how this works on warden's end, but this would require changing the architecture a fair amount, and there are no plans to do this as Warden's on the way out anyway.

A tip that might help is if you insert a sleep statement after the start command, that might allow enough time for loggregator to get hooked up on the backend, and let you see the output streaming from the container.