kelinger / OmniStream

Deployment and management tools for an entire streaming platform that can reside on a server (local, remote, hosted, VPS) with media files stored on cloud services like Google Drive or Dropbox.
MIT License
31 stars 9 forks source link

Plex 404 #24

Closed Misterobots closed 1 year ago

Misterobots commented 1 year ago

I hate to be filing this issue, but I am at my wits end. I cannot get plex to work at all. I have tried multiple fresh installs. All other containers work without issue. Omnimount / my remote works without issue. I can backup and restore without issue. ONLY Plex continues to give me a 404. Please see my container log below (doesn't seem helpful), and I am happy to provide any other logs that can help.

[s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] 40-plex-first-run: executing... [cont-init.d] 40-plex-first-run: exited 0. [cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing... [cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0. [cont-init.d] 50-plex-update: executing... [cont-init.d] 50-plex-update: exited 0. [cont-init.d] done. [services.d] starting services Starting Plex Media Server. [services.d] done. Critical: libusb_init failed

It continues to show as "unhealthy", but never does anything beyond this.

I cannot find any other errors anywhere. Any advice or help is appreciated.

kelinger commented 1 year ago

Well, let's start with what it isn't: it doesn't seem that Plex itself is having any startup issues. My logs look nearly identical and I assure you that my Plex is working:

plex  | [s6-init] ensuring user provided files have correct perms...exited 0.
plex  | [fix-attrs.d] applying ownership & permissions fixes...
plex  | [fix-attrs.d] done.
plex  | [cont-init.d] executing container initialization scripts...
plex  | [cont-init.d] 40-plex-first-run: executing...
plex  | [cont-init.d] 40-plex-first-run: exited 0.
plex  | [cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing...
plex  | [cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
plex  | [cont-init.d] 50-plex-update: executing...
plex  | [cont-init.d] 50-plex-update: exited 0.
plex  | [cont-init.d] done.
plex  | [services.d] starting services
plex  | Starting Plex Media Server.
plex  | [services.d] done.
plex  | Jobs: Exec of ./CrashUploader failed. (2)
plex  | Critical: libusb_init failed
plex  | Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.

So let's investigate further: Start Plex with an omni up or docker restart plex command Go to the logs directory (command logs) Dump all the Plex health errors to the screen with grep Plex health

Assuming what you get is more than empty space/zero output, can you share the last few lines? They may look something like this:

Thu Oct 13 22:37:48 MST 2022 - Plex - Media failure
Sat Oct 15 07:34:59 MST 2022 - Plex service not running
Sat Oct 15 07:39:13 MST 2022 - Plex - OmniMount missing
Sat Oct 15 07:39:23 MST 2022 - Plex - OmniMount missing
Sat Oct 15 07:39:38 MST 2022 - Plex service not running
Misterobots commented 1 year ago

Thank you for the assistance!

The health logs seem to be a number of entries of :
Wed Oct 19 07:16:58 CDT 2022 - Plex service not running Wed Oct 19 07:17:08 CDT 2022 - Plex service not running Wed Oct 19 07:17:18 CDT 2022 - Plex service not running Wed Oct 19 07:17:33 CDT 2022 - Plex service not running Wed Oct 19 07:17:43 CDT 2022 - Plex service not running Wed Oct 19 07:17:53 CDT 2022 - Plex service not running Wed Oct 19 07:18:03 CDT 2022 - Plex service not running Wed Oct 19 07:18:14 CDT 2022 - Plex service not running

I can't seem to find any information on this to lead me in troubleshooting. If I've missed something common, I apologize. Thanks again for the help!

kelinger commented 1 year ago

This means one of two things: The "netstat" command is missing from the Plex Docker (which is normal but OmniStream should have installed this) OR Plex hasn't opened port 32400 internally.

Let's temporarily disable the healthcheck for Plex. Edit the 101-plex.yaml (or 101-plex-hw.yaml if you're using hardware transcoding) so that

    healthcheck:
      test: ["CMD-SHELL", "/plexcheck"]
      interval: 10s
      timeout: 2s
      retries: 3

gets commented out and looks like this:

    #healthcheck:
      #test: ["CMD-SHELL", "/plexcheck"]
      #interval: 10s
      #timeout: 2s
      #retries: 3

And then retry starting up Plex (omni up)

Misterobots commented 1 year ago

You were correct. It was related to the healthchecks. After commenting out the healthcheck lines within the yaml, Plex was able to start and be accessible. How can I resolve this to be "working as intended"?

Once again, thank you for the assistance. I moved over from Gooby (<3 TechPerplexed) and I love OmniStream.

kelinger commented 1 year ago

OK, so the good news is that "we have a workaround." Not ideal, but at least we're not blocking you from countless hours of top-notch entertainment :)

I've seen this happen to me if I ported over a "netstat" command from the pre-OmniStream versions. Previously, we were mapping netstat to one on the host but since the virtualized container may be running a different OS, this would sometimes fail. If that file is left over, then we can't install the right one.

Try this: docker stop plex docker rm plex docker system prune -a -f --volumes omni apps rm 101-plex* omni update

This will force a brand new Plex to be downloaded so that the install can proceed from scratch. The line where you're removing the plex YAML will force OmniStream to "self-heal" and grab that missing file so that you have the "genuine" build again (ie, the healthcheck won't be commented out). If we didn't do this, then your local file would exist but be different from that of the repository so we DON'T overwrite it during updates (there's a different process used if you want to make permanent customizations).

See if OmniStream / Plex starts up normally now. It is not unusual to see a couple "restarts" or "unhealthy" warnings but it should become available in a couple minutes (normally). Does this work?

If not, then we need to dive in deeper into why the healthcheck is failing.

Misterobots commented 1 year ago

SUCCESS! That worked!

Plex is now showing healthy, and working normally. Thank you!

Might this be a good "issue" to pin for future users? Could this scenario apply to other containers, not just Plex?

Again thank you for the assistance. You have a long time user now.

TechPerplexed commented 1 year ago

Kelinger and OmniStream for the win, as always👍

As for your request to pin the issue for future users, we will definitely consider that if it happens more often. So far, it doesn't seem to affect anyone else just that (ok, granted, we don't HAVE that many users yet, but still) - you're the first one to report this issue 😆

Glad it got sorted!

kelinger commented 1 year ago

As for pinning, probably not. However, this does seem to indicate we need to make sure it is understood that we are migrating the settings from previous versions to OmniStream, not the actual containers themselves. It's possible I'll add that to the setup script or @TechPerplexed could add it to the documentation. This would make sure we're all using the same starting point.

Misterobots commented 1 year ago

Excellent! Again, thank you for the excellent support!

TechPerplexed commented 1 year ago

@Misterobots Thank you for pointing out this issue. To finish this off, we have added the line (docker system prune -a -f --volumes) to the Gooby upgrade script, so that future "converts" will not run into this issue 😄