Open Bug 1148570 Opened 9 years ago Updated 2 years ago

Discovery UDP ports not open on some Linux distros

Categories

(DevTools :: about:debugging, defect, P3)

x86_64
Linux
defect

Tracking

(Not tracked)

People

(Reporter: hub, Unassigned)

References

(Blocks 2 open bugs)

Details

I have a flame, just full flashed to master.

gecko git 43bcefb0f75724ed83ef3905c21bb6ccbc9c5df0
gaia git be2e04b19224e1c617ca513676c208bb1c2f8858

Also, Firefox is my own build from m-i, hg revision. tip is b05e10ed40c4
It if on Fedora Linux 21.

I configured the Flame to debug over wifi.

Both device are on the same wifi network.

It doesn't appear in the WebIDE runtime selection menu. Nothing is in the "Wifi devices" section.
Let's try some diagnostic steps.

If you use "adb logcat | grep Gecko", and then flip DevTools via Wi-Fi off and on, do you see:

I/GeckoDump(  206): AdbController: Started WiFi debugger on <SOME PORT>

Another thing we can try is enabling the pref "devtools.discovery.log" on both your computer and device.  With this enabled, when you click on the "runtime" button in WebIDE to view the list of runtimes, you should get some logs prefixed with "DISCOVERY:" in the Browser Console of the computer and the ADB Gecko logs of the device which would be good to capture.
Flags: needinfo?(hub)
Here is the logcat:

I/GeckoDump(  204): AdbController: Starting WiFi debugger
I/GeckoDump(  204): AdbController: Started WiFi debugger on 49385
Flags: needinfo?(hub)
Okay, that's good.  So, something about the discovery is not working.  Hopefully the discovery logs I mentioned will reveal something here.
The device logs:

I/GeckoConsole( 7995): Content JS LOG: DISCOVERY: Active network changed to: 0 
I/GeckoConsole( 7995):     at log (resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/discovery/discovery.js:69:undefined)
I/GeckoConsole( 7995): Content JS LOG: DISCOVERY: LISTEN FOR SCAN 
I/GeckoConsole( 7995):     at log (resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/discovery/discovery.js:69:undefined)
I/GeckoConsole( 7995): Content JS LOG: DISCOVERY: Recv on 50624:
I/GeckoConsole( 7995): {
I/GeckoConsole( 7995):   "device": "raptor",
I/GeckoConsole( 7995):   "services": {},
I/GeckoConsole( 7995):   "from": "172.18.2.107"
I/GeckoConsole( 7995): } 
I/GeckoConsole( 7995):     at log (resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/discovery/discovery.js:69:undefined)
I/GeckoConsole( 7995): Content JS LOG: DISCOVERY: GOT SCAN REQUEST 
I/GeckoConsole( 7995):     at log (resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/discovery/discovery.js:69:undefined)
I/GeckoConsole( 7995): Content JS LOG: DISCOVERY: Send to 50625:
I/GeckoConsole( 7995): {
I/GeckoConsole( 7995):   "device": "flame-dev",
I/GeckoConsole( 7995):   "services": {
I/GeckoConsole( 7995):     "devtools": {
I/GeckoConsole( 7995):       "port": 34794,
I/GeckoConsole( 7995):       "encryption": true,
I/GeckoConsole( 7995):       "authentication": "OOB_CERT",
I/GeckoConsole( 7995):       "cert": {
I/GeckoConsole( 7995):         "sha256": "3B:A3:4F:99:FC:B9:0C:A1:C3:AD:10:04:6B:A2:F7:4D:1B:E8:1C:1F:8D:F0:69:D1:56:C6:D6:05:09:3A:C5:A2"
I/GeckoConsole( 7995):       }
I/GeckoConsole( 7995):     }
I/GeckoConsole( 7995):   }
I/GeckoConsole( 7995): } 
I/GeckoConsole( 7995):     at log (resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/devtools/discovery/discovery.js:69:undefined)



I don't see anything in the Browser console on the PC side.
BTW, 'raptor' is my laptop. Seems to be missing something on the other hand.
Okay, that's helpful!  The log appears to show the laptop sending a discovery ping to look for devices on the network.  The phone replied, so it looks like the phone is doing it's part correctly.

I am surprised we don't see logs on the computer...  Perhaps restarting Firefox is needed after changing the pref?  It seems it might only be loaded once at startup.  Also, in case there's confusion, the Browser Console is the thing accessed at Tools -> Web Developer -> Browser Console[1].  The logs should also be on your terminal if you launch Firefox from there.

The computer at least sent the ping message since your phone received it, so there should be logs of that.

Maybe it's some kind of OS or firewall issue?  Firefox is trying to listen for a multicast UDP reply from the device.

[1]: https://developer.mozilla.org/en-US/docs/Tools/Browser_Console
Here is what the browser console gives. Yes a restart was needed:

console.log: DISCOVERY: Send to 50624:
{
  "device": "raptor",
  "services": {}
}
console.log: DISCOVERY: PURGING MISSING DEVICES


Same in the Browser Console.

Yes I had the right console. Just needed to restart the browser.

Maybe it is a firewall issue indeed. Fedora 21 is quite closed by default.
(In reply to J. Ryan Stinnett [:jryans] from comment #6)
> Firefox is trying to listen
> for a multicast UDP reply from the device.

What port(-range) ?
Ok found it with the log. Making progress it found the device. - that's the problem.

Now b2g crashed scanning the QR Code.... :-/
Okay, I'm glad we figured out the UDP issue!  I'll keep this issue open in case we see that many people on Linux run into the same issue.  Potentially we can make some changes to improve things here.

(In reply to Hubert Figuiere [:hub] from comment #9)
> Now b2g crashed scanning the QR Code.... :-/

If you don't mind, let's take this to a new bug.  If it's possible to grab stack, that would be perfect.  Debugging b2g crashes is pretty tricky in my experience... :(
Summary: Can't find flame device on wifi. → Discovery UDP ports not open on some Linux distros
Filed bug 1148647 for the QR code scanning crash.
(In reply to Hubert Figuiere [:hub] from comment #8)
> (In reply to J. Ryan Stinnett [:jryans] from comment #6)
> > Firefox is trying to listen
> > for a multicast UDP reply from the device.
> 
> What port(-range) ?

To clarify for others, Firefox needs to listen on port 50625 for UDP packets.
Component: Developer Tools: WebIDE → Developer Tools: about:debugging
About:debugging bug triage. Filter on TRIAGE-JD201705

Temporarily setting P3 to bugs migrated from webide to cleanup the triage for about:debugging.
Priority: -- → P3
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.