Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: A server with the specified hostname could not be found #2028

Closed
4 of 5 tasks
jesus-mg-ios opened this issue Nov 6, 2022 · 23 comments
Closed
4 of 5 tasks

Error: A server with the specified hostname could not be found #2028

jesus-mg-ios opened this issue Nov 6, 2022 · 23 comments
Assignees
Labels
bug status: needs-additional-info Issues that are missing steps from bug template

Comments

@jesus-mg-ios
Copy link

Describe the bug
We're receiving a random error on some devices ErrorCode Code=10 "Error performing request.", please see more in additional context.
The thing is the error says that the path is satisfied. It's a little bit strange, I mean if the path is satisfied the host should be found. the source function is init(_:dnsChecker:) . Could be an error inside this function that makes it fail?

Thanks in advance. I really appreciate your hard work.

  1. Environment
    1. Platform: iOS
    2. SDK version: 4.13.3
    3. StoreKit 2 (disabled with useStoreKit2IfEnabled(false)) (Y/N): useStoreKit2IfEnabled(false)
    4. OS version: iOS 15.X
    5. Xcode version: 13.4.1
    6. How widespread is the issue. Percentage of devices affected. -
  2. Debug logs that reproduce the issue -
  3. Steps to reproduce, with a description of expected vs. actual behavior -
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context

readable_error_code: NETWORK_ERROR

Error Code: 10
source_function: init(_:dnsChecker:)

