Jump to content

Backup plugin failing: network credentials?


sanewton72
Go to solution Solved by esseki,

Recommended Posts

sanewton72

hi,

 

my backup plugin keeps failing, with the error messages essentially saying authentication error trying to create the new directory.

normally pretty straight forward issue to resolve, i know, but...

 

background info

my ShieldTV Pro accesses an SMB share on a NAS, which has content subfolders (movies, TV shows, photos, yada yada), as well as a Backup directory.

this share is accessed using dedicated credentials without any issue by several apps on my ShieldTV, including Emby Server.

i installed the latest backup plugin (1.3.4.0), i browse/choose the backup directory, decide what i want to backup. no problem.

however the backup plugin fails every time it runs by schedule or when clicked.

***snip***

Access to the path "/storage/NAS/share/MediaCentre Backup/Emby/Emby Backup - 2019-01-28 12.10.0 - Auto" is denied.
at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x0004b] in <fe08c003e91342eb83df1ca48302ddbb>:0 
at System.IO.Directory.CreateDirectory (System.String path) [0x00075] in <fe08c003e91342eb83df1ca48302ddbb>:0 
at Emby.Server.Implementations.IO.ManagedFileSystem.CreateDirectory (System.String path) [0x0001b] in <8c99ead7fd9c44cab05a9d44c2163ecc>:0 
at MBBackup.ServerEntryPoint+<ExecuteBackup>d__61.MoveNext () [0x00199] in <b48c1b9ae14d440baa732016b620ddb8>:0 
--- End of stack trace from previous location where exception was thrown ---

***snip***

 

i have:

- rebooted the NAS (its a Synology DS412+)

- explicitly reset share, folder and file permissions

- logged into the NAS share with a PC using same credentials used on the Shield to check effective permissions, and i am able to create folders, create/delete files no problem: so permissions seem OK.

- reinstalled/reset the backup plugin

- rebooted the Shield TV

- tried creating a user on the NAS with the same username as the Emby server (EmbySvr), and also its linked Emby Connect ID.

 

AND YOU GUESSED IT...the backup plugin fails with the same message every time no matter what I do :\

 

the questions:

- does the Emby backup plugin use the existing ShieldTV share access credentials, or does it separately access the share and create the folders/files using the Emby Server credentials? If so, does it use the local username, or the linked Emby Connect username?

- what else could be causing this, or what should i do to troubleshoot?

 

thanks

Edited by Happy2Play
Added tag
Link to comment
Share on other sites

I am getting the same error when Emby Server tries to update metadata. I have set the NFO writer as the metadata output and set it to save metadata with the media files (so, on my NAS).

