hensm / fx_cast

Chromecast Web Sender SDK implementation for Firefox
https://hensm.github.io/fx_cast/
MIT License
1.89k stars 64 forks source link

Issue with Firefox 118.0? #282

Open davetansley opened 1 year ago

davetansley commented 1 year ago

OS version: Linux Mint Browser version: FireFox 118.0 Extension version: 0.3.1 Bridge version: 0.3.0

Description The extension was working really well until I updated to FireFox 118.0. Now I get the "There is a problem with a bridge" message in the popup. Every few seconds, it will show the list of devices for a split second, then go back to the message.

The log from the browser console shown below is repeated every few seconds.

Steps to reproduce

  1. Load FireFox 118.0
  2. Click the extension icon
  3. The popup shows the "There is a problem with the bridge" message

Expected behaviour A list of devices should be shown.

Logs stderr output from native app fx_cast_bridge: TypeError: Cannot read properties of null (reading 'send') stderr output from native app fx_cast_bridge: at Client.send (/snapshot/app/node_modules/castv2/lib/client.js:128:11) stderr output from native app fx_cast_bridge: at Channel.send (/snapshot/app/node_modules/castv2/lib/channel.js:34:12) stderr output from native app fx_cast_bridge: at RemoteTransport.sendMediaMessage (/snapshot/app/build/src/bridge/components/cast/remote.js) stderr output from native app fx_cast_bridge: at /snapshot/app/build/src/bridge/components/cast/remote.js stderr output from native app fx_cast_bridge: WARNING The program 'fx_cast_bridge' uses the Apple Bonjour compatibility layer of Avahi. stderr output from native app fx_cast_bridge: WARNING Please fix your application to use the native API of Avahi! stderr output from native app fx_cast_bridge: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html stderr output from native app fx_cast_bridge: WARNING The program 'fx_cast_bridge' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. stderr output from native app fx_cast_bridge: WARNING Please fix your application to use the native API of Avahi! stderr output from native app fx_cast_bridge: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html stderr output from native app fx_cast_bridge: WARNING The program 'fx_cast_bridge' uses the Apple Bonjour compatibility layer of Avahi. stderr output from native app fx_cast_bridge: WARNING Please fix your application to use the native API of Avahi! stderr output from native app fx_cast_bridge: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html stderr output from native app fx_cast_bridge: WARNING The program 'fx_cast_bridge' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. stderr output from native app fx_cast_bridge: WARNING Please fix your application to use the native API of Avahi! stderr output from native app fx_cast_bridge: WARNING For more information see http://0pointer.de/blog/projects/avahi-compat.html stderr output from native app fx_cast_bridge: /snapshot/app/node_modules/castv2/lib/client.js:128 stderr output from native app fx_cast_bridge: this.ps.send(buf);

hensm commented 1 year ago

Seen this error a few times before (not the Avahi stuff, that's always there). It's trying to send a message when there isn't an open socket. I don't think this would be related to Firefox 118 since it happens entirely within the bridge. I can't reproduce this on 118 either. Is there anything else that might have changed?

davetansley commented 1 year ago

Hmmm, I can't think of anything else that would have changed in that timeframe (that's why I initially suspected FF118). Do you have any idea of the kind of config changes that would cause the bridge to not be able to open a socket? Are there any more detailed logs for the bridge component?

davetansley commented 1 year ago

I did some more sleuthing with this issue, though I'm not sure I have the answer.

Given that the list of devices appears momentarily, then is replaced by the "Something went wrong with the bridge" error, I reasoned that maybe one of my cast devices was causing issues.

So initially I moved my laptop and one cast device to a guest network. Sure enough, fx_cast was stable and could cast to this one device.

Next, I moved back to my normal network and turned off every cast device. I then tried adding them back one by one. This seemed to work, to a point. The list of devices was stable with every one added back, until it started crashing again after three or four.

However, I've not been able to single out a particular device. Number seems somehow more important than actual device, and I've even had a situation where the cast menu was stable at four devices, then would start crashing after ten minutes or so.

Which leads me to suspect there's maybe a networking thing going on with my mesh devices.

I'll keep sleuthing.

davetansley commented 1 year ago

I've narrowed it down a little more.

The extension is stable until I add in one of two particular devices: A "Chromecast with Google TV" and a "Google Nest Hub".

The rest of my network (2 Google Homes, 1 Google Nest Mini and 2 Chromecast Ultras) seem to work fine. I've tried excluding everything from my network except the two breaking devices. With just one of them connected, it causes the extension to crash (which would rule out conflicts with other devices).

There's nothing odd about these devices, and their config hasn't changed recently (they may have received OTA updates). They have different IPs, different MAC addresses etc.

1) Is there a possibility that an error communicating with one device will cause the bridge to fail? 2) If so, would it be possible to trap errors with single devices so that the extension could still be used? 3) Are there any deeper logs I can provide that might indicate why these two devices are causing issues?

hensm commented 1 year ago

Interesting, I'm not sure what would be causing this behaviour. I don't have a Chromecast with Google TV anymore so I can't test this myself.

Is there a possibility that an error communicating with one device will cause the bridge to fail?

Yeah, it's a bug in the bridge really that it's not handling the error and allowing the entire process to crash. The bridge isn't really in a great state, honestly. The only logs will be what Firefox picks up from stderr.

Maybe see if the devices are reachable at all?

davetansley commented 1 year ago

They devices are definitely reachable - I can cast to both from Chrome on the same laptop.

hensm commented 1 year ago

Difficult to find the time to work on this lately, but I'll try to do a bit of digging and maybe put together a bridge build with some better logging. At the very least I'd like to prevent one device from taking down the entire bridge.

davetansley commented 1 year ago

Yeah, no worries, and much appreciated. I can work around it for now. But, if you need help testing a build, let me know.

hensm commented 1 year ago

Got a build with some extra logging (source): fx_cast_bridge-0.3.0-x64.zip

Should work for Linux Mint (I assume you use the deb package). Haven't changed the version number, so you need to remove any existing deb package since package upgrade won't work.

davetansley commented 1 year ago

Great, thanks for this.

I've attached the log from the browser console when it starts up. I've removed any device IDs... no idea if it's safe to share there, but just to be on the safe side.

The device at 192.168.1.117 which seems to be mentioned in all the errors is the Google Nest Hub that I mentioned as being one of the problem devices.

Does this shine a light on the issue?

fxcastlog.txt

davetansley commented 1 year ago

Oh! And I've just realised that the bridge is now working with this build! So many thanks for that! :)

gtridr commented 1 year ago

Can confirm I'm also seeing this issue on arch. I'll test tomorrow, once I can set aside time to rework the PKGBUILD

evmoriarty commented 1 year ago

Can confirm too, I'm seeing this same issue on Ubuntu 22.04 LTS.

TomTasche commented 11 months ago

Can confirm that the above build works fine on Ubuntu 23.10 and Firefox 120.0. Thanks a lot!

zavbala commented 9 months ago

I've installed on my Mac M1, same issues :(

BenoitDuffez commented 7 months ago

Same on Ubuntu 23.10 with FF 125. I can collect traces or install debug builds if needed. The traces are the same as in OP.

davetansley commented 5 months ago

Got a build with some extra logging (source): fx_cast_bridge-0.3.0-x64.zip

Should work for Linux Mint (I assume you use the deb package). Haven't changed the version number, so you need to remove any existing deb package since package upgrade won't work.

This build has been working pretty much great for me that last few months. Would it be possible to get an rpm build with the same fix?

Many thanks.