RevenueCat.ErrorCode.Error Domain=RevenueCat.ErrorCode Code=10 "Error performing request."
UserInfo={NSLocalizedDescription=Error performing request., source_file=RevenueCat/HTTPClient.swift:363, 
NSUnderlyingError=0x2805cea60 
{Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found."
 UserInfo={_kCFStreamErrorCodeKey=8,
 NSUnderlyingError=0x2805cf840 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "

NSUnderlyingError
Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found."
UserInfo={_kCFStreamErrorCodeKey=8,
 NSUnderlyingError=0x2805cf840 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" 
UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0, ipv4, dns, proxy, _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}},
_NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <ID>.<35>,
_NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask < ID >.<35>" ),
NSLocalizedDescription=A server with the specified hostname could not be found., 
NSErrorFailingURLStringKey=https://api.revenuecat.com/v1/subscribers/{SubscriberID}, 
NSErrorFailingURLKey=https://api.revenuecat.com/v1/subscribers/{SubscriberID}, _kCFStreamErrorDomainKey=12}
@RCGitBot
Copy link
Contributor

RCGitBot commented Nov 6, 2022

👀 SDKONCALL-164 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@codykerns
Copy link
Member

Hey @jesus-mg-ios, it looks like the devices are encountering DNS issues preventing the connection to our API, but doesn't necessarily seem related to RevenueCat being down - are you able to reproduce this on your end? Or is it just occurring randomly?

@codykerns codykerns self-assigned this Nov 7, 2022
@jesus-mg-ios
Copy link
Author

jesus-mg-ios commented Nov 7, 2022

It just happens in random end devices ... But it grows up since more or less 20 Oct

@codykerns
Copy link
Member

Hey @jesus-mg-ios - thanks for the info, seems like it might be an issue with the customer's DNS but, since it seems to be increasing lately, we'll take a look on our end and follow up when we have more info.

@codykerns
Copy link
Member

Hey @jesus-mg-ios, just a heads up that this is still on the team's backlog.

@jesus-mg-ios
Copy link
Author

@codykerns thanks for the heads up!

@TemperMichael
Copy link

TemperMichael commented Dec 19, 2022

Hey, is there an update about this issue? Or better asked, how long are such tickets usually in the backlog/will this be fixed in the next two months? 😅

I am just asking since I want to release a major update for one of my apps with a change from paid app to freemium, using RevenueCat and I get this error for macOS (13.0.1; SDK Version 14.5.0; StoreKit 2, Xcode Version 14.2). And since I already have to send out some press releases, I just want to know if I can also mention macOS support or if I have to postpone the release for Mac because of this issue. Thanks in advance!

@NachoSoto
Copy link
Contributor

NachoSoto commented Dec 19, 2022

Hi @TemperMichael,

We'll probably look into it this week.

In the mean time, could you let us know more about the environment where you're reproducing this? Is it a native macOS app or Catalyst? What happens if you try to ping api.revenuecat.com?
Also might be helpful to know which country you're trying to make this request from, what your ISP is, as well as what DNS you're using.

Thanks.

@TemperMichael
Copy link

Ah perfect - It's a native mac app, I am using the same code for iOS and tvOS and there it works fine. For the ping I get a timeout. I am in Austria, my ISP is T-Mobile (Magenta). For DNS I haven't added/setup any specific, for cat /etc/resolv.conf I get the following if that helps:

nameserver 2a02:8383:d:c::1000
nameserver 2a02:8383:d:c::1
nameserver 192.168.0.1

NachoSoto added a commit that referenced this issue Dec 19, 2022
Example:
> DEBUG: ℹ️ Failing url 'https://0.0.0.0/offers' resolved to host '0.0.0.0'

Looking into #2028, it appears that the user is getting a `NSURLErrorCannotFindHost` with a `NSErrorFailingURLKey`.
We didn't determine that this was a `DNS` error because whatever the host resolved to, wasn't one of `Set(["0.0.0.0", "127.0.0.1"])`.

This will add a log that will help us figure out why they got a `NSURLErrorCannotFindHost`.
@NachoSoto
Copy link
Contributor

Thanks for the extra information! We'll let you know what we find out.

In the mean time, I just added a new log that will provide a bit more insight from the SDK perspective: #2167.

@bisho
Copy link

bisho commented Dec 22, 2022

Hi @TemperMichael

The ping timeout is expected. We use AWS Load balancers as the IPs for api.revenuecat.com and they don't reply to ping. The fact that you are getting a timeout means that ping is able to resolve the DNS address. Compare:

$ ping foobar.revenuecat.com
ping: cannot resolve foobar.revenuecat.com: Unknown host
$ ping api.revenuecat.com
PING api.revenuecat.com (18.209.139.75): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

If you want to check that you can connect to api.revenuecat.com try curl:

$ curl -v api.revenuecat.com/
*   Trying 3.219.13.243:80...
* Connected to api.revenuecat.com (3.219.13.243) port 80 (#0)
> GET / HTTP/1.1
> Host: api.revenuecat.com
>
< HTTP/1.1 302 Moved Temporarily
[...]

Given that your computer is able to resolve api.revenuecat.com when using ping I am inclined to think this is some configuration in the coding/testing environment. You are getting this error on the app when testing from XCode? Do you have any configuration done? Any containers that might be isolated from the network? Do you have any tool to simulate poor connection or not connection at all that might be blocking network to your code?

@TemperMichael
Copy link

TemperMichael commented Dec 22, 2022

Thanks for the additional information - true, the curl command also works for me.

As far as I know I have no specific configuration running. I also have no tool running for simulating poor/no internet connection. I also just tried to run the apo with the release scheme (in case debug would have blocked anything) and also archived the build and distributed it as a copy app to run it like a real app, but I still immediately get an error when I fetch the products or try to restore them.

I could also make a TestFlight build and share it with you if that helps - if so, would there be any other output helpful for you besides the localizedDescription from the error? Just so I can add it to the UI so you see everything that you need.

@NachoSoto
Copy link
Contributor

Would you be able to test with 4.15.5? We released that yesterday with a change (#2167) that might give some additional information on what's going on. We already had a DNSChecker that attempts to detect issues with DNS resolution, so hopefully that new log is helpful.

@TemperMichael
Copy link

I just tried it with 4.15.5 and get the following log:

2022-12-22 22:58:35.517090+0100 Ploppy Pairs[14468:14038827] [Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/$RCAnonymousID:ccf9515838cb48b39f5f81bd8a770d31/offerings
2022-12-22 22:58:35.519379+0100 Ploppy Pairs[14468:14038828] dnssd_clientstub ConnectToServer: connect() failed path:/var/run/mDNSResponder Socket:28 Err:-1 Errno:1 Operation not permitted
2022-12-22 22:58:35.519418+0100 Ploppy Pairs[14468:14038828] [connection] nw_resolver_create_dns_service_locked [C16.1] DNSServiceCreateDelegateConnection failed: ServiceNotRunning(-65563)
2022-12-22 22:58:35.519721+0100 Ploppy Pairs[14468:14038828] Connection 16: received failure notification
2022-12-22 22:58:35.519742+0100 Ploppy Pairs[14468:14038828] Connection 16: failed to connect 10:-72000, reason -1
2022-12-22 22:58:35.519799+0100 Ploppy Pairs[14468:14038828] Connection 16: encountered error(10:-72000)
2022-12-22 22:58:35.520913+0100 Ploppy Pairs[14468:14038827] Task <3D50196B-7440-473A-B62D-25086492CA8A>.<2> HTTP load failed, 0/0 bytes (error code: -1003 [10:-72000])
2022-12-22 22:58:35.521167+0100 Ploppy Pairs[14468:14038827] Task <3D50196B-7440-473A-B62D-25086492CA8A>.<2> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={_kCFStreamErrorCodeKey=-72000, NSUnderlyingError=0x60000457ee20 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, ipv6, dns, _kCFStreamErrorCodeKey=-72000, _kCFStreamErrorDomainKey=10}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <3D50196B-7440-473A-B62D-25086492CA8A>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <3D50196B-7440-473A-B62D-25086492CA8A>.<2>"
), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://api.revenuecat.com/v1/subscribers/$RCAnonymousID%3Accf9515838cb48b39f5f81bd8a770d31/offerings, NSErrorFailingURLKey=https://api.revenuecat.com/v1/subscribers/$RCAnonymousID%3Accf9515838cb48b39f5f81bd8a770d31/offerings, _kCFStreamErrorDomainKey=10}
2022-12-22 22:58:35.521839+0100 Ploppy Pairs[14468:14038827] [Purchases] - ERROR: 😿‼️ Error performing request.
2022-12-22 22:58:35.521896+0100 Ploppy Pairs[14468:14038827] [Purchases] - DEBUG: ℹ️ API request failed: GET /v1/subscribers/$RCAnonymousID:ccf9515838cb48b39f5f81bd8a770d31/offerings: Error performing request.
2022-12-22 22:58:35.522019+0100 Ploppy Pairs[14468:14038827] [Purchases] - ERROR: 🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 0.)
Underlying error: The operation couldn’t be completed. (RevenueCat.NetworkError error 2.)
2022-12-22 22:58:35.522175+0100 Ploppy Pairs[14468:14038827] [Purchases] - ERROR: 🍎‼️ Error fetching offerings - The operation couldn’t be completed. (RevenueCat.OfferingsManager.Error error 0.)
Underlying error: The operation couldn’t be completed. (RevenueCat.NetworkError error 2.)
2022-12-22 22:58:35.522272+0100 Ploppy Pairs[14468:14038827] [Purchases] - DEBUG: ℹ️ GetOfferingsOperation: Finished
2022-12-22 22:58:35.522291+0100 Ploppy Pairs[14468:14037994] [Purchases] - ERROR: 😿‼️ Error performing request.

@NachoSoto
Copy link
Contributor

Interesting, let me look into that. Is this happening in the simulator, a device, or both?

@NachoSoto
Copy link
Contributor

What happens if you try to make another HTTP request to some other host from that device using URLSession? That error points to something being broken with the DNS daemon, I'm not sure if it's related to api.revenuecat.com.

@TemperMichael
Copy link

I found the issue - I didn't check the checkbox in the Signing & Capabilities -> App Sandbox -> Network -> Outgoing Connections (Client) 🙃 Sorry to bother you with that unrelated issue, I haven't implemented any mac apps before so I also haven't used any networking yet on mac - thank you for your help! Now everything works as expected!

@NachoSoto
Copy link
Contributor

Awesome, glad you figured it out!

@jesus-mg-ios
Copy link
Author

Hi @NachoSoto the ticket was closed but the initial thread wasn't investigated, isn't it?

@github-actions
Copy link

This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2022
@NachoSoto NachoSoto reopened this Jan 5, 2023
@NachoSoto
Copy link
Contributor

@jesus-mg-ios sorry Jesus, I missed that these were 2 slightly different errors.
Could you test with the latest version that includes #2167 to see if the new log sheds more information?

@NachoSoto NachoSoto added the status: needs-additional-info Issues that are missing steps from bug template label Jan 5, 2023
@codykerns
Copy link
Member

Hey @jesus-mg-ios - just checking in here. Were you able to test with that PR? (looks like it was included in the 4.15.5 release)

@codykerns
Copy link
Member

Going to close this out - feel free to follow up if you're able to try the suggestion above!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug status: needs-additional-info Issues that are missing steps from bug template
Projects
None yet
Development

No branches or pull requests

6 participants