2019-01-30 16:12:10.744 Error ProviderManager: Error in metadata saver
	*** Error Report ***
	Version: 4.0.1.0
	Command line: /mnt/expand/0875db30-4433-4393-a0dc-5471a62265cc/app/com.emby.embyserver-R84V3vaXGe0-a2aTFmHpcg==/base.apk
	Operating system: Unix 4.9.109.2
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Processor count: 4
	Program data path: /storage/emulated/0/Android/data/com.emby.embyserver/files
	Application directory: /mnt/expand/0875db30-4433-4393-a0dc-5471a62265cc/user/0/com.emby.embyserver
	Mono: 5.14.0 (explicit/969357ac02b)
	Android Version: 8.0.0-REL - SDK: 26 'O'
	Patch Level: 3664093_1378.1894 (2018-11-05)
	Fingerprint: NVIDIA/foster_e/foster:8.0.0/OPR6.170623.010/3664093_1378.1894:user/release-keys
	Model: SHIELD Android TV - NVIDIA/NVIDIA
	Hardware: foster/foster_e/foster_e/unknown
	SupportedAbis: arm64-v8a, armeabi-v7a, armeabi
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/D2015/mediafull/movies-rachel/R/Don't Be Afraid of the Dark (2010)/Don't Be Afraid of the Dark (2010).nfo" is denied.
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001b7] in <fe08c003e91342eb83df1ca48302ddbb>:0 
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
	  at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream (System.String path, MediaBrowser.Model.IO.FileOpenMode mode, MediaBrowser.Model.IO.FileAccessMode access, MediaBrowser.Model.IO.FileShareMode share, MediaBrowser.Model.IO.FileOpenOptions fileOpenOptions) [0x00045] in <8c99ead7fd9c44cab05a9d44c2163ecc>:0 
	  at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream (System.String path, MediaBrowser.Model.IO.FileOpenMode mode, MediaBrowser.Model.IO.FileAccessMode access, MediaBrowser.Model.IO.FileShareMode share, System.Boolean isAsync) [0x0003b] in <8c99ead7fd9c44cab05a9d44c2163ecc>:0 
	  at NfoMetadata.Savers.BaseNfoSaver.SaveToFile (System.IO.Stream stream, System.String path) [0x0002b] in <d2cea98514f5404392e37d4d0d9e05ab>:0 
	  at NfoMetadata.Savers.BaseNfoSaver.Save (MediaBrowser.Controller.Entities.BaseItem item, System.Threading.CancellationToken cancellationToken) [0x00026] in <d2cea98514f5404392e37d4d0d9e05ab>:0 
	  at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadata (MediaBrowser.Controller.Entities.BaseItem item, MediaBrowser.Controller.Library.ItemUpdateType updateType, MediaBrowser.Controller.Library.IMetadataSaver[] savers, System.Threading.CancellationToken cancellationToken) [0x00100] in <831dc56a08a74b9290f1ebbd0a901a63>:0 
	Source: mscorlib
	TargetSite: Void .ctor(String, FileMode, FileAccess, FileShare, Int32, Boolean, FileOptions)
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001b7] in <fe08c003e91342eb83df1ca48302ddbb>:0 
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <fe08c003e91342eb83df1ca48302ddbb>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions)
	  at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream (System.String path, MediaBrowser.Model.IO.FileOpenMode mode, MediaBrowser.Model.IO.FileAccessMode access, MediaBrowser.Model.IO.FileShareMode share, MediaBrowser.Model.IO.FileOpenOptions fileOpenOptions) [0x00045] in <8c99ead7fd9c44cab05a9d44c2163ecc>:0 
	  at Emby.Server.Implementations.IO.ManagedFileSystem.GetFileStream (System.String path, MediaBrowser.Model.IO.FileOpenMode mode, MediaBrowser.Model.IO.FileAccessMode access, MediaBrowser.Model.IO.FileShareMode share, System.Boolean isAsync) [0x0003b] in <8c99ead7fd9c44cab05a9d44c2163ecc>:0 
	  at NfoMetadata.Savers.BaseNfoSaver.SaveToFile (System.IO.Stream stream, System.String path) [0x0002b] in <d2cea98514f5404392e37d4d0d9e05ab>:0 
	  at NfoMetadata.Savers.BaseNfoSaver.Save (MediaBrowser.Controller.Entities.BaseItem item, System.Threading.CancellationToken cancellationToken) [0x00026] in <d2cea98514f5404392e37d4d0d9e05ab>:0 
	  at MediaBrowser.Providers.Manager.ProviderManager.SaveMetadata (MediaBrowser.Controller.Entities.BaseItem item, MediaBrowser.Controller.Library.ItemUpdateType updateType, MediaBrowser.Controller.Library.IMetadataSaver[] savers, System.Threading.CancellationToken cancellationToken) [0x00100] in <831dc56a08a74b9290f1ebbd0a901a63>:0 

I recently read this thread on the NVIDIA community forums claiming that applications on the NVIDIA Shield cannot write to network-mounted storage unless they are "whitelisted" by NVIDIA. Apparently, Plex and Kodi have been whitelisted, but I don't know about Emby. In a later message on the same thread though someone said whitelisting isn't necessary but Emby Server would have to use a special API to write to network-attached storage. I don't know if that's what is going on, but it seems plausible. Emby Server can read my media files, but I haven't seen any evidence that it has written any files.

 

https://forums.geforce.com/default/topic/1017890/shield-tv/write-content-to-smb-shares

Link to comment
Share on other sites

sanewton72

thanks Harrv, good to know it aint just me, and there's a sensible answer why I couldn't seem to successfully achieve a simple thing as a set an SMB share/directory permissions.

hopefully Luke & Sniper can sort it fairly easily moving forward. 

in the meantime, it looks like the backups are staying on the local HDD, with a manual copy every now & then.

Link to comment
Share on other sites

  • 1 month later...

It's resolved in the latest android server betas along with the shield 7.2.3. software. thanks.

