iharosi / homebridge-plex-webhooks

Plex Webhooks Server plugin for Homebridge
GNU Affero General Public License v3.0
48 stars 5 forks source link

mdns error #3

Closed WBWBW closed 3 years ago

WBWBW commented 3 years ago

Hi! I am getting this error when first running the plugin: ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server! Homebridge and Plex are running on the same (Synology) NAS inside Docker if that's any help.

iharosi commented 3 years ago

Hi! Could you please share your config? I assume Homebridge and Plex are in a separate Docker container, right? Have you checked your port settings for both container? Could you please share those as well? Also could you please share Synology DSM's network interface and Docker network settings?

DigitalElise commented 3 years ago

Im getting the same error with the same setup:

I ended up adding, "mdns": {"interface": "192.168.50.22"}, This stopped the mDNS errors but I still get

[12/7/2020, 11:48:12 PM] Got SIGTERM, shutting down Homebridge...

Every other plugin works perfectly,

Homebridge config:

    {
        "accessory": "PlexWebhooksServer",
        "name": "Movie",
        "port": "32400",
        "filter": [
            {
                "Player.title": "Living room"
            }
        ]
    }
iharosi commented 3 years ago

Thanks for sharing! I'll try to reproduce this issue on my Synology and I'll get back to you guys as soon as I have something. Until that please share your configs and network interface infos with me, these could help me to locate the problem. Thanks!

iharosi commented 3 years ago

@WBWBW, @DigitalElise, could you please tell me which container are you using for homebridge? Is this one?: https://registry.hub.docker.com/r/oznu/homebridge/

WBWBW commented 3 years ago

Here is my config:

{
    "accessory": "PlexWebhooksServer",
    "name": "Plex",
    "host": "192.168.0.12",
    "port": "32400",
    "filter": [
        {
            "Player.title": " Living Room (2)"
        }
    ]
}

Homebridge v1.2.4 is running on port 51826 in a Docker container. Plex on port 32400 but it's not a container, it's a Synology package.

Here are the docker settings: https://imgur.com/HZQPiVp and Synology: https://imgur.com/Glu9IG3

Let me know if you need anything else.

WBWBW commented 3 years ago

@WBWBW, @DigitalElise, could you please tell me which container are you using for homebridge? Is this one?: https://registry.hub.docker.com/r/oznu/homebridge/

Yes it is the one.

iharosi commented 3 years ago

@WBWBW, @DigitalElise I've created the container based on this instruction: https://github.com/oznu/docker-homebridge/wiki/Homebridge-on-Synology#limitations Installed homebridge-plex-webhooks with a basic config:

"accessories": [
        {
            "accessory": "PlexWebhooksServer",
            "name": "Plex Movies",
            "port": "32405",
            "filter": [
                {
                    "Account.title": "iharosi",
                    "Metadata.librarySectionType": "movie"
                }
            ]
        }
    ],

And everything is working for me, there are no errors in the console:

[12/7/2020, 6:29:37 PM] [HB Supervisor] Starting Homebridge with extra flags: -I -P /homebridge/node_modules
[12/7/2020, 6:29:37 PM] [HB Supervisor] Started Homebridge v1.2.4 with PID: 658
[12/7/2020, 6:29:37 PM] Loaded config.json with 1 accessories and 1 platforms.
[12/7/2020, 6:29:37 PM] ---
[12/7/2020, 6:29:38 PM] Loaded plugin: homebridge-plex-webhooks@1.1.1
[12/7/2020, 6:29:38 PM] Registering accessory 'homebridge-plex-webhooks.PlexWebhooksServer'
[12/7/2020, 6:29:38 PM] ---
[12/7/2020, 6:29:38 PM] Loaded plugin: homebridge-config-ui-x@4.35.0
[12/7/2020, 6:29:38 PM] Registering platform 'homebridge-config-ui-x.config'
[12/7/2020, 6:29:38 PM] ---
[12/7/2020, 6:29:38 PM] Loading 1 platforms...
[12/7/2020, 6:29:38 PM] [Config] Initializing config platform...
[12/7/2020, 6:29:38 PM] [Config] Running in Service Mode
[12/7/2020, 6:29:38 PM] Loading 1 accessories...
[12/7/2020, 6:29:38 PM] [Plex Movies] Initializing PlexWebhooksServer accessory...
[12/7/2020, 6:29:38 PM] [Plex Movies] Plex Webhooks Server is listening at http://10.12.12.5:32405
Setup Payload:
X-HM://0023ISYWY9HE1
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 031-45-154 │     
    └────────────┘     

[12/7/2020, 6:29:38 PM] Homebridge v1.2.4 is running on port 51074.

Are you guys using firewall on your DSM?

WBWBW commented 3 years ago

I am not using the firewall no. Here is the full error message:

[12/7/2020, 9:42:22 AM] ERR_SERVER_CLOSED: Cannot send packets on a closed mdns server! at MDNSServer.assertBeforeSend (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:403:13) at MDNSServer.sendOnAllNetworksForService (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:302:10) at MDNSServer.sendQueryBroadcast (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/MDNSServer.ts:263:26) at Prober.sendProbeRequest (/usr/local/lib/node_modules/homebridge/node_modules/@homebridge/ciao/src/responder/Prober.ts:165:17) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

I will try with a new HB Container.

DigitalElise commented 3 years ago

Alright, I got it working. It was my fault in not understanding port settings correctly.

It also threw errors until I added

"mdns": {"interface": "192.168.50.22"},

to the very first line of homebridhge config, Thanks @iharosi and @WBWBW for your assistance and holding my hand to find the solutions.

@WBWBW Try adding the line above as for mDNS as mine didn't work until that was added.

iharosi commented 3 years ago

Here is my config:

{
    "accessory": "PlexWebhooksServer",
    "name": "Plex",
    "host": "192.168.0.12",
    "port": "32400",
    "filter": [
        {
            "Player.title": " Living Room (2)"
        }
    ]
}

Homebridge v1.2.4 is running on port 51826 in a Docker container. Plex on port 32400 but it's not a container, it's a Synology package.

@WBWBW, @DigitalElise Also, please make sure you don't have conflicting ports! For PlexWebhooksServer the port should be different from what Plex is using because this plugin is creating a web service for Plex's webhooks. That's why the default port for this plugin is 32401 and not 32400! You can easily omit port option it's not a required one.

Please confirm me if you can get it to work then I can close this ticket. Thanks!

WBWBW commented 3 years ago

Sorry I also misunderstood the port setting and had it set to the Plex port. So sorry. Leaving it to the default works!