[Solved] How to address Virtual Folders with SMB network share???

For help and support with Universal Media Server
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply
Post Reply
thrakazog
Posts: 12
Joined: Sun Jul 27, 2014 4:55 pm

[Solved] How to address Virtual Folders with SMB network share???

Post by thrakazog »

UMS used to use the VirtualFolders.conf file to detail folders to add collectively to a media folder. I believe this was migrated to SHARED.conf, but it no longer honors the SMB shares. There is no way to address a share through the UI either. Additionally, you cannot map a network drive and have it appear in the list of drives to select media folders.

Is this by design, that UMS will only share media that is available locally? or has this functionality just be lost through the versions?

Thanks
Chris
User avatar
mik_s
Moderator
Posts: 1219
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: How to address Virtual Folders with SMB network share???

Post by mik_s »

It should still work and allow you to add any connected drives from within the shared content option in the web settings.

This still has the virtual folders option, its just has this with the normal folders and web content all in one place.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
thrakazog
Posts: 12
Joined: Sun Jul 27, 2014 4:55 pm

Re: How to address Virtual Folders with SMB network share???

Post by thrakazog »

Sorry, I'm not clear exactly what that means.
When I map a network drive as a drive letter, it will not show up in the list from Shared Content - Type:Folder and I can only select the button that opens a window to find a physical file path. The mapped drives do not appear.

When I select from Shared Content - Type:Virtual Folder, I have options for "Name", "Path", and "Add Folders" where the name and path seem to determine hot the media links are generated in the UI, but the add folders only allows once again, physical drives and no SMB path like "\\server\share" or a mapped drive like "Z:\" mapped to the \\server\share.

Can you confirm the Shared Content UI actually is intended to map SMB shares like \\server\share ?

Thanks
User avatar
mik_s
Moderator
Posts: 1219
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: How to address Virtual Folders with SMB network share???

Post by mik_s »

I don't know anything about network shares or SMB so I can't test this myself.
It might have been a bug in a previous version that may have been fixed in the latest. I remember seeing an issue about the shared content recently but not sure if it was related to this

It could just be a problem on the web UI but manually editing the SHARED.conf should make it work. If this is the case then I could open an issue on Github to get it fixed.

Could you post your logs and screenshots of this so I can see exactly what you mean and narrow down the problem.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
thrakazog
Posts: 12
Joined: Sun Jul 27, 2014 4:55 pm

Re: How to address Virtual Folders with SMB network share???

Post by thrakazog »

I'm not sure posting images in the Web UI will help when it does not support Virtual Folders.

Before UMS version 12 or so, I always used a file called VirtualFolders.conf and the format that worked was as follows:
[
{
"name":"MEDIA",
"files":["\\\\SERVER2016\\MEDIA"]
},
{
"name":"VIDEO_FILES",
"files":["\\\\WIN2012R2HYPERV\\Movie_Files"]
},
{
"name":"DVD_SYNC",
"files":["\\WIN10-WKSTN\DVD_SYNC"]
}
]

So this json file would add in a virtual folder in UMS to browse media and the contents of the SMB share would automagically show up. I've not been able to get this functionality to work since. It seems it has been reported in the past. Here's a similar post: viewtopic.php?t=15493

Is there any way to find the source code that imported this virtual folder data and incorporate it in the Web UI ?
User avatar
mik_s
Moderator
Posts: 1219
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: How to address Virtual Folders with SMB network share???

Post by mik_s »

Try manually editing your SHARED.conf
It will be something like this for normal folder

Code: Select all

[
  {
    "file": "\\\\SERVER2016\\MEDIA",
    "monitored": true,
    "metadata": true,
    "active": true,
    "type": "Folder"
  },  
  {
    "file": "\\\\WIN2012R2HYPERV\\Movie_Files",
    "monitored": true,
    "metadata": true,
    "active": true,
    "type": "Folder"
  },
  {
    "file": "\\\\WIN10-WKSTN\\DVD_SYNC",
    "monitored": true,
    "metadata": true,
    "active": true,
    "type": "Folder"
  }
]
If you previously had a VirtualFolders.conf then this should already appear in SHARED.conf