Link to comment
Share on other sites

sanewton72

thanks Luke for staying on top of this stuff...christ knows how you guys stay on top of so many whingers  i mean user issues and also remember to circle back and let us know.  :)

keep up the good work!

At this rate, I won't even need to root my Shield to use it how i'd like to.   :blink:

Link to comment
Share on other sites

ameraj

my backup plugin keeps failing, with the error messages essentially saying authentication error trying to create the new directory.

normally pretty straight forward issue to resolve, i know, but...

 

background info

my ShieldTV Pro accesses an SMB share on a NAS, which has content subfolders (movies, TV shows, photos, yada yada), as well as a Backup directory.

this share is accessed using dedicated credentials without any issue by several apps on my ShieldTV, including Emby Server.

i installed the latest backup plugin (1.3.4.0), i browse/choose the backup directory, decide what i want to backup. no problem.

however the backup plugin fails every time it runs by schedule or when clicked.

Edited by ameraj
Link to comment
Share on other sites

my backup plugin keeps failing, with the error messages essentially saying authentication error trying to create the new directory.

normally pretty straight forward issue to resolve, i know, but...

 

background info

my ShieldTV Pro accesses an SMB share on a NAS, which has content subfolders (movies, TV shows, photos, yada yada), as well as a Backup directory.

this share is accessed using dedicated credentials without any issue by several apps on my ShieldTV, including Emby Server.

i installed the latest backup plugin (1.3.4.0), i browse/choose the backup directory, decide what i want to backup. no problem.

however the backup plugin fails every time it runs by schedule or when clicked.

 

@@ameraj how exactly did you add the SMB path to Emby?

Link to comment
Share on other sites

  • 1 month later...
esseki

Hi,

 

i am reviving this topic as i am in the same situation as @@ameraj : i would like to store my Emby server backup made with "Emby backup" plugin on a network share.

 

Here is my setup :

  • Emby server version 4.1.1.0
  • Running from a Nvidia Shiled TV with OS version 8.0.0
  • Emby backup plugin version 1.3.4.0
  • Network share via SMB on a Synology NAS

 

I have read lots of topics in this forum about the ability to mount with write privileges a SMB network share from the Shield. It seems to be possible since shield 7.2.3 (i'm running 8.0.0) but nowhere i have found in this forum explanations about the proper way how to mount the network share with write privilege.

 

Here is how i did, maybe @@Luke you can point out to me (and others who might find this explanation helpful) what i did wrong :

- i went to "shield settings / storage&reset / mount network storage"

- i mounted my network share with no problem. Mount point is "/storage/DS_411/"

- i can browse the NAS and reach the location where i want to store my backup files from the plugin settings panel.

 

But when the "Configuration backup" tasks runs, it fails with the following logs :

2019-05-15 11:04:42.873 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/Users/5fc075908b914faf9988dcde37a48c9a. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:42.878 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 4ms. http://192.168.100.6:8096/emby/Users/5fc075908b914faf9988dcde37a48c9a
2019-05-15 11:04:42.900 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:42.913 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 13ms. http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false
2019-05-15 11:04:44.778 Info HttpServer: HTTP POST http://192.168.100.6:8096/emby/ScheduledTasks/Running/a1e4a7962c72ac5e491497598d1ee479. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:44.788 Info TaskManager: Executing Configuration Backup
2019-05-15 11:04:44.789 Info HttpServer: HTTP Response 204 to 192.168.100.57. Time: 10ms. http://192.168.100.6:8096/emby/ScheduledTasks/Running/a1e4a7962c72ac5e491497598d1ee479
2019-05-15 11:04:44.794 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:44.799 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 5ms. http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false
2019-05-15 11:04:44.967 Info Server Configuration Backup: Backup of profile Default Started
2019-05-15 11:04:44.970 Error TaskManager: Error
	*** Error Report ***
	Version: 4.1.1.0
	Command line: /data/app/com.emby.embyserver-_d5Xq_imo_e8zP03Xi6ohQ==/base.apk
	Operating system: Unix 4.9.109.4
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Runtime: file:///mscorlib.dll
	Processor count: 4
	Program data path: /storage/emulated/0/Android/data/com.emby.embyserver/files
	Application directory: /data/user/0/com.emby.embyserver
	Mono: 5.14.0 (explicit/62031dcabf4)
	Android Version: 8.0.0-REL - SDK: 26 'O'
	Patch Level: 3507953_1441.7411 (2018-12-05)
	Fingerprint: NVIDIA/darcy/darcy:8.0.0/OPR6.170623.010/3507953_1441.7411:user/release-keys
	Model: SHIELD Android TV - NVIDIA/NVIDIA
	Hardware: darcy/darcy/darcy/unknown
	SupportedAbis: arm64-v8a, armeabi-v7a, armeabi
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/DS_411/files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto/packageruntime.dat" is denied.
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001b7] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
	  at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x0001c] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00055] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool,System.Text.Encoding)
	  at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00007] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at Emby.Server.Implementations.IO.ManagedFileSystem.WriteAllText (System.String path, System.String text) [0x0001c] in <fde33dc083004d96a63cf2129ad12dfb>:0 
	  at MBBackup.ServerEntryPoint+<ExecuteBackup>d__61.MoveNext () [0x001db] in <b48c1b9ae14d440baa732016b620ddb8>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at MBBackup.Entities.ScheduledBackupTask+<Execute>d__8.MoveNext () [0x00085] in <b48c1b9ae14d440baa732016b620ddb8>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker+<ExecuteInternal>d__68.MoveNext () [0x00188] in <fde33dc083004d96a63cf2129ad12dfb>:0 
	Source: mscorlib
	TargetSite: Void Throw()
	
