Jump to content
kendoman96

Emby Server requires write access

Recommended Posts

kendoman96
Posted (edited)

Alright so recently I had a crash because my OS SSD filled up. I run a 60gb SSD (which ive been meaning to upgrade) and I have always had emby store metadata and pictures and such within the media file locations. I also offload the transcoding temp location because at any given day its floating ~15-20gb of usage. I noticed the drive had 16gb of transcoding files for some reason. Reviewing my settings I tried to set my transcoding temp location and it throws the below error:

 

"Emby Server requires write access to this folder. Please ensure write access and try again."

 

System specs:

Supermicro X8DTL

2x Intel Xeon E5645

24gb DDR3 ECC Reg mem

4x 6TB seagate Iron Wolf

60gb SSD

Arch 5.6.6-arch1-1

Emby 4.4.2.0

 

I run a pretty simple drive setup, with all the drives mounted in /storage/ with their SD$ name as the mount point:

 

Emby owns the storage directory, and all of the subsequent mount points and drives.

I usually run a chmod 777 -R * and a chown emby:emby -R * I have always done this since the olden days of media browser (og user woot woot!) as I've found it prevents any issues with emby downloading metadata and subtitles etc

 
 

/
drwxrwxrwx+  11 emby emby  4096 Sep  6  2019 storage
 
/storage/
drwxrwxrwx+ 11 emby emby 4096 Sep  6  2019 .
drwxr-xr-x  20 root root 4096 Jan 25 15:53 ..
drwxrwxrwx   7 emby emby 4096 Apr 12 08:28 sda
drwxrwxrwx   4 emby emby 4096 Mar 21 13:46 sdb
drwxrwxrwx+  2 emby emby 4096 Feb 19  2019 sdc
drwxrwxrwx   6 emby emby 4096 May 23 13:57 sdd
drwxrwxrwx+  2 emby emby 4096 Feb 19  2019 sde
drwxrwxrwx   4 emby emby 4096 Jun  7  2019 sdf
drwxrwxrwx+  2 emby emby 4096 Feb 19  2019 sdg
drwxrwxrwx+  2 emby emby 4096 Feb 19  2019 sdh
drwxrwxrwx+  3 emby emby 4096 May  1  2019 sdi
 
/storage/sda/
drwxrwxrwx     7 emby emby    4096 Apr 12 08:28 .
drwxrwxrwx+   11 emby emby    4096 Sep  6  2019 ..
drwxrwxrwx  1131 emby emby  192512 May 11 07:31 Movies
drwxrwxrwx   147 emby emby   12288 Mar 15 18:42 TV
drwxrwxrwx     3 emby emby    4096 Apr 19 03:00 backups
drwxrwxrwx     2 emby emby    4096 Apr 12 08:28 metadata
drwxrwxrwx     2 emby emby 6045696 Apr 22 07:24 transcoding-temp
 

 

It appears that new metadata is not saving to media folders despite the checked options (see screenshot)

 

Also a screenshot of the error has been added. It doesnt seem to matter where I set the storage to, if it be one of the 6tb drives or even a local directory, although it will let me put the transcoding temp as the folder above the default location (/var/lib/private/emby/transcoding-temp)

 

 

Also I dont think there is an issue with the ACL for storage

getfacl storage/
# file: storage/
# owner: emby
# group: emby
user::rwx
group::rwx                      #effective:r-x
group:emby:rwx                  #effective:r-x
mask::r-x
other::r-x
default:user::rwx
default:group::rwx
default:group:emby:rwx
default:mask::rwx
default:other::rwx

I'm sure if I got drunk and gave it a good 2 or 3 hours I could figure it out but I have zero free time right now. Any help would be very appreciated!!!

+Edit 1, codeblocks seem to have failed

post-65595-0-87964200-1590527893_thumb.png

post-65595-0-36771600-1590527899_thumb.png

Edited by kendoman96

Share this post


Link to post
Share on other sites
kendoman96

Tried to fix codeblocks, seem to not be working. Apologies. 

