Jump to content

Emby Media Converter copying file


Thakhisis

Recommended Posts

Thakhisis

Trying to get the conversion in place (replace existing files) to work. Been checking and double checking permissions with different setups and nothing works. UNTIL emby gets to be owner of the _files_ themselves, then the writing can happen. I would expect it to work as 'emby' being part of a group with the required permissions, however this doesn't work. Did a few tests with _everything_ having 777 permissions as well, no dice. Ownership did the trick, however I don't want to have to make sure my files are owned by emby when there are multiple different users accessing and editing the files.

Observations:

- Looking at the file sizes while the transferring is going on, the file size increases. It is only once the transfer is done that the transfer fails.
- Did a test where I deleted the existing file beforehand and emby was able to transfer no issues
- Did a test with 777 on everything, including the target file (failed) then the same exact test with only one key difference `chmod emby:sc-download <filename> ` and that worked.
- Emby is installed locally on the NAS (DS918+), no remote mounting is going on.
 

2021-04-22 15:57:53.066 Debug App: Sending /volume1/media/__transcoding/31/2775/c64ef725-6e58-4d2f-905c-69d3c4296067.mkv to Emby Media Converter. Remote path: TV/Bosch/Season 2/Victim of the Night/Bosch - S02E03 - Victim of the Night WEBDL-1080p.mkv

2021-04-22 15:58:41.657 Error App: Error transferring sync job file
	*** Error Report ***
	Version: 4.5.4.0
	Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /volume1/Emby -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -updatepackage emby-server-synology_{version}_x86_64.spk
	Operating system: Linux version 4.4.59+ (root@build3) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP PREEMPT Thu Mar 18 13:00:35 CST 2021
	Framework: .NET Core 3.1.8
	OS/Process: x64/x64
	Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /volume1/Emby
	Application path: /volume1/@appstore/EmbyServer/system
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path 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.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
	   at Emby.Server.Sync.ConvertSyncProvider.SendFile(SyncJob job, String originalMediaPath, String inputPath, Boolean isMedia, String[] pathParts, SyncTarget target, IProgress`1 progress, CancellationToken cancellationToken)
	   at Emby.Server.Sync.MediaSync.SendFile(SyncJob job, String originalMediaPath, IServerSyncProvider provider, String inputPath, Boolean isMedia, String[] pathParts, SyncTarget target, SyncOptions options, IProgress`1 progress, CancellationToken cancellationToken)
	   at Emby.Server.Sync.MediaSync.GetItem(IServerSyncProvider provider, SyncTarget target, SyncJobItem jobItem, IProgress`1 progress, CancellationToken cancellationToken)
	Source: System.IO.FileSystem
	TargetSite: Void ThrowExceptionForIoErrno(ErrorInfo, System.String, Boolean, System.Func`2[Interop+ErrorInfo,Interop+ErrorInfo])
	InnerException: System.IO.IOException: Operation not permitted
	Source: 
	TargetSite: 
	

 

Sincerely

Thak

Edited by Thakhisis
Added info regarding OS
Link to comment
Share on other sites

flowcool

Hello,

 

same here using beta 4.6.0.41:

 

Quote