2019-05-15 11:04:44.971 Info TaskManager: Configuration Backup Failed after 0 minute(s) and 0 seconds
2019-05-15 11:04:44.986 Info TaskManager: ExecuteQueuedTasks
2019-05-15 11:04:46.862 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Logs. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:46.862 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Configuration. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-15 11:04:46.914 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 52ms. http://192.168.100.6:8096/emby/System/Logs
2019-05-15 11:04:46.935 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 73ms. http://192.168.100.6:8096/emby/System/Configuration
2019-05-15 11:04:47.913 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Logs/Log?name=embyserver.txt. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36

According to this error message, it seems that Emby sevrer does not have proper write access to write files on the network share :

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/DS_411/files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto/packageruntime.dat" is denied.

Any help would be greatly appreciated.

 

Thank you in advance

Edited by esseki
Link to comment
Share on other sites

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/DS_411/files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto/packageruntime.dat" is denied.

Any help would be greatly appreciated.

 

Thank you in advance

 

Cold you have a look at your network drive and check which of these folders exist:

 

  • /files/Tib/Matos
  • /files/Tib/Matos/Nvidia Shiled
  • /files/Tib/Matos/Nvidia Shiled/Emby
  • /files/Tib/Matos/Nvidia Shiled/Emby/Backup
  • /files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto

I don't know the backup plugin, but the error occurs at the moment when the plugin tries to write the text to file.

The containing folder includes date and time, so it seems to be specific to each individual backup task execution.

 

That leads us to the following possibilities:

  • Either the plugin did not explicitly create the folder "Emby Backup - 2019-05-15 11.4.44 - Auto" before attempting the save

    >> That could possibly be the reason why it fails (auto-creation of the full path might work on local file systems but not on shares)

    .

  • Or the plugin has actually created the folder before

    >> That would mean that write access would be working (otherwise the error would already have occurred when trying to create the folder)

Link to comment
Share on other sites

harrv

...

 

That leads us to the following possibilities:

  • Either the plugin did not explicitly create the folder "Emby Backup - 2019-05-15 11.4.44 - Auto" before attempting the save

    >> That could possibly be the reason why it fails (auto-creation of the full path might work on local file systems but not on shares)

    .

  • Or the plugin has actually created the folder before

    >> That would mean that write access would be working (otherwise the error would already have occurred when trying to create the folder)

 

I'm not the user you're asking, but just as a data point, I use the backup plugin from Emby Server for Windows and it saves to an SMB share just fine on that platform. I don't know if it creates the directory as a separate step or not, but there is definitely a new directory created for each backup, and I wanted to let you know that plugin saves to an SMB share fine from other platforms. So I'd take a closer look at Emby Server for Shield specifically before labeling this a plugin problem.

 

I've been meaning to give Emby Server for Shield another try. The last time I tried I quickly ran into the issue of not being able to write to SMB shares. Now that that issue is supposedly fixed, I'll give it another go if I can find the time to try it again. When I do, I'll try the backup plugin as well and let you know if it works for me or if I have the same issue as esseki.

