Cannot optimize video, error deleting over samba

Server Version#: 1.16.0.1226

I have plex media server installed on an ubuntu 18.04 virtual machine, with files hosted on a seperate virtual machine shared via samba (I have windows machines in the house, hence smb instead of dealing with nfs and samba issues).

I have gotten the server to play video on a variety of devices well for the most part (there is occasional buffering which should happen on a local network, not sure if related). My issue arises when I try to optimize files, I get various errors like below

LevelError

Thread0x7f64217fa700

MessageCouldn’t delete the file “/media/plex/TV Shows/Ghost in the Shell/Ghost in the Shell - Stand Alone Complex (2002)/Plex Versions/Original Quality/Ghost in the Shell_ Stand Alone Complex/.inProgress/S01E03.mp4.93”: Operation not permitted

CLEAR FILTERS AND JUMP TO CONTEXT

I’ve tried chmod 777’ing, from both the nas and plexbuntu machine. I’ve tried chown-ing to “plex” and I still get the same issues.

my fstab is

//192.168.0.185/plex /media/plex cifs credentials=/home/switch/.smbcredentials,noperm,iocharset=utf8,sec=ntlmssp,file_mode=770,dir_mode=770,rw 0 0

The systemctl for plexmediaserver.service is

● plexmediaserver.service - Plex Media Server                                                                                                                                                                 Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)                                                                                                              Active: active (running) since Mon 2019-06-17 00:18:11 UTC; 1h 58min ago                                                                                                                                  Process: 2946 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)     Main PID: 2948 (sh)                                                                                                                                                                                           Tasks: 308 (limit: 4915)                                                                                                                                                                                  CGroup: /system.slice/plexmediaserver.service                                                                                                                                                                      ├─2948 /bin/sh -c  PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )"  PLEX_MEDIA_SERVER_INFO_DEVICE="PC"  PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"  PLEX_MEDIA_SERVER_INFO_PLATFORM_V           ├─2973 /usr/lib/plexmediaserver/Plex Media Server                                                                                                                  ├─3010 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediaserver/Resour           ├─3072 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.16.0.1226-7eb2c8f6f 32600 /waitmutex                                                                                                                                                                                    ├─3100 Plex Plug-in [com.plexapp.agents.themoviedb] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediase           
├─3384 Plex Plug-in [com.plexapp.agents.thetvdb] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediaserve           
├─5202 /usr/lib/plexmediaserver/Plex Transcoder -codec:1 h264 -codec:0 ac3 -ss 80 -analyzeduration 20000000 -probesize 20000000 -i /media/plex/Movies/Logan (2017)/Logan.2017.1080p.HC.HDRip.X264.AC3-EVO[EtHD].mkv -filter_complex [0:1           
├─5667 Plex Plug-in [com.plexapp.agents.localmedia] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediase           
├─5674 Plex Plug-in [com.plexapp.agents.plexmusic] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediaser           
├─5785 Plex Plug-in [com.plexapp.agents.lastfm] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmediaserver           
├─5815 Plex Plug-in [com.plexapp.agents.htbackdrops] /usr/lib/plexmediaserver/Resources/Plug-ins-7eb2c8f6f/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.16.0.1226-7eb2c8f6f /usr/lib/plexmedias           
└─6118 /usr/lib/plexmediaserver/Plex Transcoder -codec:0 hevc -analyzeduration 20000000 -probesize 20000000 -i /media/plex/TV Shows/Ghost in the Shell/Ghost in the Shell - Stand Alone Complex (2002)/03 - Android and I.mkv -map_inlin                                                                                      
Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series Special 3 Ultimate Series                                                                                                                      Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series Pilot 1 Jet Assisted Chevy                                                                                                                     Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series Pilot 2 Airplane Toilet, Biscuit Bazooka, Leaping Lawyer                                                                                       
Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series Pilot 3 Lawn Chair Balloon, Poppy Seed Drug Test, Goldfinger                            
Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series 1                                                                                                                                              Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series 2                                                                                                                                              Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Series 3                                                                                                                                              Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Code Monkeys Extras Recording With Adam De La Pena                                                                                                    
Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Code Monkeys Gameavision Trailers Bar Fight                                                                                                           
Jun 17 01:19:54 plexbuntu sh[2948]: Got nothing for: Code Monkeys Gameavision Trailers Cross Walk 

Not sure what all that garbage is, probably something to do with mythbusters.

I also saw some troubleshooting on this that didn’t resolve my issue asking for ls -ahl, so that is below aswell

total 4.0K                                                                                                                                                                                                 dr------wT 2 root root    0 May 30 02:38  .  
drwxr-xr-x 3 root root 4.0K May 29 15:31  ..                                                                                                                                                               dr------wT 2 root root    0 Jun  9 21:19  Movies 
dr------wT 2 root root    0 Jan 16 04:00  Music
dr------wT 2 root root    0 May 29 18:28 'Plex Media Server' 
dr------wT 2 root root    0 May  8 01:10 'TV Shows'               

If anyone could give me some pointers I’d really really appreciate it. My old setup was a windows desktop running the server, with files hosted via samba on a linux box which worked pretty well (except when transcoding while playing video games :-/ )

MODERATOR EDIT Used triple-grave (tilde) formatting ( ``` ) as leading and trailing lines instead of “code” directives which do not work here.

A few pointers:

  1. Root doesn’t work over Samba on most systems due to root-squash. You need a real user.
  2. On linux, /var/lib/plexmediaserver/Library/Application Support/Plex Media Server is where your metadata should be.
  3. I don’t know where you placed Music and TV Shows but it’s suspicious.
  4. root only permissions on Plex Media Server ?? This isn’t how Plex should be run (safely). It runs as its own username (plex:plex) and as a “service”
  5. You create media directories (anywhere you want except under /media (due to File manager collisions which you are seeing now).
  6. You assign normal user level permissions to those shares.
  7. As your username, not root, you read and write them over SMB.
  8. Plex, by the nature of default Linux permissions, gets read-only which is all it needs.

Thanks for getting back to me! Looks like the main issue was fixed through a combo of switching to /mnt/plex and fstab was something like 770 not 0770 (actually now 0777 because I wanted it to work, going to try dialing back privileges to 0666 or something when I can see straight in the morning).

The other things you pointed out are concerning to me, as I tried to keep things as basic as possible
1 / 4 / 7 I have no idea why anything is running as root instead of plex - I installed using sudo dpkg -i but didn’t mess with it after. I would very much like to fix that

2 That metadata folder is a backup from a previous install on windows which I ended up not using, I installed from scratch. That may have been a mistake given the media folders had a few plex versions of files that don’t seem to have been caught yet

The current mount is:

switch@plexbuntu:~$ ls -ahl /mnt/plex/
total 4.0K
drw-rw-rw- 2 root root    0 Jun 18 02:43  .
drwxr-xr-x 3 root root 4.0K Jun 18 02:37  ..
drw-rw-rw- 2 root root    0 Jun  9 21:19  Movies
drw-rw-rw- 2 root root    0 Jan 16 04:00  Music
drw-rw-rw- 2 root root    0 May  8 01:10 'TV Shows'

Aside from fixing fstab, where should I go to get everything to stop running as root to secure things as that is more than a little concerning to me

I see the issue. Thanks for the listing.

Directories need ‘X’ permission (execute) to traverse them

Directories are 755, files are 644

sudo find /mnt/plex -type d -exec chmod 755 {} \;
sudo find /mnt/plex -type f -exec chmod 644 {} \;

644 allows the directory to be read but doesn’t allow traversing into subdirectories.
755 allows the directory to be read and traversed into the subdirectories

a little strange until you think about it.

Ok, so turns out the “fixed” wasn’t fixed. The error giving is

Error creating directory "/mnt/plex/Movies/The Greatest Showman (2017)/Plex Versions/Original Quality": boost::filesystem::create_directories: Permission denied: "/mnt/plex/Movies/The Greatest Showman (2017)/Plex Versions"

I ran that command, both on the nas itself and on the plex machine for kicks (after it turned out not to be working)
NAS box:

neo@fileserve:~$ ls -ahl /mnt/data/data/Plex/
total 76K
drwxr-xr-x    5 plex plex 4.0K Jun 21 04:11  .
drwxrwxrwx    8 neo  neo  4.0K Jun 18 02:43  ..
drwxr-xr-x  145 neo  neo   20K Jun  9 21:19  Movies
drwxr-xr-x 1041 neo  neo   44K Jan 16 04:00  Music
drwxr-xr-x   94 neo  neo  4.0K May  8 01:10 'TV Shows'

and plex box reads

switch@plexbuntu:~$ ls -ahl /mnt/plex/
total 4.0K
drwxr-xr-x 2 root root    0 Jun 21 04:11  .
drwxr-xr-x 3 root root 4.0K Jun 18 02:37  ..
drwxr-xr-x 2 root root    0 Jun  9 21:19  Movies
drwxr-xr-x 2 root root    0 Jan 16 04:00  Music
drwxr-xr-x 2 root root    0 May  8 01:10 'TV Shows'

What’s most confusing to me is that on the plex box I can create and delete directories as a regular user. That and root ownership

There is a user of plex

plex:x:111:115::/var/lib/plexmediaserver:/bin/bash

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.