cli icon indicating copy to clipboard operation
cli copied to clipboard

Api fails when dns resolve times out

Open APShirley opened this issue 10 years ago • 5 comments

Hi folks forwarding along some info from an issue that is probably related to the having a bad "first" dns entry issue that was opened previously which Rob piggy-backed on. This is from another user who contacted us on the mailing list, and then moved onto a thread we have for tracking this. There are a few users in this thread mentioning similar problems around dns timeouts.

  • Command: cf push, cf apps, cf domains, cf orgs, and other cf query (in poor words every http request made with cf-cli;
  • CLI version: cf version 6.16.1+924508c-2016-02-26;
  • Error: Error performing GET ... dial tcp: i/o timeout or Error performing POST ... dial tcp: i/o timeout;
  • CC Api Version: v2.52.0;
  • CF Trace: about the CF_Trace=true, is useless to post the result because the error comes with different kind of request as i said (GET/POST);
  • Platform Details: Ubuntu 64 bit 14.04 LTS;
  • Shell: bash

APShirley avatar Mar 22 '16 23:03 APShirley

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/116174927.

cf-gitbot avatar Mar 22 '16 23:03 cf-gitbot

Hi there, @APShirley,

We have made some changes in the latest patch release of the CLI that might have an impact on your issue.

If possible, can you try again with the latest release and let us know if you continue to see an issue?

chendrix avatar May 09 '16 16:05 chendrix

The issue is that the cf CLI has a (hardcoded) 5 sec timeout for resolving the domain name and connecting to the IP address. So if /etc/resolv.conf is configured to switch to the secondary DNS server after 5 seconds (its documented default timeout value), the CLI will already have given up. In cf CLI 6.20.0 we have experimentally replaced the hardcoded value with an environment variable CF_DIAL_TIMEOUT to allow you to override the 5 sec timeout. Please let us know how that works out for you.

Cheers, Dies Koper CF CLI PM

dkoper avatar Jun 30 '16 00:06 dkoper

Thanks Dies, For people like my clients that usually have to go thorough some proxy server, 5 seconds is not sufficient. Ever since we bumped the CF_DIAL_TIMEOUT to 60 seconds we have not sees this error.

ashahba avatar Jul 23 '16 06:07 ashahba

@ashahba Thanks for the feedback. The CF_DIAL_TIMEOUT environment variable is now exposed in the help text. https://github.com/cloudfoundry/cli#downloads

Cheers, Dies Koper CF CLI PM

dkoper avatar Aug 11 '16 03:08 dkoper