Link to comment
Share on other sites

I'm not the user you're asking, but just as a data point, I use the backup plugin from Emby Server for Windows and it saves to an SMB share just fine on that platform. I don't know if it creates the directory as a separate step or not, but there is definitely a new directory created for each backup, and I wanted to let you know that plugin saves to an SMB share fine from other platforms. So I'd take a closer look at Emby Server for Shield specifically before labeling this a plugin problem.

 

This is not Windows (1). This is not Linux (2). This is not even just plain Android (3). It is Nvidia Shield-Android having some additional restrictions about network share access.

So nothing from 1, 2 and 3 can be taken for granted here.

 

I'm not quite sure why you're assuming that I want to blame away the problem. It was just about possible causes. Wouldn't make a lot of sense anyway because the backup plugin is our own plugin.

Link to comment
Share on other sites

esseki

Hi @@softworkz,

 

thank you for your answer.

Please find below my responses in blue to your questions :

 

Cold you have a look at your network drive and check which of these folders exist:

  • /files/Tib/Matos   => exists
  • /files/Tib/Matos/Nvidia Shiled    => exists
  • /files/Tib/Matos/Nvidia Shiled/Emby   => exists
  • /files/Tib/Matos/Nvidia Shiled/Emby/Backup   => exists
  • /files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto   => exists  !!! (which comes as a surprise as it seems that the Shield has write access to the network share finally)

That leads us to the following possibilities:

  • Either the plugin did not explicitly create the folder "Emby Backup - 2019-05-15 11.4.44 - Auto" before attempting the save
    >> That could possibly be the reason why it fails (auto-creation of the full path might work on local file systems but not on shares)   
    => This does not seem to be the case as the folder has sucessfully been created. I checked the permission for the folder on my NAS and it is "700".
     
  • Or the plugin has actually created the folder before
    >> That would mean that write access would be working (otherwise the error would already have occurred when trying to create the folder) . 
    => This seems to be the case. But what does it mean ? Why if the plugin can create the folder it does not succeed writing into it ?
Edited by esseki
Link to comment
Share on other sites

Not sure. Looks like for some reason it was denied the ability to create files.

Link to comment
Share on other sites

  • /files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-15 11.4.44 - Auto   => exists  !!! (which comes as a surprise as it seems that the Shield has write access to the network share finally)

That leads us to the following possibilities:

  • Either the plugin did not explicitly create the folder "Emby Backup - 2019-05-15 11.4.44 - Auto" before attempting the save

    >> That could possibly be the reason why it fails (auto-creation of the full path might work on local file systems but not on shares)   

    => This does not seem to be the case as the folder has sucessfully been created. I checked the permission for the folder on my NAS and it is "700".

     

  • Or the plugin has actually created the folder before

    >> That would mean that write access would be working (otherwise the error would already have occurred when trying to create the folder) . 

    => This seems to be the case. But what does it mean ? Why if the plugin can create the folder it does not succeed writing into it ?

 

Could you check the owner/group of the created folder and compare with that of the parent folder?

Also check whether parent folder has 700 as well.

Link to comment
Share on other sites

esseki

Hi,

 

please find the info requested :

 

1) owner/ group of the created folder : "Emby Backup - 2019-05-15 11.4.44 - Auto" / owner : "esseki" / group : "users" / Permissions : "700"

2) owner/ group of the parent folder : "Backup" / owner : "esseki" / group : "users" / Permissions : "777"

 

It seems that only the permissions are different.

Just would like to precise that when i mounted the network share in the Shield settings, i used the account "esseki".

 

Thank you for your help 

Edited by esseki
Link to comment
Share on other sites

esseki

Hi @@Luke,

 

unfortunately i am still having the same problem with "Backup" plugin when attempting to store backups on a network share. This is a pitty as doing backups on the same device is not very secure or helpful.

How could i help debugging ? For example today i tried to activated debug logging and run again the backup task but it seems that it does not give more info in the logs about the problem :

