Jump to content


Photo

Backup plugin failing: network credentials?

SMB

Best Answer esseki , 21 May 2019 - 03:56 PM

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 :)

Go to the full post


  • Please log in to reply
26 replies to this topic

#21 esseki OFFLINE  

esseki

    Advanced Member

  • Members
  • 37 posts
  • Local time: 06:37 AM

Posted 18 May 2019 - 03:28 PM

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
     



#22 softworkz ONLINE  

softworkz

    Advanced Member

  • Developers
  • 1401 posts
  • Local time: 07:37 AM

Posted 18 May 2019 - 05:55 PM

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.



#23 harrv OFFLINE  

harrv

    Advanced Member

  • Members
  • 48 posts
  • Local time: 11:37 PM
  • LocationRocky Mountains

Posted 20 May 2019 - 01:29 AM

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.
  • softworkz likes this

#24 softworkz ONLINE  

softworkz

    Advanced Member

  • Developers
  • 1401 posts
  • Local time: 07:37 AM

Posted 20 May 2019 - 01:40 AM

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



#25 esseki OFFLINE  

esseki

    Advanced Member

  • Members
  • 37 posts
  • Local time: 06:37 AM

Posted 21 May 2019 - 03:56 PM   Best Answer

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, 21 May 2019 - 04:00 PM.

  • Happy2Play and softworkz like this

#26 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 127006 posts
  • Local time: 01:37 AM

Posted 21 May 2019 - 03:57 PM

Thanks for the feedback !



#27 softworkz ONLINE  

softworkz

    Advanced Member

  • Developers
  • 1401 posts
  • Local time: 07:37 AM

Posted 21 May 2019 - 08:39 PM

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 :

 

Thanks for reporting back. I'm glad I could help you solving this!

 

@Happy2Play - Maybe we should copy this solution over to some place where it can be found more easily? And mark it as answer..







Also tagged with one or more of these keywords: SMB

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users