Repository navigation
iOS mDNS lookup fails at Starbucks #46698
Description
Activity
- addedc: regressionIt was better in the past than it is nowIt was better in the past than it is nowplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.engineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.customer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.a: annoyanceRepeatedly frustrating issues with non-experimental functionalityRepeatedly frustrating issues with non-experimental functionality
on Dec 10, 2019 A likely relevant point here is whether Starbucks wifi allows for nodes to find eachother via multicast. Some wifi networks disable this intentionally, and I would not be surprised if this is the case there.
Any volunteers to see if we can get a Starbucks to let us set up a devicelab machine there though?
Any volunteers to see if we can get a Starbucks to let us set up a devicelab machine there though?
A one-off experiment with a regular dev setup while grabbing a capture with wireshark might tell us what we need to know.
Reacted by Dan Field and Christopher FujinoAdding on here since this is what I reported over in #41085. It has indeed failed on every public WiFi I've tried it on - dozens.
Reacted by Zachary AndersonNew host computer, macOS version and network, on latest master, same problem.
Open hotel WiFi. LAN IP 172.20.0.20, subnet 255.255.248.0, router 172.20.0.1.
Two Wireshark captures attached. Cap 1 is much longer in case the extra network context helps. I stopped both a few seconds after
mDNS lookup failed, waiting for observatory port.Reacted by Christopher Fujino@stx thanks for the traces, they're really helpful.
I would have expected to see traffic going over a link-local address. Here's what a successful trace looks like for me:
Note that the broadcast is going out over al ink local address and being answered from another link local address (169.254.152.106 and 168.254.74.55). I specifically set up wireshark to capture on the iPhone network interface:
Could you try a trace with those settings and post it? This should be enough to connect to a plugged in iPhone, regardless of whether it's on the same WiFi network as you or not.
@stx - I'm still seeing only LAN addresses (172.20.0.20) in there instead of the link-local address.
@dnfield No packets are captured with the settings you posted.
@dnfield Seems pretty obvious to me we've found the problem here - the requests are being sent over the wrong interface. Am I missing something?
12 remaining items
I strongly suspect that when hotspot is enabled, you don't get a link local bridge anymore. I wonder if there's some way to force that to happen, but I suspect not.
I think
flutter doctorcould be taught to look for a link local address or the iPhone USB address, and if it's not visible we could print instructions on what to do to fix it.I'm a little murky on how we'll determine which interface is the one for the iPhone from the tool though.
How about, if we have
- macOS Catalina, and
- mDNS fails, and
- there's no ipv4 link local address
we
throwToolExit()with instructions to disable hotspot and a link to this issue. That might be a little overfit to the situation in this issue, but I think we're pretty sure if all of those are true, the tool won't be able to make progress without help from the user.Regarding a doctor message, I'd prefer not to add a message to the doctor that causes someone with a working setup to fiddle with the network settings, and get themselves into a bad state.
Reacted by Dan Field@zanderso - I think that's close but maybe not quite it. It sounds like even with hotspot disabled, you won't get a link local bridge to the iPhone (if hot spot is available).
I see, we'd be guarded from this because mDNS failed.
I did a quick test with someone's phone overhere that has hotspot available.
When hotspot is enabled, we don't get al ink local adaptor. And by default, when I'm otherwise connected, that adaptor is disabled. We should look to see if there's some way we can enable that adapator (I'm thinking something like either
ifconfig upordefaultsshould be able to control that somehow).The basic problem is we can end up in a case where there's no route from the phone to the host machine - even if they're on the same wifi network, on a lot of public networks they won't be able to discover each other based on a variety of router or firewall settings.
After adding the error message, I've tried to capture the actionable part of this discussion in: #47224. I'll close this one in favor of that one.
@zanderso What about when Personal Hotspot is disabled and there is still no link local adapter?
Due to Catalina's default
Disable unless neededsetting.Unfortunately this gets trickier. Getting deeper to the root of the problem to solve here:
- New Catalina default setting
System Preferences > Network > iPhone USB > [x] Disable unless neededprevents the iPhone interface from showing up in Dart'sNetworkInterface.list. - The
iPhone USBnetwork option is not present unless Personal Hotspot is enabled. - "Disable unless needed" cannot be unchecked because it's hidden so you're stuck.
The workaround for this is the following:
- Enable
Personal Hotspot > Allow Others to Joinin order to getiPhone USBto show up in System Preferences > Network. - Uncheck
Disable unless needediniPhone USBand hit Apply. - Debugging will now work with or without hotspot on.
However, if hotspot is disabled and re-enabled, and probably in other scenarios, "Disable unless needed" will become checked by default again.
Because of this final behavior, it seems like this will always be a problem unless Flutter can control it or workaround it.
Hooray! It works for me with iOS 13.3 and Xcode 11.3 and VS Code. Thank you!!!
- New Catalina default setting
This error also appears if you have a wrongly configured
GoogleService-Info.plistwhich is quite odd 😕I'm seeing what I think it this issue. Here is what I have setup.
First off when I do a "run flutter -v" I see the following:[ +3 ms] Attempting to forward device port 51594 to host port 1024
[ ] executing:
/Users/dpsmith/Flutter/flutter/bin/cache/artifacts/usbmuxd/iproxy 1024 51594
00008020-001319C121D9002E
[ +3 ms] Failed to establish a debug connection with 00008020-001319C121D9002E
using
mdns: Invalid argument(s): Cannot find executable for
/Users/dpsmith/Flutter/flutter/bin/cache/artifacts/usbmuxd/iproxy.
[ +2 ms] mDNS lookup failed, attempting fallback to reading device log.
[ ] Waiting for observatory port.There it just sits.
My setup is as follows:
iOS version: 13.4
Mac version: Catalina 10.15.3
Xcode version: 11.4 Build version 11E146My Mac's Network iPhone USB has the "Disable unless needed" UNCHECKED
Note that now it is showing that iPhone USB is Not Connected even though it is connected (and Flutter sees it just fine)Running Flutter devices I see this:
CHM-C02YT92KLVCG:flutter_test_ios_device dpsmith$ flutter devices
1 connected device:
Darrin Smith iPhone - 000... • 000...002E •
ios • iOS 13.4
HM-C02YT92KLVCG:flutter_test_ios_device dpsmith$Running "flutter --version" I get:
HM-C02YT92KLVCG:flutter_test_ios_device dpsmith$ flutter --version
Flutter 1.12.13+hotfix.9 • channel stable •
https://github.com/flutter/flutter.git
Framework • revision f139b11 (6 days ago) • 2020-03-30 13:57:30 -0700
Engine • revision af51afceb8
Tools • Dart 2.7.2So, I think I'm as up to date as I can get, and I think this is the same issue others have reported, but doing the steps that seem to work for some of the others so far have not worked for me.
Is there anything else I should do or something wrong I did do that I should change?
Things seem to be working perfectly for Android for what it's worth.
@darrinps it looks like there is a problem with downloaded artifacts:
mdns: Invalid argument(s): Cannot find executable for /Users/dpsmith/Flutter/flutter/bin/cache/artifacts/usbmuxd/iproxy.Try deleting
flutter/bin/cacheto trigger a re-download.@zanderso That did it! Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.- locked and limited conversation to collaborators
on Apr 25, 2020


Splitting off from #41085
With Catalina and iOS 13, iOS mDNS lookup is reported to fail reliably at Starbucks (and presumably other public WiFi setups as well).
Marking with both 'tool' and 'engine' because it is not yet clear where the problem is.
@dnfield @christopherfujino @jmagman @tvolkert