Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

AlertListener does not work with some hosts on Linux #143

Closed
ReenigneArcher opened this issue Aug 19, 2023 · 13 comments · Fixed by #201
Closed

AlertListener does not work with some hosts on Linux #143

ReenigneArcher opened this issue Aug 19, 2023 · 13 comments · Fixed by #201
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ReenigneArcher
Copy link
Member

Describe the Bug

Plex alert listener fails to start on Linux (when using ipv6?) and the following error appears in the logs.

ERROR (alert:94) - getsockaddrarg: bad family

Expected Behavior

No response

Additional Context

IPv6 is likely disabled in Plex's python build.

We can possibly patch python-plexapi to setup websocket-client properly. https://github.com/ReenigneArcher/python-plexapi/blob/c41d98170b3761b8edc7d75970a01b80bb6281c6/plexapi/alert.py#L55

https://websocket-client.readthedocs.io/en/v0.59.0/examples.html?highlight=socket#using-unix-domain-sockets

majek/puka#27

qpython-android/qpysl4a#2

@ReenigneArcher ReenigneArcher added bug Something isn't working help wanted Extra attention is needed labels Aug 19, 2023
@garlik82
Copy link

garlik82 commented Sep 17, 2023

Getting this error, but I have ipv6 disabled everywhere. Running Plex on a Synology NAS, not under docker.

Themerr-plex 0.2.0

EDIT: same with running Plex on Mac OS

@ReenigneArcher
Copy link
Member Author

@garlik82 I submitted a PR to address this in python plexapi, but unfortunately I don't think it will work in Python 2.7.

But yes, I now think it's an issue on (some) unix devices.

@garlik82
Copy link

No way around it then?

@ReenigneArcher
Copy link
Member Author

Not at this time, but next version will not require the alert listener at least.

@garlik82
Copy link

Hit me up when you have a version to test. Thank you for your work.

@ReenigneArcher ReenigneArcher changed the title AlertListener does not work with ipv6 hosts on Linux AlertListener does not work with some hosts on Linux Sep 24, 2023
@ReenigneArcher
Copy link
Member Author

@garlik82 you can try nightly. Alert listener won't work but there is now a scheduled task option.

@garlik82
Copy link

garlik82 commented Sep 25, 2023

@garlik82 you can try nightly. Alert listener won't work but there is now a scheduled task option.

How do I trigger that task?

EDIT: nevermind

@garlik82
Copy link

I must be doing something wrong. I see no errors in the log but I also don't get any themes.
dev.lizardbyte.themerr-plex.log

@ReenigneArcher
Copy link
Member Author

Please reach out on our discord. https://app.lizardbyte.dev/discord

@Shawn9347
Copy link

Not at this time, but next version will not require the alert listener at least.

By next version you mean the next version of Themerr?

@zdimension
Copy link
Collaborator

This can be fixed by using 127.0.0.1 instead of localhost as Plex's URL in plex_api_helper.py. The error comes from the fact that localhost resolves to ::1 by default on many Linux distros, but the WS API expects an IPv4-family address.

@ReenigneArcher
Copy link
Member Author

@zdimension Thanks for that info! I will put up a "fix" once plexapi is updated on pypi after pkkid/python-plexapi#1281.

@Shawn9347
Copy link

This can be fixed by using 127.0.0.1 instead of localhost as Plex's URL in plex_api_helper.py. The error comes from the fact that localhost resolves to ::1 by default on many Linux distros, but the WS API expects an IPv4-family address.

I can confirm that this works. Awesome. Thank you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
5 participants