If that works then It is probably a problem with the web UI.
In theory it should work as it is using the OS to access those paths.

If not it may be a permission issue.
I don't know anything about network shares but should there not be a drive letter assigned? Will if work if you assign one?

To know what is going on I will need to see your logs as it will give a clue (see the section in red above)
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
thrakazog
Posts: 12
Joined: Sun Jul 27, 2014 4:55 pm

Re: How to address Virtual Folders with SMB network share???

Post by thrakazog »

Thank you mik_s,

It is VERY CURIOUS how only 1 of those SMB shares shows up in UMS while the other 2 do not. I've verified the permissions on all the shares have "everyone / full control" which is the same as the one that does show up in UMS. The host machine for UMS is able to browse all the shares in question as well so they are visible to the OS.

I'm trying to get the logs to share. It would be nice if there was a purge button so we could start off with a clean log file, start UMS and only share a single run of the app. Might cut down on the noise when troubleshooting. I've attached the logs in Debug mode, but I don't see any entry for the "\\server2016\media" share. This one does not show up in UMS, but no issue logged. I know it does work in the OS and permissions are wide open.

As for the Web UI, it is clear the field is not editable and the browser tool to select a folder only allows selection of local paths. It would be useful of the path field was editable in the case you cannot browse to the network path.

At this point it is very puzzling why one shared folder works and another does not.

Definitely, I appreciate your help in troubleshooting this mik_s !!!
Attachments
ums_dbg_2024-06-10-14-34.zip
(520.68 KiB) Downloaded 33 times
User avatar
mik_s
Moderator
Posts: 1219
Joined: Wed Aug 23, 2017 11:03 pm
Location: UK

Re: How to address Virtual Folders with SMB network share???

Post by mik_s »

At first look I saw a few errors in the logs. The first is this

Code: Select all

DEBUG 2024-06-10 13:55:49.581 [main] PID file not found, cannot check for running process
ERROR 2024-06-10 13:55:49.581 [main] Failed to write PID file: C:\ProgramData\UMS\data\UMS.pid (The system cannot find the path specified)
UMS might need to run as an administrator to enforce single instance
This is not something I have seen before or know what a PID file is.
At a guess it may be something to do with a process ID of when UMS was running previously.
It is probably not related but worth checking the path exists and can be written to.

The next 3 errors I see is

Code: Select all

ERROR 2024-06-10 13:55:57.500 [Media Scanner] A plugin has attempted to add a null child to "root"
DEBUG 2024-06-10 13:55:57.500 [Media Scanner] Error info:
java.lang.NullPointerException: Invalid store resource
	at net.pms.store.StoreContainer.addChild(StoreContainer.java:106)
	at net.pms.store.MediaStore.setFolderContent(MediaStore.java:285)
	at net.pms.store.MediaStore.setSharedContents(MediaStore.java:258)
	at net.pms.store.MediaStore.discoverChildren(MediaStore.java:206)
	at net.pms.renderers.Renderer.getMediaStore(Renderer.java:257)
	at net.pms.store.MediaScanner.reset(MediaScanner.java:161)
	at net.pms.store.MediaScanner.startScan(MediaScanner.java:88)
	at net.pms.store.MediaScanner.lambda$startMediaScan$0(MediaScanner.java:193)
	at java.base/java.lang.Thread.run(Unknown Source)
	
ERROR 2024-06-10 13:55:57.550 [Media Scanner] A plugin has attempted to add a null child to "root"
DEBUG 2024-06-10 13:55:57.550 [Media Scanner] Error info:
java.lang.NullPointerException: Invalid store resource
	at net.pms.store.StoreContainer.addChild(StoreContainer.java:106)
	at net.pms.store.StoreContainer.addChild(StoreContainer.java:98)
	at net.pms.store.MediaScanner.setSharedContent(MediaScanner.java:173)
	at net.pms.store.MediaScanner.startScan(MediaScanner.java:91)
	at net.pms.store.MediaScanner.lambda$startMediaScan$0(MediaScanner.java:193)
	at java.base/java.lang.Thread.run(Unknown Source)
	