Share this post


Link to post
Share on other sites
kendoman96

Hey Luke, I have perused the file permissions guide with no luck. I'm usually pretty good with permissions issues but I just cannot seem to get this. I mean it says all of the drives and their contents are owned by emby, and they have Read Write and Execute permissions. I'm curious as this issue only happened when I upgraded emby, perhaps a downgrade is in order.

Share this post


Link to post
Share on other sites
mastrmind11

make sure emby is still running as emby after the upgrade.  I seem to recall something popping up on here a few days ago like this.

  • Like 1

Share this post


Link to post
Share on other sites
kendoman96

I guess this is what is confusing me the most right now.

 

this folder is the default directory for transcoding-temp:

/var/lib/private/emby

 

These are the permissions for that folder:

getfacl transcoding-temp/
# file: transcoding-temp/
# owner: emby
# group: emby
user::rwx
group::r-x
other::r-x
=================
ls -la
total 344
drwxr-xr-x 15 emby emby   4096 May 26 17:10  .
drwx------  4 root root   4096 Apr 22 07:46  ..
drwxr-xr-x  3 emby emby   4096 Jul 28  2018  .dotnet
drwxr-xr-x 16 emby emby   4096 May 29 04:12  cache
drwxr-xr-x  4 emby emby   4096 Nov 11  2019  config
drwxr-xr-x  8 emby emby   4096 Jun  1 09:50  data
drwxr-xr-x  2 emby emby   4096 Jun 28  2018  fonts
drwxr-xr-x  2 emby emby   4096 Dec  4  2017  localization
drwxr-xr-x  2 emby emby 159744 Jun  1 09:31  logs
drwxr-xr-x  9 emby emby   4096 May  3  2019  metadata
drwxr-xr-x  3 emby emby   4096 May 11 08:04  plugins
drwxr-xr-x  2 emby emby   4096 Dec  6 00:00 'plugins\\Statistics'
drwxr-xr-x  3 emby emby   4096 Dec  4  2017  root
drwxr-xr-x  3 emby emby   4096 Mar 16 14:52  sync
drwxr-xr-x  2 emby emby 131072 Jun  1 09:48  transcoding-temp

I have cloned these permissions to this directory:
/storage
 
getfacl /storage
getfacl: Removing leading '/' from absolute path names
# file: storage
# owner: emby
# group: emby
user::rwx
group::r-x
other::r-x
 
ls -la /
total 80
drwxr-xr-x   20 root root  4096 Jun  1 08:49 .
drwxr-xr-x   20 root root  4096 Jun  1 08:49 ..
lrwxrwxrwx    1 root root     7 May 19 18:42 bin -> usr/bin
drwxr-xr-x    3 root root  4096 Jun  1 08:54 boot
drwxr-xr-x    3 root root  4096 Jun  1  2018 boot.bak
drwxr-xr-x   20 root root  3440 May 26 16:58 dev
drwxr-xr-x   55 root root  4096 Jun  1 09:25 etc
drwxr-xr-x+   3 root root  4096 Dec  4  2017 home
lrwxrwxrwx    1 root root     7 May 19 18:42 lib -> usr/lib
lrwxrwxrwx    1 root root     7 May 19 18:42 lib64 -> usr/lib
drwx------    2 root root 16384 Dec  4  2017 lost+found
drwxr-xr-x    3 root root  4096 Jun 24  2019 luna_ssl
drwxr-xr-x    2 root root  4096 Mar 26  2017 mnt
drwxr-xr-x    2 root root  4096 Jan 24 08:02 opt
-rwxr-xr-x    1 root root    77 Apr  3  2019 permissions.sh
dr-xr-xr-x  381 root root     0 May 26 16:09 proc
drwxr-x---    5 root root  4096 May 26 17:21 root
drwxr-xr-x   21 root root   620 Jun  1 08:53 run
lrwxrwxrwx    1 root root     7 May 19 18:42 sbin -> usr/bin
-rwxr-xr-x    1 root root   383 Jan 25 19:36 speedtest.sh
drwxr-xr-x    4 root root  4096 Dec  4  2017 srv
drwxr-xr-x    6 emby emby  4096 Jun  1 09:39 storage
dr-xr-xr-x   13 root root     0 May 26 16:09 sys
drwxrwxrwt   13 root root   260 Jun  1 09:31 tmp
drwxr-xr-x    9 root root  4096 Jun  1 09:25 usr
drwxr-xr-x   13 root root  4096 Jun  1 08:53 var

 

 

