Error: "Invalid argument" when trying to add a network share as a media source

Unfortunately before any kind of comparison can be made I should get over the following meassage I keep getting when executing the first line:
"
osmc@osmc:~$ smbclient -N //192.168.1.64/F/
Unable to initialize messaging context
Try “help” to get a list of possible commands.
smb: >
"

This means you are connected. You then e.g. could run dir to show the directory. To get out there just type exit and press enter

It seems to me that both drives are accessible:
osmc@osmc:~$ smbclient -N //192.168.1.64/F/
Unable to initialize messaging context
Try “help” to get a list of possible commands.
smb: > exit

osmc@osmc:~$ smbclient -N //192.168.1.64/I/
Unable to initialize messaging context
Try “help” to get a list of possible commands.
smb: >

So running dir when you connect to I also shows you the respective directory listing?

Yep.
"
smb: > dir
$RECYCLE.BIN DHS 0 Tue Nov 16 06:19:18 2021
.apdisk AH 287 Thu Nov 18 01:08:14 2021
.DS_Store AH 8196 Thu Nov 18 01:40:30 2021
Movies D 0 Sun Nov 7 10:21:01 2021
Other D 0 Sat Oct 30 08:54:18 2021
System Volume Information DHS 0 Mon Nov 15 21:47:30 2021
488378417 blocks of size 4096. 86325361 blocks available
smb: >"

Yet no luck when trying to add it as a media source over OSMC gui, for I still get that “Invalid argument” error meassage with I’’, whereas with ‘F’ for instance no problem at all. Quite strange, is not it?
If I share instead of the whole drive only the ‘I/Movies’ dir - which is a generally suggested sharing method - that won’t help either for the error message remains the same.

True, not sure about the Kodi SMB approach.
You could enable SMB Component specific logging to check if you then see anything.
While personally I still believe using kernel mounts is much more stable than using Kodi SMB capabilities

If Kodi uses a different user or SMB communication method, that could explain a lot, but I know nothing about that. Mind you I installed Kodi on my HTPC too and for testing reasons I added my media sources into that Kodi as network shares not as local drives (just to make sure I create an enviroment similar to that on my OSMC).
As a matter of fact that Kodi has no problem when adding those problematic drives as media sources. But that is the very same PC on which those drives are mounted and it is a Kodi for a windows OS.
I would have changed my sharing method long ago had it helped, but I’m afraid the problem with those two drives still remained when coming from Kodi on my Vero.

I believe that if you don’t supply other credentials then it uses “guest” which means that you will need both the file share and (assuming your using a NTFS formatted drive) for the drive itself. Since it looks like you have access to the share then I would circle back to what I posted above about going through the properties and seeing what Windows reports as the file permissions are. You only stated earlier that you took ownership of the files. That by itself AFAIK does not actually change any permissions, other than gaining the ability to change permissions.

You might also check this out to see if you find something helpful there…

Yesterday I was in a hurry so I made some stupid simplifications, the “took ownership …” was one of them. I should have written: I strictly followed the instructions available for this type of procedures over the internet.

Let me just explain what the situation is at my HTPC.
Each and every drive connected to it are set the very same way in respect of both SMB share permissions and NTFS rights and ownership.
Each drive has three (user) groups from the advance security settings point of view. i.e. ‘Admininstrators’, ‘SYSTEM’ and ‘Everyone’. All the 3 groups are given full NTSF access rights (modify etc).

As for SMB share permissions are concerned, settings are all the same on each drive i.e. there is only one group entitled to have full access to them: ‘Everyone’. No other group is given any kind of share permission whatsoever.

By now it might have been clear that each of my 8 drives that contain media files can be accessed anonymously from any PC or laptop on my home network without any hussle which may suggest that I have made proper settings for this type of file sharing.

My only problem - which slowly starts driving me crazy - is that when I want to access these drives from my Vero 4K+, only 6 are useable, 2 of them (‘I’ and ‘K’) are inaccessible, at least from the Kodi Gui of my unit. Those two drives are still available from anywhere else in my network, what’s more I could ssh them in the name of my OSMC as it has been proved a couple of comments earlier.

A few minutes ago I gave a try to “guest” user, providing it with all the neccessary credentials in Windows at those two drives. Guess what happened? The same old error message on the Kodi GUI when trying to access them …

As for anonymous access I have messed around so many times with the proper settings, that by now I know the course of action by heart. From the link you were kind enough to provide and for which once again thank you, I have allways followed the first one for I never heard of the second one. Mind you the second seems to me a better solution for it does not reqiure changing registry settings.

So may be that type of settins are my only chance to have things working again, for you must understand: before that stupid Windows reinstall every drive worked like a charm even on my Vero 4K+.

A little addendum which may help put pieces togehter. At the time of the above mentioned Windows reinstall I have committed two silly errors.

