Infinite loop of network failures contacting https://api.segment.io/v1/b
xmollv opened this issue ยท 13 comments
Describe the bug
We're recently seeing an infinite loop contacting this endpoint on our console logs: https://api.segment.io/v1/b
It seems to have started when we updated Segment to 1.5.8
.
Task <279A17CF-BC6B-47E8-85CF-BD283BF13069>.<4127> finished with error [-1009] Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo={_kCFStreamErrorCodeKey=50, NSUnderlyingError=0x3031d2a30 {Error Domain=kCFErrorDomainCFNetwork Code=-1009 "(null)" UserInfo={_NSURLErrorBlockedTrackerFailureKey=true, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=50, _NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, uses wifi}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalUploadTask <279A17CF-BC6B-47E8-85CF-BD283BF13069>.<4127>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalUploadTask <279A17CF-BC6B-47E8-85CF-BD283BF13069>.<4127>"
), NSLocalizedDescription=The Internet connection appears to be offline., NSErrorFailingURLStringKey=https://api.segment.io/v1/b, NSErrorFailingURLKey=https://api.segment.io/v1/b, _kCFStreamErrorDomainKey=1}
Obviously, I'm not offline. Everything else works, and If I roll back to 1.5.7
, this error is no longer printed to the console.
To Reproduce
- Launch the app
- Observe how the console is filled with error logs
Expected behavior
- There's no failure when contacting
https://api.segment.io/v1/b
Screenshots
- N/A, it's the logs I pasted above.
Platform (please complete the following information):
- Library Version in use: 1.5.8
- Platform being tested: iOS & iOS Simulator
- Integrations in use: Firebase, Instabug
Additional context
- N/A
We're also seeing the same behaviour described above.
Same with us.
We see this error, which might be related:
nw_endpoint_handler_path_change [C1 cdn-settings.segment.com:443 waiting parent-flow (satisfied (Path is satisfied), interface: en0[802.11], uses wifi)] blocked tracker
This most likely happens because Segment's SDK lists cdn-settings.segment.com
and api.segment.io
in their PrivacyInfo.xcprivacy manifest under NSPrivacyTrackingDomains section
According to Apple:
NSPrivacyTrackingDomains
An array of strings that lists the internet domains your app or third-party SDK connects to that engage in tracking. If the user has not granted tracking permission through the App Tracking Transparency framework, network requests to these domains fail and your app receives an error.
If you set NSPrivacyTracking to true then you need to provide at least one internet domain in NSPrivacyTrackingDomains; otherwise, you can provide zero or more domains.
Once I granted access to track the user, this error went away
@bsneed I think unless you are specifying NSPrivacyTracking as true, meaning Segment tracks the user, you don't need to list these domains
Thanks for all this info and the catch guys. What should this be? It seems a little confusing to me.
We're not technically tracking anything that would require ATT, but could if a customer opts-in to it by including the IDFA plugin.
I'm not sure what to do here yet (other than get it fixed somehow).
https://developer.apple.com/app-store/user-privacy-and-data-use/
According to that, IDFV doesn't need it, so seems like we should remove it entirely. If a customer opts in to IDFA, they'd handle it via their own app privacy info I think. Happy to hear your thoughts @sergiymomot @vlvs @xmollv @tristan-warner-smith before I make any changes.
I think you can omit privacy domains since, as you said, you are not tracking the user but provide a platform to send track events - what data is being sent inside these event payloads is outside of Segment's control
If a customer uses the IDFA plugin, they would be in charge of specifying it in their Privacy Manifest
Due to the Plugin system, you cannot account for all possible use-cases apps will implement concerning user privacy and identity tracking guidelines
Same goes for 3rd party integrations - it's AppsFlyer's responsibility to declare what data they use for tracking even if SDK is not used directly but through a destination plugin
Thanks for the feedback @sergiymomot; We'll move forward with that. Release coming shortly.
@bsneed I've updated to 1.5.9
and it seems to have solved the issue! Thanks, feel free to close this ticket once it looks good on your end ๐๐ผ
I can also confirm this is fixed! Thank you ๐
Thanks everyone for your assistance! ๐
Hello, we are experiencing this issue as well but we are currently on 1.5.11
. We had 1 user this morning make 20k requests which resulted in an errors being sent back to Sentry. We just recently upgraded to analytics-swift
from analytics-ios
, due to the privacy tracking from Apple.
Is there an approach we should be taking to prevent these errors from looping?
@hulsizer please reach out to friends@segment.com for support.