ERROR 2024-06-10 13:57:10.020 [webgui-server 18] A plugin has attempted to add a null child to "root"
DEBUG 2024-06-10 13:57:10.020 [webgui-server 18] Error info:
java.lang.NullPointerException: Invalid store resource
	at net.pms.store.StoreContainer.addChild(StoreContainer.java:106)
	at net.pms.store.MediaStore.setFolderContent(MediaStore.java:285)
	at net.pms.store.MediaStore.setSharedContents(MediaStore.java:258)
	at net.pms.store.MediaStore.discoverChildren(MediaStore.java:206)
	at net.pms.renderers.Renderer.getMediaStore(Renderer.java:257)
	at net.pms.network.webguiserver.servlets.PlayerApiServlet.getBrowsePage(PlayerApiServlet.java:343)
	at net.pms.network.webguiserver.servlets.PlayerApiServlet.doPost(PlayerApiServlet.java:155)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:547)
	at net.pms.network.webguiserver.GuiHttpServlet.service(GuiHttpServlet.java:61)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at net.pms.network.httpserverservletcontainer.HttpHandlerServlet.handle(HttpHandlerServlet.java:37)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(Unknown Source)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(Unknown Source)
	at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Unknown Source)
	at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
I think this matches to the 2 network shares and the third is failing when sending data to the webUI.

Looking a bit deeper I saw this

Code: Select all

Recursion error: java.nio.file.FileSystemException: \\Server2016\media\$RECYCLE.BIN: The specified network name is no longer available
java.nio.file.FileSystemException: \\Server2016\media\$RECYCLE.BIN: The specified network name is no longer available
	at java.base/sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
	at java.base/sun.nio.fs.WindowsDirectoryStream.<init>(Unknown Source)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.Files.newDirectoryStream(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.visit(Unknown Source)
	at java.base/java.nio.file.FileTreeWalker.next(Unknown Source)
	at java.base/java.nio.file.Files.walkFileTree(Unknown Source)
	at net.pms.util.FileWatcher.addRecursive(FileWatcher.java:136)
	at net.pms.util.FileWatcher.add(FileWatcher.java:89)
	at net.pms.store.MediaScanner.setMediaFileWatchers(MediaScanner.java:558)
	at net.pms.store.MediaScanner.updateSharedContent(MediaScanner.java:75)
	at net.pms.configuration.sharedcontent.SharedContentConfiguration.addListener(SharedContentConfiguration.java:147)
	at net.pms.store.MediaScanner.init(MediaScanner.java:80)
	at net.pms.PMS.init(PMS.java:280)
	at net.pms.PMS.createInstance(PMS.java:1033)
	at net.pms.PMS.main(PMS.java:984)

Is \\Server2016\media\ the one that does not show? I can see file watches on \\WIN10-WKSTN\DVD_SYNC\ so this one must be working.

Code: Select all

DEBUG 2024-06-10 13:55:50.735 [main] Added file watch at \\WIN10-WKSTN\DVD_SYNC\: \\WIN10-WKSTN\\DVD_SYNC\\**
DEBUG 2024-06-10 13:55:50.739 [main] Added file watch at \\WIN10-WKSTN\DVD_SYNC\Active: \\WIN10-WKSTN\\DVD_SYNC\\**
I think the cause of this may be due to a single bug that is also preventing you from selecting the network shares in the WebUI as AFAIK you should be able to add them there.
I'll make an issue on Github for the devs to have a look.
Logs are important for us to help, Please follow This Link before asking for support. Just a forum cleaner, Will help if I can but no expert.
User avatar
SubJunk
Lead Developer
Posts: 3744
Joined: Sun May 27, 2012 4:12 pm

Re: How to address Virtual Folders with SMB network share???

Post by SubJunk »

Thanks for reporting this bug and for all the work debugging :D I think this has been fixed since v14.0.1, can you please try updating to the latest release?
Post Reply