Kodi 21. Is the SMB implementation buggy or is it just my system?
#1
Bug 
Hello!

I used Kodi and Windows shared folders (about 30 folders with video files) from my computer a couple years ago without any problems.
Then there was a break (lived in other country) and now I returned and upgraded to Kodi 21 Omega (same devices - Android TV, tablet and PC, same folders with no changes).
But I've run into a strange problem - most of the time I can't open most of my SMB shared folders.

​I have always used a username and password for a Windows user specifically created for sharing.
I can open all shared folders from other Android apps and players (e.g. X-plore) and other devices without any problems, using these credentials.
But when I use Kodi I get an error "Invalid arguments".
And what's weird is that now this happens most of the time, but sometimes almost all folders start to open for a while (like 20 times) but then they won't open again, except for a very few folders that are always the same.
I've tried renaming the problematic folders and giving them a different network name, but that doesn't help.

In Computer Management I also noticed that Kodi starts continuously creating new session for that user with 0 opened files, and sometimes even hangs the Computer Manager.
This does not happen when browsing shared folders using other programs - there is always one session.
Also, by Windows defaults the system has a limit of 20 users per share.
Maybe it's a coincidence, or maybe it's the cause.
Also in Wireshark I see access errors when trying to enter these folders using Kodi (either from Android TV or tablet) and receiving "Invalid arguments" error.
If necessary, I will make a screenshot.
From the tablet sometimes I can't even connect to PC using Kodi, but from TV version I can see folders, at least.
Reply
#2
Some clarification and new information...
It's “Invalid argument” (singular) not “Invalid arguments".
My PC has a static IP, username/password for shared folders are unique (not some system name like "Guest" or something), all rights are assigned to the top folders and inherited correctly.
I've tried all versions of SMB, including v1 - no difference, error is still there.
I've tried clean Kodi installation (including nightly) - no difference.
I tried deleting all the shares and user and creating them again - no difference.

Now for some important information.
I tried experimenting on a completely different computer - at work, using an android emulator with installed Kodi 21.1 (stable).
I made more than 20 shared folders, new user to access them and got the same situation.
When using Kodi to browse the folders, many sessions are still created (I counted 20) and I randomly can't access most of the shared folder anymore ("Invalid argument").
Only here on Android emulator, as well as at home on my Android tablet, I can't open the created path in "Enter files section" (error “Remote share: Network is not connected” with emulator and "Invalid argument" with tablet) and I have to browse folders from "Add videos" (browsing works there for some reason), but on Android TV I can always enter the created path.
I don't yet understand the principle that some folders remain accessible and others no longer work - sometimes access to them changes randomly.
Here is a screenshot of the error from the log (unix_err:'16' error : 'Invalid argument').
Imagehttps://drive.google.com/file/d/1zuc438p...5JtB3/viewImage
Reply
#3
(2024-10-22, 12:53)zern Wrote: error “Remote share: Network is not connected” with emulator

Kodi doesn't work in virtual environments and is not supported in them
 
(2024-10-22, 12:53)zern Wrote: and "Invalid argument" with tablet

this feels more like a windows issue than a kodi one
(2024-10-22, 12:53)zern Wrote: Here is a screenshot of the error from the log (unix_err:'16' error : 'Invalid argument').
https://drive.google.com/file/d/1zuc438p...5JtB3/view

To receive meaningful assistance you will need to provide a full debug log.

The instructions are here... Debug Log

If you are using the Basic Method, then ensure the following is applied...
1.Enable debugging in Settings>System Settings>Logging,
2.Restart Kodi
3.Replicate the problem.
4.Upload the log to Kodi Paste Site manually or use the Kodi Logfile Uploader. (wiki) With either method post the link to the log back here.

If you are using the Advanced Method ensure you have correctly created and applied the advancedsettings.xml file (wiki)

In both instances, you should see the word DEBUG throughout the log.

Note: Full logs only. No partial or redacted logs
Do NOT post your logs directly into the forum. Use the Kodi Paste Site. Post the link to your pasted log in the forum
Reply
#4
(2024-10-22, 15:04)izprtxqkft Wrote: To receive meaningful assistance you will need to provide a full debug log.
Here is the full log - you can see both folders that cannot be opened at the moment and normal ones.
Kodi 21.1 Android TV - SMB bug (Invalid argument)

I also experimented a little bit on PC with emulator and on Android TV.

1. On the emulator I noticed that if you leave the number of shared folders 18 or less, they all open.
In Computer Management it creates N+2 sessions, where N is the number of folders I tried to open, and 2 sessions are created necessarily (I think).
But if you share more folders, you cannot open them - you will get our "Invalid argument" error until these sessions are closed after some time (quite a long time).

2. On the TV with the first browse sessions up to 20 are starts to create.
The folders that can be opened seem to be set in some specific way until I change their total number (or is there some other unknown factor?).

No other Android application behaves like this - only one session is always created.
For example, in X-plore file manager I can always open any shared folder and all video previews will be loaded in a few seconds, still one session is present with multiple opened files.

Here's a screenshot from the Wireshark at the moment I get this "Invalid argument" error.
It looks like the access is denied.
https://drive.google.com/file/d/1zc2dnmm...wc-Byi-vRd
Reply
#5
I also made a log with logging of the SMB component enabled, which will give much more information.
Log is very big, it can't be pasted, so here is my Google link - Kodi 21.1 log with SMB logging.
You can see that Kodi tries to read the whole structure (and much more) when logging in to the PC, creating a bunch of separate sessions.
And when the limit is reached, other connections are no longer allowed, it is written in the log - "SPNEGO login failed: No more connections can be made to this remote computer at this time because the computer has already accepted the maximum number of connections".
In this run, I didn't touch anything for a while after starting Kodi and then tried to enter the "The.Bear.S01.2160p.HULU.WEB-DL.DDP5.1.x265-KOGi%20rartv" folder, receiving "Invalid argument" error, and then closed Kodi.
I suspect that this is wrong behaviour and there should be one session per user.
Once again I remind you that this happens not only on my home PC, but also when testing at work with different PC.
Reply
#6
after seeing your log i will be unable to assist
good news is i'm not the only one around, just wait for the next person
Reply
#7
(2024-10-22, 15:04)izprtxqkft Wrote:
Quote:and "Invalid argument" with tablet
this feels more like a windows issue than a kodi one
This happens because I tried logging in from the TV first and then from the tablet.
But since Kodi on the TV had already filled the entire quota of open Windows sessions for that user, the system wouldn't let me in at all when I tried to browse PC with Kodi from my tablet.
When the sessions expired, it was possible to browse again from the tablet.

I also realized why the folders that can be opened always remain the same - the first folders from the list broadcasted by Windows and read by Kodi can be opened because valid sessions (approximately 18-20) have been created for them.
But for the next folders in the list there are no connections allowed anymore and we get an error.
(2024-10-22, 22:00)izprtxqkft Wrote: after seeing your log i will be unable to assist
good news is i'm not the only one around, just wait for the next person
I hope the experts can figure it out.
Сreated a issue topic on GitHub
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi 21. Is the SMB implementation buggy or is it just my system?0