{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/167","labels_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/167/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/167/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/167/events","html_url":"https://github.com/aws/aws-sdk-ios/issues/167","id":63201424,"number":167,"title":"Error connecting to AWS services, kCFURLErrorCannotFindHost = -1003","user":{"login":"Kumuluzz","id":1839880,"avatar_url":"https://avatars.githubusercontent.com/u/1839880?v=3","gravatar_id":"","url":"https://api.github.com/users/Kumuluzz","html_url":"https://github.com/Kumuluzz","followers_url":"https://api.github.com/users/Kumuluzz/followers","following_url":"https://api.github.com/users/Kumuluzz/following{/other_user}","gists_url":"https://api.github.com/users/Kumuluzz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kumuluzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kumuluzz/subscriptions","organizations_url":"https://api.github.com/users/Kumuluzz/orgs","repos_url":"https://api.github.com/users/Kumuluzz/repos","events_url":"https://api.github.com/users/Kumuluzz/events{/privacy}","received_events_url":"https://api.github.com/users/Kumuluzz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-ios/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-20T10:12:55Z","updated_at":"2015-04-03T19:25:38Z","closed_at":null,"body":"We have been working on an iOS project which makes use of the official AWS SDK for iOS (version 2.017) and Cognito Sync SDK for iOS (version 1.0.8). Both of these have been installed using the dependency management system CocoaPods.\r\n\r\n---\r\n\r\nOur project interacts with the Cognito and SQS services. All iOS devices post messages to the same queue (outbound queue). The individual iOS device will then read from a specified queue only for that iOS device (inbound queue nr1, nr2, nr3...).\r\n\r\nWe have encountered the error kCFURLErrorCannotFindHost (code -1003) from time to time while reading the inbound queues. We have not yet found the root of this issue, so we are not able to systematically recreate it. Sometimes it happens on 3G, sometimes on WiFi, other times there can go days before it reoccurs.\r\n\r\n*UPDATE: The error seems to occur mainly over 3G when changing location. So it happens whenever the app tries to connect to the server again through a new 3G antenna. *\r\n\r\nThis error has occurred both when connecting to Cognito and to the SQS service. A screenshot of the error can be seen below when trying to connected to the SQS:\r\n![aws_forum_post_1003](https://cloud.githubusercontent.com/assets/1839880/6749597/e14346a2-cef1-11e4-9cd6-2e7da0c4503c.png)\r\n\r\n\r\nWhen the error occurs, then it will continue to happen for around 5-10 minutes before it disappears. No changes are done to the code and the location of the device is not changed. It seems to disappear naturally after this timeframe.\r\n\r\nWe have a theory that the error is connected to the NSURLConnection class. We will continue to try and pinpoint the root of the error by examining the AWS SDK. Our current lead is focusing on the “keepalive” parameter.\r\n\r\nIt is important to notice, this error does not seem to be related to only the AWS Cloud. We have New Relic implemented for the same iOS project which experiences the same error. \r\n\r\n---\r\n\r\nWe are looking for a way to recover from this error and thought that it should be done from the AWS SDK. \r\nWould you have some advice for resetting the NSURLConnection when this error occurs? We will happy to try your suggestions by making changes to the AWS SDK."},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/comments/89397070","html_url":"https://github.com/aws/aws-sdk-ios/issues/167#issuecomment-89397070","issue_url":"https://api.github.com/repos/aws/aws-sdk-ios/issues/167","id":89397070,"user":{"login":"yosuke-matsuda","id":1459206,"avatar_url":"https://avatars.githubusercontent.com/u/1459206?v=3","gravatar_id":"","url":"https://api.github.com/users/yosuke-matsuda","html_url":"https://github.com/yosuke-matsuda","followers_url":"https://api.github.com/users/yosuke-matsuda/followers","following_url":"https://api.github.com/users/yosuke-matsuda/following{/other_user}","gists_url":"https://api.github.com/users/yosuke-matsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/yosuke-matsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosuke-matsuda/subscriptions","organizations_url":"https://api.github.com/users/yosuke-matsuda/orgs","repos_url":"https://api.github.com/users/yosuke-matsuda/repos","events_url":"https://api.github.com/users/yosuke-matsuda/events{/privacy}","received_events_url":"https://api.github.com/users/yosuke-matsuda/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T19:25:38Z","updated_at":"2015-04-03T19:25:38Z","body":"All of the services you listed are high traffic websites, and it makes sense that the DNS has fresh records for them. In order to isolate the DNS issue, can you convert `sqs.eu-west-1.amazonaws.com` to an IP address and use it to see if it resolves the issue when you see the error? Amazon SQS allows HTTP access (Amazon Cognito only allows HTTPS), and use HTTP instead of HTTPS in order to avoid a certificate error. You can manipulate `_URL` [here](https://github.com/aws/aws-sdk-ios/blob/master/AWSCore/Service/AWSService.m#L287) to change the URL.\r\n\r\nPlease use the IP address to access AWS services only for testing purposes, and do not ship your app with embedded IP addresses since they can change any time."}}