Once OS reinstall and initial windows settings successfully concluded, I started to connect my external drives. But instead of putting them back one by one in an order so that windows could allocate the proper letter to each I connected them at once. It would not have been windows had it assigned previously used letters to all the 8 drives. 6 got proper letters, 2 not.
Yes, your guess is right: letters of the 2 drives for which this ticket has been created were mismatched. I immediately corrected the problem manually assigning the adequate drive letters and everything seemed OK.

Up untill the moment I realized that I forgot to switch off my poor Vero 4K+, that was online all the time of the whole manoeuvre and as an obedient working force never stopped looking for changes on my drives (error number 2). A switch-off or offline operation or scan disabling could have help to avoid serious consequences.

As it came pretty soon clear those two mystakes alltogehter proved to be lethal and most certainly resulted some confusion either in Kodi/OSMC database or somewhere in the system section of the drives effected. That type of mismatch is the only reasonable explanation of the present situation.

Now that I have made a clean install on my Vero 4K+, which as long as I understood consists of a reflash of the memory and/or reformatting the internal storage, plus an explicit reset for the Kodi settings using the appropriate GUI command gives me the impression that the corrupted data can not be inside my Vero, instead it should be seated somewhere in the non-user writable section of the two drives. Presumably reformatting the drives would be a definit remedy but that type of medicine is out of the question so far because it would be very much complicated to copy all the contents, not to mention the quantity of time it would require.

i have read somewhere in this forum that even a clean install could leave some fingerprints or remnants in Vero 4K+ I just could not find neither that post nor any implication of that in my unit. Circle closed.

Did you reboot Windows after reassigning the drive letters? I think things can get a bit weird accessing the drives in certain instances before a reboot happens. As far as Kodi is concerned if you want to make sure nothing is left from this incident you don’t have to do a full reinstall. Unless you manually did something of import in the OS you can get to a clean state just by…

systemctl stop mediacenter
rm -r ~/.kodi
systemctl start mediacenter

"Did you reboot Windows after reassigning the drive letters? "
I rebooted windows several times on that day, only I do not remember how many minutes passed away when I first rebooted once drive letters were manually assigned.

Does the script cited by you remove or clear mySQL DB under Kodi too? I guess yes, just wannabe sure.
Say I have imported some media information using the appropriate function for that in Kodi … would that make any difference or an explanation to my problem?

No, it will remove the SQLite dbs but if someone is using a MySQL db then they would have to either manually drop the db or else change the name tag. I don’t see in the logs you uploaded that you are using a MySQL db though.

If you had a library setup and the file paths changed then that would be an issue in library view. If you had passwords coded in a file path, entries in passwords.xml or mediasources.xml and they changed then this could pose an issue. I don’t think you have anything like that currently as I understand from the posts in this thread.

My library is definitely empty, there are no sources, no file paths, no passwords etc.
But here is a list of my Database, which seems to me anything but empty, although I put nothing into it once clean install took place
osmc@osmc:~/.kodi/userdata/Database$ ls -al
total 1844
drwxr-xr-x 3 osmc osmc 4096 Nov 18 03:06 .
drwxr-xr-x 10 osmc osmc 4096 Nov 17 16:49
-rw-r–r-- 1 osmc osmc 1138688 Nov 17 18:51 Addons33.db
drwxr-xr-x 2 osmc osmc 4096 Nov 16 18:51 CDDB
-rw-r–r-- 1 osmc osmc 28672 Nov 16 18:51 Epg13.db
-rw-r–r-- 1 osmc osmc 225280 Nov 16 18:51 MyMusic82.db
-rw-r–r-- 1 osmc osmc 376832 Nov 16 18:51 MyVideos119.db
-rw-r–r-- 1 osmc osmc 49152 Nov 16 18:51 TV38.db
-rw-r–r-- 1 osmc osmc 36864 Nov 18 03:06 Textures13.db
-rw-r–r-- 1 osmc osmc 20480 Nov 16 18:51 ViewModes6.db

What if some corrupt data lying in these sections are in charge of all my misery?
I cannot see what is under the above view, all I know is that presumably I won’t need any of these data, for I will build up a new DB anyway once I start adding my sources.
Shall I drop manually this db?
If so, than how can I do that?
No problem if I have to reinstall OSMC and the like as it requires very little time.

These are SQLite and you can just delete them, or the entire .kodi folder. When Kodi restarts it will just generate new default data. There would be no pertinent information in your setup that would be left behind if you deleted the entirety of your .kodi folder and you would gain nothing from a total system reinstall over just running the commands I posted above.

As for something in Kodi being the reason why you can’t access these shares, I just can’t picture a scenario in my head on how that could be true in this case. Did you ever run the command to find what Windows was listing for effective file permissions for those two shares?

“Did you ever run the command to find what Windows was listing for effective file permissions for those two shares?”
Nope. How can I do that?

(I migrated all the files from those two drives, formatted them NTSF, then FAT32 then back to NTSF, plugged, unplugged, switched ownership around, removed recycle bins corrupted, changed volume physical id … still no luck, same old error meassge, only from Vero 4K+.
I have run out of ideas.