Can't connect to Windows shares after Windows crash

Hello all,

Apologies in advance for the long message.

I’ve had OSMC running on a Pi 3B for several years now. I use NextPVR to record OTA TV plus I have a collection of movies, videos, and pictures which I’ve set up to access with OSMC. NextPVR is running on a Windows 10 computer and the movies, videos, and pictures are also stored on that computer. I use the NextPVR add-on to access the recorded TV programs and I’ve set up shared folders where I store the other items on the Windows machine.

Last week, my Windows computer “took a dump” and I had to reinstall Windows “fresh”. I’m progressing with getting things back up and running. I’ve reinstalled NextPVR and have it working again with OSMC.

I’m unable to access the other shared files, and that’s why I’m here seeking support from the experts.

After reinstalling Windows, the “server” has the same IP address. The files I want to access via OSMC used to be spread across several different drives with various folder names. I took the opportunity to re-organize the files as I was rebuilding the computer. I now have an external HDD labelled I:\ with shared folders Movies, Videos, and Pictures. I’ve set up a user named “OSMC” with a password on the server and shared these folders with the OSMC user. This user name and password is the same as the ones used before the crash.

When I fire up OSMC, it remembers the movies, videos, and pictures and the locations where they used to be but of course I can’t access them because I’ve changed their location on the server. So, I’ve been trying various ways to “find” them in OSMC. I’ve been unable to do that.

If in OSMC I go to Settings>Media>Library>Videos to manage sources, I see the sources I used to have listed. If I click on any of these, I get the error message “Operation not permitted” followed by “Couldn’t connect to the network server”. I don’t expect to see these files because I’ve reorganized them and the aren’t where they used to be on the server.

So, my next step is to “Add videos…” So, I select Add videos>Browse and I get a list of choices, including smb://, smb://192.168.1.99/, Windows network (SMB), and “Add network location”. (192.168.1.99 is the IP address of my server, the same as before the crash). If I select smb://, I get no response. If I select smb://192.168.1.99/, I get “Operation not permitted”, and if I select Windows network (SMB), I get no response.

I proceed then to “Add network location…”, and enter Windows network (SMB) for the protocol, 192.168.1.99 for the server name, then enter the Username and password I set up for OSMC. I leave the “shared folder” name blank. Then I hit “OK”, whereupon I get an error message “Operation not permitted”, followed by “The connection to the network location couldn’t be established. This could be due to the network not being connected. Would you like to add it anyway?” I give up at this point and select “No”. (Note that NextPVR is happily running and supplying content over the network.)

I wanted to try to remove all my previous sources and try again, but I can’t, because I can’t access the server.

I can’t think of any other options at this point and look forward to any help the group can provide. I appreciate your patience and apologize for this long message. I’m happy to submit logs but I thought I’d check to see if there are any obvious things I’m doing wrong first.

Thanks for any help.

Did you make sure on your Windows box that your network connection was set to “private” and that network discovery was enabled? I’ve gotten hung up on that one a few times moving computers around and having Windows reset to public and disabling discovery and sharing.

As for the Kodi side did

Is ssh not working as well? This would be the way to easily delete the video database, the now useless thumbnails, and potentially passwords.xml. If you wanted to half-ass it the way to mostly clean up the old library would be to videos>files> highlight a source, and then change content and set it to none. You choose the remove from library option when asked. A clean library from the settings screen should remove anything that might be left behind.

Thanks for the quick response.

On the Windows box, the network connection is set to private and it is discoverable.

I haven’t tried ssh but I’m pretty sure it’s working. I’ll climb back up on the Linux command line if I have to, but the last time I did that was awhile back and it will be a steep learning curve to figure it out again. Once I get access to the files, I’ll consider my “clean up” options.

When I go to videos>files and click on a source, I get “Operation not permitted”, so I can’t remove it from the library that way.

You don’t click the source you highlight it and do a context menu action (what button that is depends on how your controlling your device). If the command line is suboptimal you can alternatively install SMB server from the My OSMC add-on and in Windows Explorer do a \\192.168.x.x\osmc\.kodi\userdata in the address bar (but using the actual ip address of your device) and hit enter to get to your Kodi userdata. the “sources.xml” and “passwords.xml” files are going to be what make up your current Kodi sources. In the database folder you will see the various libraries to remove any of those that you want. You will also want to remove the texture13.db database along with the entire thumbnails folder if your removing the library. After doing this you will need to restart Kodi so it can recreate the files you deleted. If it has a fit and locks up just power cycle.

Thanks for the feedback. Just to make sure I understand, I think you’re saying to do a “cleanup” before trying to access my videos, and the recommended approach for that is to delete certain files from …/userdata and restart OSMC, rather than trying to “remove” sources using the OSMC interface (with the context menu). Do I have this right?

I’m guessing that once I delete the files as discussed, I should try again to access the Windows shares.

Am I tracking correctly?

Well that did it! Thanks for your help and patience.

I used the OSMC interface with the context menu to remove everything from the library, then proceeded to delete everything in the Database folder except the CDDB folder. I deleted the Passwords file and the Sources file and rebooted. The server was then accessible and all my shares showed up correctly.

Cool. Just to clarify what I was talking about previously, this idea is this. You changed where your files were stored so the file paths stored in the library/s became broken. Therefore the minimum level of change you would want to make is to get the broken stuff out of your library which can be accomplished a few ways, but the setting the scraper to none takes care of both removing the items from the library and stops Kodi from using that broken source for library updates. This is a pretty good way to go about this type of thing, but there is still metadata that gets left behind which can sometimes cause problems at some point. By deleting entire databases you ensure that there is no old cruft to remove the potential for problems creeping up from there. Removing texturecache13 and the cached thumbnails you free up disk space from files that will never be accessed once you remove the old library. The sources file is just the sources configured in Kodi and removing this file is exactly the same as just deleting all of them from Kodi. The passwords file is probably where your main issue was as there was probably a disparity you didn’t notice between your old share and new. The file replaces file paths with ones that include credentials. Removing this file gave you a clean slate where putting in new sources with new credentials didn’t have any old saved credentials getting used instead.

Thanks very much for the assistance and the detailed explanation. I’ve got another Pi running OSMC that uses the same server, so I’ll test my understanding on that one shortly. :grinning:

All this will serve as a prelude to replacing the server with one that will run Windows 11 before 10 goes out of support in September. I’m going to test my abilities and build a computer for that, and, of course, I’ll have to get OSMC and NextPVR running again after I build it. This exercise helps me to understand what I’ll have to do then.

1 Like