cli icon indicating copy to clipboard operation
cli copied to clipboard

Timeout for cf push - enhancement

Open paulc4 opened this issue 12 years ago • 13 comments

I was having trouble with cf push timing out before my app could fully deploy. Running cf apps showed that my app was indeed running. Not sure why, but that's not my issue here.

I tried running cf push -t 10000, a randomly chosen big number to (effectively) stop it timing out at all. Turns out the largest permitted timeout is 180 seconds.

Firstly I'm not sure if 3 mins is long enough. Is there a reason for this particular value?

Secondly, when I run cf push --help, it would be nice if it said there was a maximum timeout and what it is. Currently it just says "Start timeout in seconds".

I accept that the 180s maximum is in the online documentation, but personally I wouldn't expect to have to go to the documentation for something so basic.

paulc4 avatar Jul 09 '14 11:07 paulc4

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/74681130.

cf-gitbot avatar Jul 09 '14 11:07 cf-gitbot

@paulc4 Thanks for the report.

What version of Cloud Foundry are you running in your infrastructure? Are you running in AWS using an ELB? Do you know if the ELB timeouts have been changed from the defaults?

We have seen this problem in the past where the ELB times out the connection. We have also seen it in non-aws environments with older CF versions.

Could you run the cf push again, with CF_TRACE set to true? We suspect you will see a 504 Gateway Timeout response. If that is the case, then the solution differs depending on what kind of infrastructure you have.

Thanks, @DanLavine and @dliebreich CF Community Pair

ghost avatar Jul 09 '14 17:07 ghost

I'm just using PWS and the problem seems to be that I was using an old version of the spring-music-app. I was just running a simple demo, nothing more. Pulling the latest version of spring-music from github solved the problem, I was able to deploy it without cf push timing out.

Sadly, I no longer have the old spring-music code to try again with, sorry. I will remember the CF_TRACE suggestion for next time, so thanks for that.

I didn't consider in my original request that the maximum timeout was configurable, so I get now why cf push -help cannot tell you what the maximum timeout is.

Can I suggest, instead, that if I run something like cf push -t 10000 ... that the error message also includes the maximum for the current conflagration?

Thanks, Paul

paulc4 avatar Jul 11 '14 01:07 paulc4

@paulc4 Thanks for the additional info, and we're glad you got it working.

We're fairly certain that the timeout is happening at some middle-stage process sitting between the cli and the CF cloud controller, perhaps an AWS Elastic Load Balancer, or a ha_proxy instance.

We're not sure the cli nor the cf cloud controller have access to the ha_proxy or AWS ELB timeout values, so adding this info to the error message might not be possible.

@MarkKropf or @lcddave - is this something you want to take on as a feature request?

Thanks @DanLavine && @dliebreich CF Community Pair

dliebreich avatar Jul 11 '14 17:07 dliebreich

I see 2 areas for the CLI to improve:

  • Document in the help what that timeout really means, might be a CLI side only thing
  • Better error messaging to indicate remote side close (and a reason given if any).

I'll take stories on those.

lcddave avatar Jul 11 '14 17:07 lcddave

Thanks for the prompt responses. I'll leave any fixes with you to take forward. I am happy for this issue to be closed, unless you need to keep it open for any fixes you decide on. Your call.

Thanks, Paul.

paulc4 avatar Jul 13 '14 11:07 paulc4

Stories opened:

  • https://www.pivotaltracker.com/story/show/75071752
  • https://www.pivotaltracker.com/story/show/75071698

I'm closing this out since this will be in tracker.

lcddave avatar Jul 15 '14 21:07 lcddave

https://www.pivotaltracker.com/story/show/75071698 is done.

goehmen avatar Sep 02 '14 17:09 goehmen

No mention of the 180s maximum value - the command won't run with -t 181 for example. The error you get is not obvious (or it wasn't to me anyway):

Server error, status code: 400, error code: 100001, message: The app is invalid: health_check_timeout maximum_exceeded

paulc4 avatar Sep 02 '14 21:09 paulc4

At face value, it looks like that 180 sec is a cloud controller timeout and thus not something that the CLI can impact. CLI team is verifying whether that is in fact true or not.

goehmen avatar Sep 02 '14 22:09 goehmen

Fair enough. Can you add a note in the help text to say what the max is? And/or catch the "health_check_timeout maximum_exceeded" error and replace it with something more meaningful to a cf user?

paulc4 avatar Sep 02 '14 22:09 paulc4

@paulc4 There is now a story in the CF runtime tracker for them to expose the current setting for the timeout in the error message itself. https://www.pivotaltracker.com/n/projects/966314/stories/78074408

goehmen avatar Sep 02 '14 22:09 goehmen

OK, so can I suggest that your new help text read something like:

Maximum time (in seconds) for CLI to wait for application start, other server-side timeouts, such as 'health_check_timeout', may override this value

paulc4 avatar Sep 03 '14 00:09 paulc4