Error while decoding stream #0:1: Unknown error occurred; [eac3_eae @ 0xc7ea80] error reading output

Server Version#: 1.19.3.2843
Player Version#: 4.34.2
Lately been noticing this in my syslog:

May 24 08:53:40 omv Plex Media Server[5555]: No data written!
May 24 08:53:40 omv Plex Media Server[5555]: decoder returned no data

Followed by this:

May 24 08:55:27 omv Plex Media Server[5555]: ERROR: Could not open the input file (No such file or directory)
May 24 08:55:29 omv Plex Media Server[5555]: ERROR: Could not open the input file (No such file or directory)

Corresponding to this in the Plex logs:

May 24, 2020 08:53:40.001 [0x7ff38b7ee700] ERROR - [Transcoder] [eac3_eae @ 0x16bb840] error reading output
May 24, 2020 08:53:40.002 [0x7ff4167fc700] ERROR - [Transcoder] Error while decoding stream #0:1: Unknown error occurred

I have the Plex logs (not at Debug level) as well as some of the syslog if needed, but I couldn’t find anything not quoted here. These errors repeat a lot. For years I’ve pointed Plex to a Transcoder temporary directory on an NVMe drive, but for fun I changed that directory to blank. Made no difference.

I’m not aware of any impact to viewing in Plex, it’s only concerning because I have no idea what’s going on.

Thanks!
Mark M

Mark,
I need the DEBUG logs. syslogs and/or error-only isn’t enough.

First question is: Do you now have more than 8192 directories being monitored in total (Notify)? Your DEBUG logs will report this at startup.

Hi Chuck,

I’ve turned on debug logging, unfortunately this happens at unpredictable times and rolls the logs pretty quickly. Ditto syslogs.

Exactly which log has the number of directories being monitored? I’ve downloaded the logs right after turning on debug and so far haven’t found it.

Thanks,
Mark

If it helps, until you can tell me where to find how many directories are being monitored, I can say it’s likely there are greater than 8192 directories if it means what I think it means.

Each of my movies is in a separate directory. There are 7772 movies in a library I share, and another 17 in a non-shared library. Many of these directories have subdirs for Behind The Scenes, Trailers, etc.

Also 361 TV shows shared, with the normal show directory layout (Seasons and Specials). And another 42 TV Shows in a non-shared library.

I can tell you both:

  1. How to determine how many are being monitored
  2. How to address it

Watching PMS restart, with DEBUG logging enabled, will report “No space left on device” when the kernel’s table fills.

Thanks Chuck, I’m sure you’re on to the problem. One caveat is that my PMS is not configured to update automatically. I initiate scans manually. But I suspect that isn’t key.

Running find as shown against my single top level directory yields 15,867. The odd thing is, that’s almost double the 8,192 limit. Meaning I’d have expected to see these errors long ago. But I suppose I could have missed it, I don’t gaze on my syslog often.

Would you please clarify for me where exactly I will see the message ‘No space left on device’ if there is one?

The error will be in Plex Media Server.log , or one of its rollover files, after a PMS restart.

Per the 'decoder returned no data" error, there are a couple possibilities. I do not know which, if any, apply to your use-case.

  1. Temp or PMS directory on a network share - File locking / Notification isn’t supported yielding conflicts / failures when more than one file streaming. Plex uses Notify for the transcoder whether you use it or not.

  2. Damage codec – unlikely if it works at all.

  3. Corrupt/damaged media

I’ve found this in a rolled Plex Media Server.log repeatedly:

May 24, 2020 08:52:47.731 [0x7ff4167fc700] ERROR - [Transcoder] Error while decoding stream #0:1: Unknown error occurred
May 24, 2020 08:52:47.732 [0x7ff415ffb700] ERROR - [Transcoder] Could not write header for output file #0 (incorrect codec parameters ?): No space left on device

Is that the message you mentioned?

  1. If by Temp you mean /tmp and by PMS directory you mean the Plex metadata directory, then neither is on a network share. What is on a share is the high level directory I scanned just now.
  2. Plex seems to work normally from the viewer’s point of view.
  3. I suppose corruption is possible. Any suggestions for how to narrow that down?

Oh, BTW, adding up the movies & tv shows I gave you earlier is exactly 8,192.

Maybe meaningless but I thought it was quite a neat coincidence.

I have to split for a while, I’ll check in later. Meanwhile, thanks so much for your help!

If you have 8192 moves and tv shows, you need increase it IF you enable automatic update of the library.

Reason is simple: 8192 fills the table. Transcoder needs 2 slots for each EAE audio session. It won’t have any available causing the session to fail.

If increasing, bump to 32768 or 65536 and you’ll be set for a long time. (unless you add photos or music directories)

But why is automatic update key? Won’t it be a problem if I kick off scanning for my libraries manually also (as I do)?

I will bump to 65,536 because I neglected to point out that there is an Audio Library I forgot about and a small Photo library as well. But the total directory entries I gave you (15,867) is correct, because all the libraries hang off the same top level dir.