As far as I can tell, they are identical (and also on the same disk), so what gives?? I was thinking it might have something to do with the ACL, so i just removed it and made it identical to that of the previous directory which works.
 

My only thoughts here might be an issue with dotnet permissions? Is that a thing?

 

systemctl status emby-server
* emby-server.service - Emby brings together your videos, music, photos, and live television.
     Loaded: loaded (/usr/lib/systemd/system/emby-server.service; enabled; vendor preset: disabled)
     Active: active (running) since Mon 2020-06-01 09:31:40 EDT; 36min ago
   Main PID: 799470 (dotnet)
      Tasks: 24 (limit: 28888)
     Memory: 267.1M
     CGroup: /system.slice/emby-server.service
             `-799470 dotnet /usr/lib/emby-server/EmbyServer.dll -programdata /var/lib/emby -ffdetect /usr/bin/ffdetect-emby -ffmpeg /usr/bin/ffmpeg-emby -ffprobe /usr/bin/ffprobe-emby -restartexitcode 3
 
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Entry point completed: Emby.Notifications.Notifications. Duration: 0.0003969 seconds
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Starting entry point Emby.Server.Sync.SyncManagerEntryPoint
Jun 01 09:31:45 Luna emby-server[799470]: Info App: SyncRepository Initialize taking write lock
Jun 01 09:31:45 Luna emby-server[799470]: Info App: SyncRepository Initialize write lock taken
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Entry point completed: Emby.Server.Sync.SyncManagerEntryPoint. Duration: 0.0062672 seconds
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Starting entry point Emby.Server.Sync.SyncNotificationEntryPoint
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Entry point completed: Emby.Server.Sync.SyncNotificationEntryPoint. Duration: 0.0029324 seconds
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Starting entry point EmbyServer.Windows.LoopUtilEntryPoint
Jun 01 09:31:45 Luna emby-server[799470]: Info App: Entry point completed: EmbyServer.Windows.LoopUtilEntryPoint. Duration: 0.0003938 seconds
Jun 01 09:31:45 Luna emby-server[799470]: Info App: All entry points have started
 
These are the settings for emby in /etc/group:

emby:x:422:jon
 
Apologies again codeblocks seem to be non-working. Or perhaps its an ID10T issue.

Share this post


Link to post
Share on other sites
kendoman96

make sure emby is still running as emby after the upgrade.  I seem to recall something popping up on here a few days ago like this.

It appears it is running as emby:

 

ps -aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
emby      799470  1.2  1.2 5685112 305584 ?      Ssl  09:31   0:30 dotnet /usr/lib/emby-server/EmbyServer.dll -programdata /var/lib/emby -ffdetect /usr/bin/ffdetect-emby -ffmpeg /usr/bin/ffmpeg-emby -ffprobe /usr/bin/ffprobe-emby -restar

Share this post


Link to post
Share on other sites
kendoman96

I see "Version 4.4.3.0 is now available for download." on my dashboard so I am hoping when it is finally pushed to arch this might be fixed. Currently waiting as emby-server-4.4.2.0-1 is the only one available.

Will report back when released.

Share this post


Link to post
Share on other sites
Q-Droid
Posted (edited)

Arch Linux? Someone posted about systemd and dynamic user as default causing access problems. Can't provide link, posting from phone.

 

Link: https://wiki.archlinux.org/index.php/Emby

Edited by Q-Droid
  • Like 1

Share this post


Link to post
Share on other sites
kendoman96

Arch Linux? Someone posted about systemd and dynamic user as default causing access problems. Can't provide link, posting from phone.

 

Link: https://wiki.archlinux.org/index.php/Emby

Yo nice find!

 

Unconfirmed if this is working yet but looking in /etc/systemd/system/multi-user.target.wants I saw emby-server.service 

 

Checking the default configuration:

 

[unit]
Description=Emby brings together your videos, music, photos, and live television.
After=network.target
 
[service]
User=emby
Group=emby
SupplementaryGroups=render
SupplementaryGroups=video
DynamicUser=true
StateDirectory=emby
ReadWritePaths=/dev/dri
 
EnvironmentFile=/etc/conf.d/emby-server
ExecStart=/usr/bin/emby-server
RestartForceExitStatus=3
 
AmbientCapabilities=
CapabilityBoundingSet=
LockPersonality=true
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=true
 
[install]
WantedBy=multi-user.target
 
Commenting out ReadWritePaths=/dev/dri did not work as suggested in thread "https://emby.media/community/index.php?/topic/85900-emby-server-service-wont-start-automatically-anymore/" although I didnt expect it to. 

Adding:

 

[service]

SupplementaryGroups=share

ReadWritePaths=/mnt/share

 

did not work as suggested in the very short wiki entry "https://wiki.archlinux.org/index.php/Emby" (speaking of which the default path is not correct, or maybe my system is just funky)

 

However changing ReadWritePaths=/dev/dri to ReadWritePaths=/storage/ now lets me choose a transcoding temp path with no error.

 

 

Over the next few days I will be testing the write capabilities and if I am correctly saving media to media folders and whatnot. I am hesitant to say that this is solved however the optimist in me wishes it so.

 

 

Thank you all for the feedback. Will report back after monitoring. 

Share this post


Link to post
Share on other sites
negativzeroe

Side note. Do you run any other services on your arch server? I've been running arch on my laptop for some time and have been thinking about converting my Debian server over. I also run Nextcloud as well as several other services. How do you keep up with updates?

 

Sent from my ONEPLUS A5000 using Tapatalk

  • Like 1

Share this post


Link to post
Share on other sites
kendoman96

Side note. Do you run any other services on your arch server? I've been running arch on my laptop for some time and have been thinking about converting my Debian server over. I also run Nextcloud as well as several other services. How do you keep up with updates?

 

Sent from my ONEPLUS A5000 using Tapatalk

 

I usually like to split services between different servers, however the services currently running on this server:

 

nrpe

sshd

snmpd

httpd

couchpotato

emby-server

minecraft server (because why not)

 

As far as keeping up with updates its pretty easy. I mean I look for conflicts on upgrades, I try to keep upgrades limited to a handfull of packages per run. If anything breaks I just downgrade the problematic package and add it to the IgnorePkg list. I'm usually pretty good at diagnosing these things but I couldnt find anything in the logs indicating an issue with the systemd configuration.

 

 

As a standard all my servers run SSH, NRPE, and SNMP as I have an on-site monitoring server with SMS notification system and a bunch of plugins. I also have an off-site monitoring server as a backup.

  • Like 1

Share this post


Link to post
Share on other sites
Q-Droid

Normally you don't want to remove the access to /dev/dri as that's the location of the render device used for HW transcoding...if you have a GPU. The ReadWritePaths= and other xxxPaths= options accept a space separated list of values for the paths you want to allow. Another option is you could disable DynamicUser for the emby-server service and it should behave as a normal static user.

  • Like 1

Share this post


Link to post
Share on other sites
kendoman96

Normally you don't want to remove the access to /dev/dri as that's the location of the render device used for HW transcoding...if you have a GPU. The ReadWritePaths= and other xxxPaths= options accept a space separated list of values for the paths you want to allow. Another option is you could disable DynamicUser for the emby-server service and it should behave as a normal static user.

 

I added /dev/dri back, however this is a headless server with no proper GPU. It has dual 6 core hyperthreaded xeons so it never really has issues transcoding, but good to know you can just space separate them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...