Jump to content

Metadata is not getting updated


AndaPlays
Go to solution Solved by alucryd,

Recommended Posts

AndaPlays

Hey,

 

I have a Emby on Ubuntu 16.04 as a VM on FreeNAS.

 

I mounted my Media Share as a  Samba Share to /etc/fstab.

The machine has root rights. 

 

I did choose the option to let the metadata saved to my media share.

But somehow I get many errors in the logs and It even tells me that emby does not have the permisson for some files.

I also manually started the server as root.  

 

Didn't helped. Hmm. 

Log.txt

log2.txt

Link to comment
Share on other sites

It looks like the server does not have write access to these locations:

Access to the path '/media/Animes/One Piece/315.Die.neue.Welt.HD.720P.x264.by.M3lloW.nfo' is denied. ---> System.IO.IOException: Permission denied

If you can sort that out then it should work just fine. Let us know if this helps. Thanks !

Link to comment
Share on other sites

AndaPlays

It looks like the server does not have write access to these locations:

Access to the path '/media/Animes/One Piece/315.Die.neue.Welt.HD.720P.x264.by.M3lloW.nfo' is denied. ---> System.IO.IOException: Permission denied

If you can sort that out then it should work just fine. Let us know if this helps. Thanks !

 

@@Luke if he's running as root (although shouldn't be), there's no way he doesn't have permission to read those files.

 

If you look at his logs they are all nfo files - this looks like the same issue that's afflicting me in this thread https://emby.media/community/index.php?/topic/52544-permission-denied-errors-on-centos/ .

 
Yeah can't fix it. As I said emby has root rights.
One interesting thing is also I deleted some of those .nfo files and he still tries to access them but they just don't exist.
 
Deleted Emby from the entire system and got the latest beta. Still same issue. 
Link to comment
Share on other sites

alucryd

Could you please share your fstab mount line? Also how did you start emby as root?

Edited by alucryd
Link to comment
Share on other sites

AndaPlays

Could you please share your fstab mount line? Also how did you start emby as root?

 

Yeah that my line:
//NAS/Media /media cifs username=root,password=password 0 0
 
It would'nt show up If it didn't work, u can only access this share via root + password. 
 
 
Well Emby should start as root on boot. I thought this my be that problem so I manually started it as root with:
sudo systemctl start emby-server
 
But yeah, didn't helped.
Edited by TechnoFREAKzoggt
Link to comment
Share on other sites

  • Solution
alucryd

That's what I thought, you're not starting emby as root, you're starting it as emby like it should be done. Please add uid=emby,gid=emby to your share mount options in fstab and remount the share.

Edited by alucryd
  • Like 1
Link to comment
Share on other sites

AndaPlays

That's what I thought, you're not starting emby as root, you're starting it as emby like it should be done. Please add uid=emby,gid=emby to your share mount options in fstab and remount the share.

 

Thanks, this fixed it. 

Link to comment
Share on other sites

dcrdev

@@dcrdev does this help?

 

Afraid not @@Luke -

 

This was obviously a real permission issue for the user, in my case it's not that simple. I'm not mounting anything over cifs - infact I don't even have a populated fstab, everything is managed through zfs.

 

Emby can definitely write to the file, even if I modify it within Emby's own web interface - that change gets written to the file. But for some reason it complains about not having access in the logs and this seems to slow library scan down dramatically. 

 

To put this into context - I can delete the nfo file on disk, re scan the library and Emby will create a new nfo file but still complain about permissions. Also worth noting that nothing in my setup has changed other than switching to the .NET core package.

 

This isn't intended as a dig at you guys at all, you've done a great job - but unfortunately I'm reaching the point now where I think I very well may have to look at other solutions. Within the past few weeks I've just had so much go wrong - database corruption, permission issues and now I'm having extreme music playback delays in the iOS app.

Edited by dcrdev
Link to comment
Share on other sites

dcrdev

Gave it one more go - put some TV Shows in /temp and gave it rwx permissions and set the primary owner and group to emby; this was just as a test. Still seeing the same results - I just wanted to prove the point that it's really not how I'm setting up permissions, it's something else.

2017-11-14 08:07:16.342 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 3.2.36.0
	Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -updatepackage emby-server-rpm_{version}_x86_64.deb
	Operating system: Unix 3.10.0.693
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: True
	Processor count: 8
	Program data path: /var/lib/emby
	Application directory: /opt/emby-server/system
	System.UnauthorizedAccessException: Access to the path '/temp/Rick and Morty/Series 03/Rick and Morty - S03E04 - Vindicators 3 The Return of Worldender.nfo' is denied. ---> System.IO.IOException: Operation not permitted
	   --- End of inner exception stack trace ---
	   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
	   at Interop.CheckIo(Int64 result, String path, Boolean isDirectory, Func`2 errorRewriter)
	   at System.IO.FileSystemInfo.set_IsReadOnlyAssumesInitialized(Boolean value)
	   at System.IO.FileSystemInfo.System.IO.IFileSystemObject.set_Attributes(FileAttributes value)
	   at System.IO.UnixFileSystem.SetAttributes(String fullPath, FileAttributes attributes)
	   at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
	   at MediaBrowser.XbmcMetadata.Savers.BaseNfoSaver.Save(IHasMetadata item, CancellationToken cancellationToken)
	   at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadata(IHasMetadata item, ItemUpdateType updateType, IEnumerable`1 savers)
	System.UnauthorizedAccessException
	   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
	   at Interop.CheckIo(Int64 result, String path, Boolean isDirectory, Func`2 errorRewriter)
	   at System.IO.FileSystemInfo.set_IsReadOnlyAssumesInitialized(Boolean value)
	   at System.IO.FileSystemInfo.System.IO.IFileSystemObject.set_Attributes(FileAttributes value)
	   at System.IO.UnixFileSystem.SetAttributes(String fullPath, FileAttributes attributes)
	   at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
	   at MediaBrowser.XbmcMetadata.Savers.BaseNfoSaver.Save(IHasMetadata item, CancellationToken cancellationToken)
	   at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadata(IHasMetadata item, ItemUpdateType updateType, IEnumerable`1 savers)
	InnerException: System.IO.IOException
	System.IO.IOException: Operation not permitted

The file is actually getting written to the file though - I can delete it, emby will recreate it and still complain. So looking at that snippet above again - to me (no expert) it looks like it's trying to set a filesystem attribute. Maybe that attribute isn't supported by zfs, or needs to be enabled separately; if only I knew specifically what it was trying to do.

Link to comment
Share on other sites

If the file has a readonly or hidden attribute applied then we first remove try to remove that attribute because saving over the file will fail otherwise.

Link to comment
Share on other sites

Then, after the file has successfully saved, we mark it hidden if it was marked hidden before, or if you've configured saving metadata files as hidden.

 

However, looking at things, if that attribute operation fails the core server will think the entire save has failed which isn't true, so we can catch that failure and not allow that to happen.

Link to comment
Share on other sites

dcrdev

Hmm interesting - so those are win attributes, right? Does .net core handle the translation i.e. hidden attribute = '.' before the filename, readonly = differen't permission level?

 

Yeah if you could add in a catchall that would be brilliant, because as far as I can see it's not failing anything and like I said it seems to be clogging library scans and creating vastly inflated log files as a result.

 

Also I'd like to point out that this afternoon, I set up and configured auditd (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/security_guide/chap-system_auditing) to monitor file access at the kernel level. When these permission denied errors occur there's literally nothing recorded - whereas if I try and access a file my user account doesn't have permission on - it gets logged fine.

Link to comment
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...