I am confused about the calculation of memory required though. If I use the last example given here: Increase the number of directories Linux can monitor (Notify), then I come up with 262,144 * 512 = 134,217,728 bytes = 134 MB. But the example indicates the system had 8 GB of RAM. So that’s way more RAM than needed, right?

If the calculations are correct, then my 65,536 * 512 = 33,554,432 bytes = 33 MB. I have 4 GB of RAM now. So I don’t need to buy more RAM, right?

The reason it’s important is:

PMS sets an inotify_watch on each monitored directory.
Enabling automatic update activates use of the inotify kernel service.
When PMS is done loading the table, it waits for the next ‘event’ .

The kernel sends an event when changes are detected for a particular directory. PMS automatically knows what changed and can go scan the directory again to find out what did change then proceed accordingly. Maybe it was new media, maybe it was a deletion.

The EAE (Dolby) portion of the transcoder also uses two inotify slots.

your math is correct. 64K slots @ 1/2 KB per slot = 32MB of RAM added to the kernel.

The caution about adding is for those configurations (such as memory-limited NAS systems) where 2GB or 4GB of RAM is all that’s available. In those cases, allocating 512K slots (I’ve seen it happen) is a huge waste of resources and has a down-stream impact on overall performance.

For now, you’re fine.

Okay, done:

root@omv:/var/log/openmediavault# tail !$
tail /etc/sysctl.conf
# Protected links
#
# Protects against creating or following links under certain conditions
# Debian kernels have both set to 1 (restricted)
# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt
#fs.protected_hardlinks=0
#fs.protected_symlinks=0

fs.inotify.max_user_watches=65536

root@omv:/var/log/openmediavault#

Just now put in this change and rebooted. Haven’t seen the errors I reported in the log since yesterday, but I’ll keep my eye on it. Also kept Plex DEBUG logging on. And enabled syslogging in Plex per https://support.plex.tv/articles/201105343-advanced-hidden-server-settings:

root@omv:/etc/systemd/system/plexmediaserver.service.d# cat override.conf
Environment="PLEX_MEDIA_SERVER_USE_SYSLOG=true"

root@omv:/etc/systemd/system/plexmediaserver.service.d#

And finally, increased number of Plex log files with LogNumFiles=“100”:

root@omv:/srv/dev-disk-by-label-data1/plexmediaserver/Library/Application Support/Plex Media Server# cat Preferences.xml
<?xml version="1.0" encoding="utf-8"?>
<Preferences MachineIdentifier="fdbd51b4-e129-4f8c-aea9-55fe13ba0c1a" ProcessedMachineIdentifier="441102e7f5903031c52dc5a3fffec3463585448e" AnonymousMachineIdentifier="b3199ed9-3495-4f66-9b31-8090610a2300" agentAutoEnabled.com.plexapp.agents.lastfm.Artists.com.plexapp.agents.vevo="1" MetricsEpoch="1" GracenoteUser="WEcxAwWaIsR6P3lUPVSNPM+StF9GBqKDfD8Vp8kCeaOP/qvD4nGuthRnpuyKeZnyHxVLsZxhyYpyVB/8/jugev8OhvQEd1z3xjvWmOuV1HxBR/yXHmB7klZFkv4ycqNETdytwmum8xt7wj7j2QvJoDHMrSUyx3DL6tOYrm6fsPpR++GE6cyC93z6mM+vbE8hWP2g" AcceptedEULA="1" PlexOnlineToken="QahCGQextm5ZyE1JaFLD" PlexOnlineUsername="omv_admin" PlexOnlineMail="markmarz77@gmail.com" CertificateVersion="2" PubSubServerPing="71" FriendlyName="omv_server" PublishServerOnPlexOnlineKey="1" LastAutomaticMappedPort="17814" CloudSyncNeedsUpdate="0" LanguageInCloud="1" ApertureSharingEnabled="0" ButlerEndHour="8" ButlerStartHour="7" iPhotoSharingEnabled="0" iTunesSharingEnabled="0" ButlerTaskCheckForUpdates="0" collectUsageData="0" logDebug="1" DlnaEnabled="0" DlnaReportTimeline="0" PubSubServer="172.105.99.32" ButlerTaskRefreshPeriodicMetadata="0" CinemaTrailersFromTheater="0" PlexOnlineHome="1" OldestPreviousVersion="legacy" CloudSyncLastUpdatedAt="1486026904" autoEmptyTrash="1" PubSubServerRegion="yyz" GenerateChapterThumbBehavior="never" ButlerTaskGenerateAutoTags="0" WanTotalMaxUploadRate="30000" TranscoderTempDirectory="" WanPerStreamMaxUploadRate="8000" TranscoderH264BackgroundPreset="slow" TranscoderQuality="0" TranscodeCountLimit="3" ManualPortMappingMode="1" ManualPortMappingPort="32400" FSEventLibraryPartialScanEnabled="0" FSEventLibraryUpdatesEnabled="0" OnDeckWindow="52" ButlerTaskRefreshEpgGuides="1" LogVerbose="0" allowMediaDeletion="1" WanPerUserStreamCount="2" ButlerTaskRefreshLocalMedia="0" ButlerTaskRefreshLibraries="0" ButlerUpdateChannel="0" HardwareAcceleratedCodecs="0" CertificateUUID="3790304365e647bca0d346ea5f47ecde" DvrIncrementalEpgLoader="0" PreferredNetworkInterface="" HardwareAcceleratedEncoders="0" LogNumFiles="100"/>
root@omv:/srv/dev-disk-by-label-data1/plexmediaserver/Library/Application Support/Plex Media Server#