2019-05-18 21:10:26.608 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 26ms. http://192.168.100.6:8096/emby/System/Endpoint
2019-05-18 21:10:28.109 Info HttpServer: WS http://192.168.100.6:8096/?DeviceID=8796752717296&api_key=e1ad2529bac64beb9e6165da476fc0c2. UserAgent: Python/3.7 aiohttp/3.5.4
2019-05-18 21:10:28.109 Debug HttpServer: Web socket connection allowed
2019-05-18 21:10:28.118 Debug SessionManager: Creating new WebSocketController
2019-05-18 21:10:28.156 Debug App: SessionInfoWebSocketListener Begin transmitting over websocket to [::ffff:192.168.100.50]:44880
2019-05-18 21:10:33.582 Info HttpServer: WS http://192.168.100.6:8096/embywebsocket?api_key=74d23a70a1a84462b88953720ae4d41e&deviceId=TW96aWxsYS81LjAgKE1hY2ludG9zaDsgSW50ZWwgTWFjIE9TIFggMTBfMTRfNCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzczLjAuMzY4My4xMDMgU2FmYXJpLzUzNy4zNnwxNTU3MDkwMDAxOTg2. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:33.583 Debug HttpServer: Web socket connection allowed
2019-05-18 21:10:39.022 Debug App: ScheduledTasksWebSocketListener Begin transmitting over websocket to [::ffff:192.168.100.57]:58554
2019-05-18 21:10:39.025 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:39.040 Debug XmlSerializer: Deserializing file /storage/emulated/0/Android/data/com.emby.embyserver/files/plugins/configurations/MBBackup.xml
2019-05-18 21:10:39.123 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 99ms. http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false
2019-05-18 21:10:41.180 Info HttpServer: HTTP POST http://192.168.100.6:8096/emby/ScheduledTasks/Running/a1e4a7962c72ac5e491497598d1ee479. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:41.185 Info TaskManager: Executing Configuration Backup
2019-05-18 21:10:41.186 Info HttpServer: HTTP Response 204 to 192.168.100.57. Time: 6ms. http://192.168.100.6:8096/emby/ScheduledTasks/Running/a1e4a7962c72ac5e491497598d1ee479
2019-05-18 21:10:41.191 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:41.197 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 6ms. http://192.168.100.6:8096/emby/ScheduledTasks?isHidden=false
2019-05-18 21:10:41.597 Info Server Configuration Backup: Backup of profile Default Started
2019-05-18 21:10:41.619 Error TaskManager: Error
	*** Error Report ***
	Version: 4.1.1.0
	Command line: /data/app/com.emby.embyserver-rJz1nALY1-A43ZvM8VMwqg==/base.apk
	Operating system: Unix 4.9.109.4
	64-Bit OS: True
	64-Bit Process: True
	User Interactive: False
	Runtime: file:///mscorlib.dll
	Processor count: 4
	Program data path: /storage/emulated/0/Android/data/com.emby.embyserver/files
	Application directory: /data/user/0/com.emby.embyserver
	Mono: 5.14.0 (explicit/62031dcabf4)
	Android Version: 8.0.0-REL - SDK: 26 'O'
	Patch Level: 3507953_1441.7411 (2018-12-05)
	Fingerprint: NVIDIA/darcy/darcy:8.0.0/OPR6.170623.010/3507953_1441.7411:user/release-keys
	Model: SHIELD Android TV - NVIDIA/NVIDIA
	Hardware: darcy/darcy/darcy/unknown
	SupportedAbis: arm64-v8a, armeabi-v7a, armeabi
	System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/DS_411/files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-18 09.10.41 - Auto/packageruntime.dat" is denied.
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001b7] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
	  at System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) [0x0001c] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) [0x00055] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string,bool,System.Text.Encoding)
	  at System.IO.File.WriteAllText (System.String path, System.String contents, System.Text.Encoding encoding) [0x00000] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at System.IO.File.WriteAllText (System.String path, System.String contents) [0x00007] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 
	  at Emby.Server.Implementations.IO.ManagedFileSystem.WriteAllText (System.String path, System.String text) [0x0001c] in <fde33dc083004d96a63cf2129ad12dfb>:0 
	  at MBBackup.ServerEntryPoint+<ExecuteBackup>d__61.MoveNext () [0x001db] in <b48c1b9ae14d440baa732016b620ddb8>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at MBBackup.Entities.ScheduledBackupTask+<Execute>d__8.MoveNext () [0x00085] in <b48c1b9ae14d440baa732016b620ddb8>:0 
	--- End of stack trace from previous location where exception was thrown ---
	  at Emby.Server.Implementations.ScheduledTasks.ScheduledTaskWorker+<ExecuteInternal>d__68.MoveNext () [0x00188] in <fde33dc083004d96a63cf2129ad12dfb>:0 
	Source: mscorlib
	TargetSite: Void Throw()
	
