Jump to content

Server running as service but can't access NAS shares


Recommended Posts

aerospyke
Posted

Hi all,

 

I wanted to extend my storage from my local drives to a NAS I have.... but i can't seem to get the shared folders to add to my library. I'm running a Windows 10 1703 computer with Emby Server 3.2.20.0 and Theatre on the same box. I am attempting to connect to a QNAP NAS. My NAS and media server are both domain joined, the service account is running as a domain user account that has read/write access to the share on the QNAP. It is not an admin on my media server.

 

I don't know if it is related, but whenever I restart the media server, the emby server service doesn't start. Event logs say the password is wrong or something, but i go to services and click start and it starts without a problem.

 

Thoughts? Help? Info I've left out somewhere?

aerospyke
Posted

Sorry figured out half of my problem... I was putting in the network path only in the optional field for network path, but int he "folder" field that you need to fill in, I was only using the label.

 

DUH!!!

 

Still need to figure out the service not starting up after reboot though.... and now my initial testing of having some of my existing shows in this new location, i've lost my "viewed" history... did I forget something here?

Posted

The Windows Service is always more complicated, because you have to manage access to resources for the system account that is running the service. That's why even though we provide the service, we still recommend keeping it simple and using the tray icon.

aerospyke
Posted

The Windows Service is always more complicated, because you have to manage access to resources for the system account that is running the service. That's why even though we provide the service, we still recommend keeping it simple and using the tray icon.

 

Thanks Luke, i understand that is the case but in my work and my mind I like to keep delineated lines of security around access and the like, so if a machine is compromised, depending the nature of that issue, not all of my environment is compromised. That and if it SHOULD work on service, I just want to make it work so i can have that satisfaction of getting it working. :lol:

 

Is there any guidance on my view data (i.e. episodes viewed and unviewed)? Where is this stored, is it in the database that I would need to do a migration as per the backup document in the wiki?

Happy2Play
Posted

So your network shares have the proper/same permissions that are running Emby Service?  Unable to access media when running server as a service
 

 
ideally the Server Configuration Backup plugin should be used to restore this information, but there are manual options.
 
How to migrate Emby Server

 

I have had success exporting the UserData Table and imported into the new database also.

aerospyke
Posted

So your network shares have the proper/same permissions that are running Emby Service?  Unable to access media when running server as a service

 

 

 

ideally the Server Configuration Backup plugin should be used to restore this information, but there are manual options.

 

How to migrate Emby Server

 

I have had success exporting the UserData Table and imported into the new database also.

Hi Happy (cool name)

 

Yes permissions are all sorted now, I can access the shares and play from them no problems now, just got to get the user data (If that is where it is stored) to be happy too. I managed to get the service a "bit" more stable by putting in crash steps in place to restart the service if it crashes, worst case the server comes up 1 min after reboot. Odd but it's a start.

 

Cheers i'll see what I can get working from that document.

  • 5 years later...
Posted

Hello,

Unfortunately my service is unable to acces smb shares. 

Exactly same folders used in the config. 

I start emby server as an app, in the tray, all is ok. 

I close the app, start the service(configured to run as the same user under which the app is running) and it cant access cache and media folders which are smb shares. 

 

Emby running on win server 2022 vm. 

Any thoughts?

 

Posted
10 minutes ago, nonyhaha said:

Hello,

Unfortunately my service is unable to acces smb shares. 

Exactly same folders used in the config. 

I start emby server as an app, in the tray, all is ok. 

I close the app, start the service(configured to run as the same user under which the app is running) and it cant access cache and media folders which are smb shares. 

 

Emby running on win server 2022 vm. 

Any thoughts?

 

HI, for starters, I would  keep it simple and run the server as a normal windows app rather than a windows service. What happens when you do that? I would get that working first, and then look at moving to a windows service if you want to.

Posted

Hi @Luke. As an app, it is working great. :). I was just trying to move it as a service. 

Posted

Then it probably comes down to the user that the service is configured to run under, and that user not having permissions to write to those shares.

rbjtech
Posted (edited)

So you need to create a 'service account', give it permission to logon as a service (and give it access to the shares) and use that as the 'Log On As' account in the service setup.

for example -

image.png.7d8ae16e358b8a3ea085a022088e31ef.png

 

Also - I would not put the cache on smb shares - performance will be very degraded.

 

Edited by rbjtech
Posted
1 hour ago, rbjtech said:

So you need to create a 'service account', give it permission to logon as a service (and give it access to the shares) and use that as the 'Log On As' account in the service setup.

for example -

image.png.7d8ae16e358b8a3ea085a022088e31ef.png

 

Also - I would not put the cache on smb shares - performance will be very degraded.

 

Service is running under the exact same user as the app. The share is a zfs raidz pool of 4 ssds. I made that primarily for my sql and emby needs. 

rbjtech
Posted
3 minutes ago, nonyhaha said:

Service is running under the exact same user as the app. The share is a zfs raidz pool of 4 ssds. I made that primarily for my sql and emby needs. 

Then it should work - there is no reason for it not to.

pwhodges
Posted (edited)

Oops

Edited by pwhodges
Happy2Play
Posted
2 minutes ago, pwhodges said:

The new build still has the same problem:

Paul

embyserver-63815192062.txt 21.48 kB · 0 downloads

Sorry I don't see how this is related as your server shuts down do to "SQL: Error: incomplete input - replace into UserItemShares (ItemId, UserId, ShareLevel) values ".  But testing version  would only be discussing PM or Testing area.

pwhodges
Posted (edited)

Oops - Sorry, I really thought I was in the PM thread...

Paul

Edited by pwhodges
Posted

Hello,

Just a headsup to anybody doing this as a service.

My problems seem to have come from the fact that i was pinting emby server to MAPPED NETWORK LOCATIONS. This does not work, I had to use the entire network address of the folders. 

Cheers!

 

  • Like 1
rbjtech
Posted (edited)
3 hours ago, nonyhaha said:

Hello,

Just a headsup to anybody doing this as a service.

My problems seem to have come from the fact that i was pinting emby server to MAPPED NETWORK LOCATIONS. This does not work, I had to use the entire network address of the folders. 

Cheers!

 

Good shout.

In emby I always use UNC path names even for local storage/drives and recommend anyone to do to the same as it adds a flexibility layer to the configuration.

ie I created a shared drive on my local D : drive to be \\MEDIA\share - and in emby point it to \\MEDIA\share

That way, if I want to even move the contents to lets say another local drive or even a NAS etc - all I have to do is move the 'share' - emby see's it no differently and I don't have to re-scan everything.

 

Edited by rbjtech
  • 1 year later...
Posted (edited)

Just sharing my experience. I moved to a Microsoft VM in HyperV so I can leverage passthrough GPU for transcoding. Having to sign on to Windows to get Emby started wasn't workable for me. I used the article below to make it a service. It worked well, Emby started automatically after a re-boot, but... no access to NAS shares so my media wouldn't play. Here's how I solved this.

  1. Create a local user on your Windows PC that matches the un and pw of the NAS account used to access the share.
  2. Running as Windows Service | Emby Documentation
    1. I used the 64bit version and put it in a folder called nssm-2.24 in C:\Program Files\nssm-2.24\
  3. Edit the service you just created Properties > Log On > Enable "This account:" Choose the local user you created and fill in the password. (This step can also be done during step 2 with-in the NSSM setup)
  4. Disable "Run server at startup" in Emby Management UI > Server > Settings
Edited by RandyChuck
  • Thanks 1

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