Stop Plex filling up my log

I get hundreds of this set of messages in my log every day. They’re always the same 6 connections (all of them are connections to my Plex server machine, the two local IPs are lan and wifi). They come in bursts, I’ll get this same set of messages every second for a period of time (approx between 5 and 30 seconds). Then some minutes later (roughly between 10 and 30 minutes) it’ll happen again.

2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Testing 6 resource connections..
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): https://192-168-0-2.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): https://192-168-0-5.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): https://86-16-135-85.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): http://192.168.0.2:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): http://192.168.0.5:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Resource connection OK (0s): http://86.16.135.85:32400?X-Plex-Token=<hidden>
2020-12-08 02:36:00 INFO (SyncWorker_51) [plexapi] Connecting to Resource: https://192-168-0-2.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>

I have this in my configuration.yaml:

logger:
  default: warning
  logs:
    homeassistant.components.plexapi: critical
    homeassistant.components.plex: critical

My default log level is ‘warning’, but these messages seem to be ‘info’. Why are they appearing in my logs? How do I disable them? It makes it difficult to track down other issues when I have to scroll through pages and pages and pages of these Plex messages.

These are from the underlying library. Change your logger config for the second entry to just “plexapi” to avoid seeing them.

However I’m curious why this is happening so frequently. Can you run your Plex integration at info level (or even debug) to see what else is going on when these log entries are triggered? I don’t want you to cover up another issue if there is one.

Off the bat, are you perhaps running Plex in a Docker container? If so, what’s the networking setup for that container?

Thanks for the reply!

I enabled debug and restarted. Nothing appeared in the logs for the first few minutes, but as soon as I started playing something on Plex it generated this:

2020-12-08 10:13:48 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:13:49 DEBUG (SyncWorker_23) [homeassistant.components.plex.server] Current available clients from plex.tv: [<MyPlexResource:Chrome>, <MyPlexResource:Opera>]
2020-12-08 10:13:49 DEBUG (MainThread) [homeassistant.components.plex.server] New Plex Web from PMS: 3u9y4k2klw732uwcoe3in6el
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Testing 6 resource connections..
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): https://192-168-0-2.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): https://192-168-0-5.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): https://86-16-135-85.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): http://192.168.0.2:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): http://192.168.0.5:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Resource connection OK (0s): http://86.16.135.85:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 INFO (SyncWorker_34) [plexapi] Connecting to Resource: https://192-168-0-2.a89fe54d8a9244538d5a46b1ea01d0a5.plex.direct:32400?X-Plex-Token=<hidden>
2020-12-08 10:13:49 DEBUG (SyncWorker_34) [homeassistant.components.plex.server] plex.tv resource connection successful: <PlexClient:https://192-168-0-2.:Opera>
2020-12-08 10:13:49 DEBUG (MainThread) [homeassistant.components.plex.media_player] New entities: [{'device': <PlexClient:http://192.168.0.2:3:Opera>, 'player_source': 'PMS'}]
2020-12-08 10:13:49 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:13:49 DEBUG (MainThread) [homeassistant.components.plex.media_player] Added media_player.plex_plex_web_opera_3 [f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el]
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.server] New Plex Web from PMS: it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.media_player] New entities: [{'device': <PlexClient:http://192.168.0.2:3:Chrome>, 'player_source': 'PMS'}]
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:13:52 DEBUG (MainThread) [homeassistant.components.plex.media_player] Added media_player.plex_plex_web_chrome_windows [f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b]
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_chrome_windows [<PlexClient:http://192.168.0.2:3:Chrome> / <Episode:97862:QI-s15e15>]
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:13:57 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_chrome_windows [<PlexClient:http://192.168.0.2:3:Chrome> / <Episode:97862:QI-s15e15>]
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:14:06 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_chrome_windows [<PlexClient:http://192.168.0.2:3:Chrome> / <Episode:97862:QI-s15e15>]
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:14:07 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_chrome_windows [<PlexClient:http://192.168.0.2:3:Chrome> / None]
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:14:08 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.server] Updating devices
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:it1iascpez1zfbmkg6ccbn0b
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.server] Refreshing f9528a862bd252850a24daeb230857f8d591cecd:3u9y4k2klw732uwcoe3in6el
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_chrome_windows [<PlexClient:http://192.168.0.2:3:Chrome> / <Episode:97863:QI-s15e16>]
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.media_player] Refreshing media_player.plex_plex_web_opera_3 [<PlexClient:http://192.168.0.2:3:Opera> / None]
2020-12-08 10:14:13 DEBUG (MainThread) [homeassistant.components.plex.sensor] Refreshing sensor [sensor-f9528a862bd252850a24daeb230857f8d591cecd]

Is it possible these 8 rows of messages simply happen every time someone starts a stream? My Plex server is fairly busy, I use it myself most of the day, and in any 24h period there could be as many as 50 external streams from friends and family.

Plex is running on my main desktop Mac. It’s just installed via the regular installer, I don’t think it’s in docker but I don’t actually know.

Regarding the config entry do you mean like this?:

logs:
    homeassistant.components.plexapi: critical
    plexapi: critical

Thanks!

Edit: I just tested playing a few different streams from local devices around my house, and also my phone with wifi off, and they do not seem to trigger the 8 rows of Info messages.

Thanks, that gives a lot of good info. Everything in the logs you posted looks totally normal, so perhaps you’re not seeing the same behavior yet.

There are several ways we discover new Plex clients:

  1. Reported by the local Plex Server. This usually requires the Plex client to be on the same subnet as the Plex server.
  2. Network scanning (GDM). This usually requires the Plex client to be on the same subnet as the Home Assistant host.
  3. From plex.tv. Plex clients report their presence occasionally to plex.tv services which we can poll.

The “resource connection” messages from plexapi are triggered the first time when attempting to connect via methods 2 or 3. If you’re seeing these messages repeatedly for the same clients then perhaps they’re disconnecting and reconnecting after going idle.

Is this Opera Plex Web client perhaps on a different local subnet?

If you’re able to capture the original behavior at this log level it would be very helpful.

Thanks again. The Opera web client is on the same machine as Plex, it’s the one I use to manage my library but I don’t watch anything in it. The Chrome client is on a separate PC next to it. They’re all on the same subnet.

I’ll post again when i see many repeated entries over a few seconds.

Everything is working fine, it’s just this excessive logging.

Okay I’ve left debug on all day, and have a nice sample for you. It’s 47 occurrences over a 30 minute period. It’s 500+ lines so I’ve linked it here.

For context I had 105 occurrences today in the last 9 hours. I’ve been streaming on another PC for those entire 9 hours. So at least for some parts of the day I wasn’t getting these messages, but I was streaming something.

All messages are at the debug level and appear expected during normal use. I do not see the INFO-level plexapi resource connection messages originally referenced.

Perhaps those resource connection messages are triggered when certain Plex Web clients are re-opened or have new activity after being idle for some time.

Ok great :slight_smile: Plex has been working perfectly so as long as I can stop the INFO messages I’m happy. Thanks for looking into it!

To be clear I don’t have anything to go on yet from the latest logs. If the “resource connection” messages appear again while you have the Plex debug logs enabled let me know.

It may turn out to be expected behavior and I can just push an update to drop those messages to a lower logging level.