2019-05-18 21:10:41.619 Info TaskManager: Configuration Backup Failed after 0 minute(s) and 0 seconds
2019-05-18 21:10:41.638 Debug XmlSerializer: Deserializing file /storage/emulated/0/Android/data/com.emby.embyserver/files/config/notifications.xml
2019-05-18 21:10:41.654 Info TaskManager: ExecuteQueuedTasks
2019-05-18 21:10:45.552 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Logs. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:45.552 Debug App: ScheduledTasksWebSocketListener stop transmitting over websocket to [::ffff:192.168.100.57]:58554
2019-05-18 21:10:45.552 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Configuration. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
2019-05-18 21:10:45.556 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 4ms. http://192.168.100.6:8096/emby/System/Configuration
2019-05-18 21:10:45.575 Info HttpServer: HTTP Response 200 to 192.168.100.57. Time: 23ms. http://192.168.100.6:8096/emby/System/Logs
2019-05-18 21:10:46.981 Info HttpServer: HTTP GET http://192.168.100.6:8096/emby/System/Logs/Log?name=embyserver.txt. UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36

Could it be that the Backup plugin is trying to write with anonymous privilege rather than the user i mounted the network share with in the Shield settings ?

 

System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path "/storage/DS_411/files/Tib/Matos/Nvidia Shiled/Emby/Backup/Emby Backup - 2019-05-18 09.10.41 - Auto/packageruntime.dat" is denied.
     at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x001b7] in <d4a23bbd2f544c30a48c44dd622ce09f>:0

 

esseki
     

Link to comment
Share on other sites

The parameter that you quoted above in red doesn't say anything because we don't know the value of the 'anonymous' parameter (could be true or false).

 

But it could be related to that. How did you mount the network share on the Shield? With username/password or anonymously?

 

The second question is about why the newly created directory does not simply inherit the permissions of the parent folder when it is created. So what kind of share is it that you've mounted here? Maybe this can be configured in some way to use inherited permissions.

Link to comment
Share on other sites

harrv

This is not Windows (1). This is not Linux (2). This is not even just plain Android (3). It is Nvidia Shield-Android having some additional restrictions about network share access.

So nothing from 1, 2 and 3 can be taken for granted here.

 

I'm not quite sure why you're assuming that I want to blame away the problem. It was just about possible causes. Wouldn't make a lot of sense anyway because the backup plugin is our own plugin.

Clearly! Also, you are reading WAY more into my reply than what I actually said. I didn’t say anything about blame and was not making assumptions about anything in that regard. I also thought I made it clear that I understood I was just supplying a data point about how the plugin behaves on Windows that I knew may or may not be helpful to your troubleshooting the problem on the Shield. I was simply replying to the comment you made about the possibility of it being a plugin issue that works on the local file system but not shares. Because you said, “I don’t know the backup plugin,” and because you didn’t say anything to indicate you knew that it works on shares on at least one other platform (Windows), I thought that comment had the possibility of being useful. Clearly you don’t think so, so my apologies.

  • Like 1
Link to comment
Share on other sites

Nevermind. I guess I've seen too many "it's not our fault" support replies and I just don't want to appear like that.. 

Link to comment
Share on other sites

  • Solution
esseki

Hi @@softworkz,

 

Thanks a lot for your help and patience with my problem. I finally got it working.

Let me share the solution in case it can help others :

 

First of all, my NAS is a Synology. Then i confirm that when i mounted the network share in the Shield settings, i did use a username and password. 

 

I eventually had a look at the SMB server settings and i tried a few options until i got it working.

 

To do so you have to go into the Synology "Control Pannel -> File Services -> SMB / AFP NFS tab -> SMB section -> Advanced settings" and set 

  • Maximum SMB protocol : SMB3
  • Minimum SMB protocol : SMB1

As a result the SMB range should show : "SMB range SMB1,SMB2,SMB2 and Large MTU,SMB3".

The permissions are now properly inherited for the folder created by the Backup plugin.

 

That did the trick :)

Edited by esseki
  • Like 2
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...