I appreciate your explanation of why automatic updates are key. And I get the EAE transcoder requirements. The thing is I don’t use automatic updates.

I’ll add another reply if the problem comes back. Once again, thank you so much for your help!

BTW I’m going to open a new, unrelated thread requesting as much hand-holding as I can get in migrating my Plex data to another system. I swear I’ve done this repeatedly over the years in 2 different ways but this time around can’t make headway. My prior thread was inconclusive but openmediavault was a possibly confounding factor. This time I’m rebuilding the system from scratch with Debian 10 and no openmediavault, just to eliminate that variable. Later!

– Mark

Okay, I’m now seeing

Capture

… again in my syslog. I tried to download the Plex logs from the web client and got
500 internal server error. No problem downloading logs yesterday.

I can zip up the Plex logs manually and get them to you that way if you like. Which logs exactly do you want and where do you want them?

Thanks,
Mark

Could I have some help here please?

I have the exact same problem on my server running on WD My Passport Wireless Pro :frowning:
Hope someone figures out what the problem is

I think this is a side effect of /tmp filling up.

I’m running on Debian so I used this from what I gleaned from the discussions around this issue:

Add following to override.conf in /etc/systemd/system/plexmediaserver.service.d:

[Service]
Environment="TMPDIR=/srv/dev-disk-by-label-data1/plex_media_server_tmpdir"

Oh, and just to be ultra ultra clear, the dir after TMPDIR= is wherever you want your Plex temp dir to be. This is just an example.

Since I made this change all the errors I reported have gone away. So far.

I hope @ChuckPa will chime in one way or the other.

Just updated Plex to Version 1.19.3.2852 and it broke my fix. Rejecting systemd directive. This in syslog:

My assigned temp dir ignored:

root@omv:/srv/dev-disk-by-label-data1/plex_media_server_tmpdir# ls -l
total 0
root@omv:/srv/dev-disk-by-label-data1/plex_media_server_tmpdir#

/tmp being used for Plex again:

root@omv:/tmp# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            1.8G     0  1.8G   0% /dev
tmpfs           365M  6.1M  359M   2% /run
/dev/sda1       225G  9.1G  205G   5% /
tmpfs           1.8G  8.0K  1.8G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.8G     0  1.8G   0% /sys/fs/cgroup
tmpfs           1.8G  4.0K  1.8G   1% /tmp

root@omv:/tmp# ls -l /tmp
total 4
-rw-r--r-- 1 root root 526 May 29 12:52 plexinstaller.log
drwxr-xr-x 2 plex plex  40 May 29 12:52 pms-ad2540d6-3b3e-428b-8224-6192742572a5
root@omv:/tmp#

@ChuckPa please?

No idea what’s going on. I just checked override.conf again and it did NOT have my recent change. Perhaps it’s being overridden by something upstream?

So I once again added this to override.conf:

[Service]
Environment="TMPDIR=/srv/dev-disk-by-label-data1/plex_media_server_tmpdir"

And checked if it was being picked up after reboot:

root@omv:~# systemctl show plexmediaserver|grep Env
Environment=PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/srv/dev-disk-by-label-data1/plexmediaserver/Library/Application\x20Support PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6 PLEX_MEDIA_SERVER_TMPDIR=/tmp TMPDIR=/srv/dev-disk-by-label-data1/plex_media_server_tmpdir
EnvironmentFile=/etc/default/plexmediaserver (ignore_errors=no)
root@omv:~#

And it clearly is. Furthermore it really is using my dir and not /tmp:

root@omv:~# ls -l /tmp
total 0
root@omv:~# ls -l /srv/dev-disk-by-label-data1/plex_media_server_tmpdir
total 4
drwxrws--x+ 2 plex nogroup 4096 May 29 14:51 pms-93012f88-3670-4e4f-9abf-604d989e3ae1
root@omv:~#

Perhaps I misread the errors in syslog I reported earlier; they’re referencing /etc/default/plexmediaserver not systemd override. And yet I truly had reverted to using /tmp as I showed.

To sum up I have no idea what’s going on and need guidance as to exactly how to specify /tmp override. And what’s the purpose of /etc/default/plexmediaserver vs systemd override. OTOH it appears to be working the way I want. For now.

what does cat /proc/1/comm return?

/etc/default/plexmediaserver --> init
/etc/systemd/system/plexmediaserver.service.d/override.conf --> systemd