2021-04-29 12:09:23.268 Error App: Error transferring sync job file
    *** Error Report ***
    Version: 4.6.0.41
    Command line: /volume1/@appstore/EmbyServer/system/EmbyServer.dll -programdata /volume1/Emby -ffdetect /var/packages/EmbyServer/target/bin/ffdetect -ffmpeg /var/packages/EmbyServer/target/bin/ffmpeg -ffprobe /var/packages/EmbyServer/target/bin/ffprobe -nolocalportconfig -ignore_vaapi_enabled_flag -updatepackage emby-server-synology_{version}_x86_64.spk
    Operating system: Linux version 4.4.59+ (root@build3) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP PREEMPT Thu Mar 18 13:00:35 CST 2021
    Framework: .NET Core 3.1.13
    OS/Process: x64/x64
    Runtime: volume1/@appstore/EmbyServer/system/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /volume1/Emby
    Application path: /volume1/@appstore/EmbyServer/system
    System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path is denied.
     ---> System.IO.IOException: Operation not permitted
       --- End of inner exception stack trace ---
       at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
       at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
       at Emby.Server.Implementations.IO.ManagedFileSystem.CopyFile(String source, String target, Boolean overwrite)
       at Emby.Server.Sync.ConvertSyncProvider.SendFile(SyncJob job, String originalMediaPath, String inputPath, Boolean isMedia, String[] pathParts, SyncTarget target, IProgress`1 progress, CancellationToken cancellationToken)
       at Emby.Server.Sync.MediaSync.SendFile(SyncJob job, String originalMediaPath, IServerSyncProvider provider, String inputPath, Boolean isMedia, String[] pathParts, SyncTarget target, SyncOptions options, IProgress`1 progress, CancellationToken cancellationToken)
       at Emby.Server.Sync.MediaSync.GetItem(IServerSyncProvider provider, SyncTarget target, SyncJobItem jobItem, IProgress`1 progress, CancellationToken cancellationToken)
    Source: System.IO.FileSystem
    TargetSite: Void CopyFile(System.String, System.String, Boolean)
    InnerException: System.IO.IOException: Operation not permitted
    Source: 
    TargetSite: 

 

Link to comment
Share on other sites

Thakhisis

Hi,

Sorry, but is there a reason there has been no response to this? Is this a known issue, are we doing something wrong or is there some other explanation?
I really would like to have this problem solved, any help is appreciated.

Sincerely

Thak

Link to comment
Share on other sites

  • 2 weeks later...

@Thakhisis @flowcool apologies for the delay.

When this happens, does the target directory already exist before-hand?

Quote

TV/Bosch/Season 2/Victim of the Night/

 

Link to comment
Share on other sites

flowcool
On 5/25/2021 at 11:46 PM, Luke said:

@Thakhisis @flowcool apologies for the delay.

When this happens, does the target directory already exist before-hand?

 

Hello Luke,

 

For me it's in-place conversion so it exists yes. I had to cancel all conversion actually as it was perceptually trying to copy 😕

Link to comment
Share on other sites

When setting up the conversion job, did you select the option to save them next to the original files, or to replace the original files?

Link to comment
Share on other sites

flowcool
1 hour ago, Luke said:

When setting up the conversion job, did you select the option to save them next to the original files, or to replace the original files?

Hello Luke, for me it's : Replacing !

My goal is reducing size taken on my NAS...but at some point I noticed it was working forever..Weird stuff is that... (pict attached) like everyone have access... 

 

2021-06-04_20h54_52.png

Link to comment
Share on other sites

Thakhisis

Hi @Luke,

It is the same use case for me. I want to convert media in place as to not take up too much space on the NAS. The file and directory already exists and its failing when it is trying to overwrite the original file. It only works when emby has ownership.

Link to comment
Share on other sites

  • 2 weeks later...

What permissions do you currently have set for the folder the media is in?

Link to comment
Share on other sites

Thakhisis

As mentioned in my original description, everything is set to `777`. The files and the directory in which they reside. 

Link to comment
Share on other sites

Is Emby running under Docker?  I ask because the docker users have different "w" access.

Link to comment
Share on other sites

Thakhisis

Hi @cayers

I don't believe so. I've installed it via the Synology package center, although via a manual package upload as newer versions didn't show up in the normal feed.

I'm currently running 4.5.4.0-6.

Link to comment
Share on other sites

flowcool

@Cayars

On my end, it's the package provided by emby; no docker for this application.

I'm on 4.6.2.0 too as I'm updating each time, as simple as that. And I had the issue with previous version too actually.

Emby user is part of group "users" & "video", these groups have read/write access to my folders.

Permissions are recursively the same for each files & folders:

drwxrwxr-x   8  admin      users

Best regards,

Edited by flowcool
typo
Link to comment
Share on other sites

If you change this to 

drwxrwxrwx

Or change ownership to your Emby user, I bet it will work.

  • Confused 1
Link to comment
Share on other sites

flowcool

okkkk... I was kind until now but a limit has been crossed and that's not acceptable.

 

Let me give a bit of background, I'm working in IT; the advice you gave is actually the worst ever. Maybe I should also stop my firewall and let anyone comes and remove password too ?! That's a lack of professionalism and knowledge; and I have an Emby Premiere account.

Thakhisis already mentioned is at 777 and it's not working.... So what is this answer ?

So, long story short: we are able to read and even deleted files through the application = aka rights are properly setup, otherwise, I would already have issue here of rights here.

 

So can we have real guidance and recommendations in this topic ?

 

Otherwise I might apply your recommendations and send you the bill when my drive will die after perpetual tries of writes ?

Edited by flowcool
corrections
Link to comment
Share on other sites

That was for a test.  If that works it would show a permission issue likely in the setup of the groups. But we already know you have a permission issue because Emby can't overwrite the file.

Keep in mind the conversion/transcoding isn't done inside Emby but is done via our modified version of ffmpeg.

Edited by cayars
Link to comment
Share on other sites

trevormoss

I'm experiencing the same issue. Emby running on Synology not able to transfer files when overwriting files. I get the same error. To add what I've found is that if the extension (AKA the filename) changes in the conversion process, it works. It seems like it's specifically an issue with overwriting existing files.

Link to comment
Share on other sites

flowcool
On 6/18/2021 at 9:43 PM, cayars said:

That was for a test.  If that works it would show a permission issue likely in the setup of the groups. But we already know you have a permission issue because Emby can overwrite the file.

Keep in mind the conversion/transcoding isn't done inside Emby but is done via our modified version of ffmpeg.

Under which user is it running then ? Maybe we can add it the the proper user group ?

Link to comment
Share on other sites

I'm going to set this up to test on my Synology NAS.  I'm currently running DSM 7 RC.

What version of DSM are you guys running?  Any of you running 7?

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...