PMS stopped honoring temporary directory setting. Now uses /tmp

Server Version#: 1.19.3.2843

Recently Plex server stopped honoring the setting:

TranscoderTempDirectory="/plex/tmp"

It created a directory /tmp/pms- and files in /tmp that look like random uuids. I have only recently ran into this issue after running PMS for at least 5 years. The files and dir were created a little after 3:00am, but I don’t see that anyone was accessing the PMS at that time.

I’m running on the beta channel, but will be reverting to stable to see if the problem goes away.

3 Likes

Logs please which capture this?

Ah ha! I found this in the log:
Plex Media Server.5.log:May 23, 2020 05:00:24.051 [0x7f65827fc700] DEBUG - Job running: EAE_ROOT='/tmp/pms-d4409607-1179-44e8-8b4e-87c3756b9916/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Codecs/99c90e0-3095-linux-x86_64/' XDG_CACHE_HOME='/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:1' 'eac3_eae' '-eae_prefix:1' '6632720a-aec5-4a0c-aae2-ae8c3e48cf77_' '-analyzeduration' '20000000' '-probesize' '20000000' '-i'

I’m not sure what started provoking this, it it appears that the EAE_ROOT is the problem. Where can I set EAE_ROOT so it doesn’t sue the default /tmp volume?

1 Like

Pretty sure that is the new ‘Skip Intros’ feature, that scans your TV Shows to detect the Intros. It has been added with the latest release of PMS (and is enabled by default)

I used the systemd edit command to set new env variables. I set the override.conf like so:

[Service]
Environment=PLEX_MEDIA_SERVER_TMPDIR=/plex/tmp
Environment=EAE_ROOT=/plex/tmp

I thought the TMPDIR was handled by setting that in the WebUI (which writes out Preferences.xml). Not sure why EAE_ROOT is using /tmp. It could have been using it for awhile, but I never noticed it until something else happened (even a change in how I’ve been using Plex Server).

Hopefully it will make it through the night without this problem. Would it be possible for Plex Server to honor a global tmp setting for whatever it is doing?

1 Like

Oh interesting! I just checked and, sure enough, it is on. I don’t have an issue with it being on by default, but I would like the feature to honor the tmp dir setting.

1 Like

My Transcoder temp directory is a ram disk to keep the files off the SSD. I wonder if I move this new temp directory to the RAM disk, would it add any efficiency or speed to the intro detection process?

EAE_ROOT isn’t a variable I know of. Where did you get that information?
(I’m aware of what the transcoder uses. Specifically, where is it set as externally accessible?)

It was shown in the logfile snippet I posted.

1 Like

That’s the internal communication between PMS and the transcoder.

AFAIK, there is no user-facing variable you can set. I looked through the source code.

It is my understanding that EAE operates based on Plex’s normal temp directory. It created sub directories for each session under it.

Even if you did set the variable, PMS is going to overwrite it as it passes it to the transcoder.

To be certain I don’t get it wrong, I’ve sent a message to the team to ask clarification

I also overrode PLEX_MEDIA_SERVER_TMPDIR in case that is different from the Preferences.xml file. It seems to me that EAE_ROOT should honor one of those settings. Could you get clarification on which one it honors? If it is its own thing, then there needs to be a way to set it.

1 Like

Which distribution and version is this running on?

Is it systemd based or init based?

I ask because some of the older variables where brought forward when I added SYSV-init compatibility back into PMS.

EDIT: I see now it’s systemd

1 Like

I’m using Fedora 31 which is systemd based. The service file (which is included in the RPM package) has these variables in it:

[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/
Library/Application Support"
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp

I created an override.conf file that changes the PLEX_MEDIA_SERVER_TMPDIR var and I also added the EAE_ROOT (but I’m not sure if it will do anything).

1 Like

I looked again in the PMS source code.
From what I can see,

  1. it’s using PLEX_MEDIA_SERVER_TMPDIR as the foundation to create EAE_ROOT variable, along with the others, just prior to launch.
  2. They use the kernel’s Notify mechanism to monitor the output files from the EAE (it has a primitive interface but must remain as it is)

I don’t see where you can set it. When did you have the ability to set it?

1 Like

Oh good! So it does use TMPDIR var. I wish it would use the Preferences.xml so it is easy to set from anywhere.

The way I’m setting it is to create an override.conf file in /etc/systemd/system/plexmediaserver.service.d. I put these items in the file:

[Service]
Environment=PLEX_MEDIA_SERVER_TMPDIR=/plex/tmp
Environment=EAE_ROOT=/plex/tmp
1 Like

What you have there is ok except that EAE_ROOT is not user-facing.

Moving the TMPDIR is sufficient.

1 Like

Ah! Ok. It appears that before the new feature, the Preferences.xml file did what I needed it to do. This is not good enough with the skip intro feature. Hopefully tonight, the PLEX_MEDIA_SERVER_TMPDIR setting fixes the issue with /tmp.

My recommendation is that there is a clearly labeled setting (WebUI?) that covered all uses of a temporary directory.

1 Like

Settings - Server - Transcoder - Show Advanced:

Transcoder temporary directory

__________________________________________
Directory to use when transcoding for temporary files.

Yes, that is the setting I’ve had for something like 5 years now. The problem is that EAE_ROOT doesn’t know about that setting! I hope that this disconnect will be fixed.

1 Like

I am having the exact same issue on Ubuntu 18.04/systemd.

So should I apply the override to systemd or is there a fix in the pipeline?

I can continue to delete files if there is an imminent fix coming soon.