SMB Connection Issues with Android
#1
Hi all,

I'm stumped.  I've been a Kodi user for well over 10 years and have always managed to figure things out, but I need help on this one.

I'm trying to run Kodi (tried both 18.4 and 18.9) on 2 different Android devices (Google Pixel 2 and Chromecast w Google TV).  I have a Windows 10 media server running a MySQL database to sync my library across all my devices.  I'm able to connect my other computers running Windows 10 to the server with no issues, but I'm having some problems with my Android devices.  When I go into File Manager, I'm able to create an SMB connection to my media server and add it as a source.  When I use File Manager to browse to my media server I'm able to access my files and play videos with no issues.  When I copy in my advancedsettings.xml file into my UserData folder it populates my library and shows all of my shows in progress, etc.  However if I try to play any of the media in my library it does nothing.  In the log file I see :

 ERROR: SMBDirectory->GetDirectory: Unable to open directory

Full log file here: https://paste.kodi.tv/pedeyaxuma.kodi

I'm not sure why its not able to open the SMB directory when it I can open it through File Manager.  Has anyone seen this?  Help!

Thanks,
Mike
Reply
#2
When did you start using MySQL 8.0..? Because you have some issues as well there.
sql:
2021-05-09 22:36:02.053 T:24278 ERROR: SQL: [MyMusic72] The table does not exist
Query: select count(idSong) as NumSongs from songview
2021-05-09 22:36:02.070 T:24278 ERROR: GetSongsCount() failed

Also there is a cache fix for MySQL v8.0, floating around somewhere on the forum (It's Monday morning, and I still need to get my 1st cup of coffee), that should solve this problem:
Code:
ERROR: SQL: Missing result set!

(2021-05-10, 06:41)mike_the_man Wrote: ERROR: SMBDirectory->GetDirectory: Unable to open directory

At some point all Kodi users with SMBv1 connections will encounter this problem. Microsoft's SMBv2 has fortified security, so the Windows user for the SMB share will now require a password. Also, currently, network browsing is disabled, but a workaround fpr that is in the making AFAIK.
Reply
#3
Thanks Klojum,

I noticed those SQL errors. I'll try and track down the fix.

When you say Network Browsing is disabled, what does this affect in Kodi? Is that what is causing my issue? I assume this is an issue with Android and SMB shares? Everything works fine from my Kodi boxes running Windows 10.

Cheers,
Mike
Reply
#4
(2021-05-10, 15:33)mike_the_man Wrote: When you say Network Browsing is disabled, what does this affect in Kodi?

It means the network's Browse functonality is not working. Adding SMB sources will need to be done manually. FYI: Kodi v19.1 was released today, along with "Added: support for WS-Discovery protocol that enables locating SMB servers and browsing shared folders using SMBv3." This is for Windows clients only. And mind the version there... Not 2 but 3.

You also may have to drop the current Music (72) database when one or more tables are not existing as written in the log file.
Reply
#5
(2021-05-10, 16:37)Klojum Wrote:
(2021-05-10, 15:33)mike_the_man Wrote: When you say Network Browsing is disabled, what does this affect in Kodi?

It means the network's Browse functonality is not working. Adding SMB sources will need to be done manually. FYI: Kodi v19.1 was released today, along with "Added: support for WS-Discovery protocol that enables locating SMB servers and browsing shared folders using SMBv3." This is for Windows clients only. And mind the version there... Not 2 but 3.

You also may have to drop the current Music (72) database when one or more tables are not existing as written in the log file.
Gotcha, I don't think browsing is my issue.  I'm able to manually add my SMB source.  It connects fine, and in File Manager I'm able to browse to the media server and play videos.  But for some reason when I try to play a video from my library it gives me the ERROR: SMBDirectory->GetDirectory: Unable to open directory.  I have SMBv3 enabled as the max version in Kodi, so I don't think thats the issue?  It's the fact that I'm able to play files through File Manager in Kodi, but not able to play them from my library that really has me stumped.

Cheers,
Mike
Reply
#6
Create a new folder on the server, move some videos into it, add as a new source, then scan to Library and see if you can then play them. If they play then it's possible something is wrong with the database for the exisitng items. Once test is complete you can remove the newly added source then select yes to remove items from Library (this is only the items in Library for that newly added source).
Reply
#7
Thanks jjd-uk, I did some more testing last night that is very similar to your suggestion and I think I'm starting to narrow down the issue.  I removed my AdvancedSettings.xml and manually added my Movies directory using my previously created SMB source.  I let it scan for a few minutes to add a few movies, and they were all able to play with no issues.  However, when I copy my AdvancedSettings.xml back into the UserData directory I'm not longer able to play movies.  This is the same AdvancedSettings.xml file I'm using on my Windows computers and they all connect and play from the media server fine.  Is there anything special required for Android in the AdvancedSettings.xml file?  I'm fairly sure this is not an SMB issue, but something to do with either my MySQL database or my advancedsettings.

Here is what I have in my AdvancedSettings:

<advancedsettings>
    <videodatabase>
        <type>mysql</type>
        <host>192.168.0.190</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
    </videodatabase> 

    <musicdatabase>
        <type>mysql</type>
        <host>192.168.0.190</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>xbmc</pass>
   </musicdatabase>

    <videolibrary>
          <exportautothumbs>true</exportautothumbs>
          <importwatchedstate>true</importwatchedstate>
          <importresumepoint>true</importresumepoint>
     </videolibrary>
    <network>
          <buffermode>1</buffermode>
      <readbufferfactor>2</readbufferfactor>
      <cachemembuffersize>157286400</cachemembuffersize>
    </network>
</advancedsettings>

Thanks for all the help!

Mike
Reply
#8
I assume when you removed the AdvancedSettings.xml Kodi went back to using a local sqllite database, so what you really need to do is add new new movies from a new source (I suggest a new source to make it easy to remove items from library and thus the database without impacting anything else) to the mysql database to test whether that is working with new items. It that works with new items then you probably need to compare the paths stored in the DB between the new items and exisitng items.
Reply
#9
(2021-05-11, 17:40)jjd-uk Wrote: I assume when you removed the AdvancedSettings.xml Kodi went back to using a local sqllite database, so what you really need to do is add new new movies from a new source (I suggest a new source to make it easy to remove items from library and thus the database without impacting anything else) to the mysql database to test whether that is working with new items. It that works with new items then you probably need to compare the paths stored in the DB between the new items and exisitng items.

Ahh yes, that makes sense.  Great suggestion.  I'll give it a try tonight.

Thanks,
Mike
Reply
#10
Hi all,

I just wanted to give everyone an update that I was able to solve the issue over the weekend.  I upgraded to version 19 and found I was still getting an error, but it was a much more useful error message.  It was an 'Invalid Path' error.  Even though I had used IP addresses for all of my connections, Kodi was still looking for the server name.  I ran a query on the DB and found that the path was saved in the DB (which totally makes sense) using the server name.  I exported my library then dropped the DBs.  When I restarted Kodi it built new DBs, then I imported the library back in and all is working as expected.  The only issue is that my TV Shows library didn't import correctly and I've lost all of my Watched checks.  Along those lines, when you do a Library Export, where is the file saved?  Or what exactly happens during an export?

Thanks,
Mike
Reply
#11
(2021-05-17, 21:06)mike_the_man Wrote: The only issue is that my TV Shows library didn't import correctly and I've lost all of my Watched checks

Watched status is not imported again by default.  You have to create an advancedsettings.xml (wiki) file with a setting in it to import the watched status.  See https://kodi.wiki/view/Import-export_library/Video which answers your other questions.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
SMB Connection Issues with Android0