Jovian Almada's picture

Hello, has anyone experienced an issue where you're able to setup the SMB share and get as far as the authentication and it says "credentials saved" but never actually logs in? It just gives an endless loop of logins? Any info on this would be helpful.

Jovian Almada's picture

A little more detail, the appliance straight out of the setup has everything functional.. I just need to enable external storage... the smbclient is already installed... I can setup an administrative, read only, share that requires a one time authentication to allow viewing of documents. (example: policies) but when I log in to NextCloud as a ldap user or even local... if I click the share (highlighted in pink or red) it prompts for credentials (this is normal behavior) but once it says "credentials saved" it never opens the folder, it just remains highlighted in pink or red. If I click again, it prompts for credentials again, once entered.. it says "credentials saved" again.. and still doesn't allow me to login.


Jeremy Davis's picture

You note that you have installed smbclient, but didn't clarify whether you've installed the commandline client (i.e. via apt) or whether you've installed the php extension (via pecl)?

If it's the latter, then I'd personally probably install the comandline client too. Then either way, I suggest testing connecting to the SMB share via the commandline to see if that works. If the issue is the connection, then hoppefully that may give a more explicit error message?!

Actually, I just did a quick google and found this Nextcloud bug report. Perhaps you are using a version affected by that bug? Perhaps try updating Nextcloud to the latest version?

Jovian Almada's picture

Hopefully this helps someone in the future.. the smbclient was installed out of the box and technically all that's "needed" according to NextCloud.. but I did also install php-smbclient in hopes it would work. It did not.

Connecting through command line works fine, but it always has, leaving me to assume it's something within NextCloud somewhere. Something missing? 

I checked the bug report and checked the SMB.php and the fix was already in place. 

SO my resolution is this... and maybe the better route... it seems in the many places I've read that SMB is just not the preferred or recommended way to be using shared storage anyway. It's an old setup but being convenient and lazy will probably not yield the best results as we move forward ANYWAY.. so we'll likely use the network storage WebDAV features and go that route. I know this isn't really a fix, but in total I've put about a month into the research on this with mixed results and varying levels of functionality from super slow to completely broken.. and I think it's a sign.

Jeremy Davis's picture

Thanks for sharing your research, experience and your workaround. I'm sure it will be useful for others. I agree that SMB is probably not the ideal protocol to use. Because there are a variety of versions available (and not all completely and publicly documented), unless it's between Linux computers using the same version of Samba (and the same version of SMB) or obviously Windows computers (using the same version of SMB) in my experience, it can give quite unreliable results.

IMO SMB is a "messy" protocol, with numerous "dialects" and/or versions. And whilst it was initially developed by IBM, I'm pretty sure Microsoft's implementation is not completely "open". Despite Microsoft being forced to publicly document aspects of it by the EU, AFAIK there is still a degree of reverse engineering involved in Samba's support for it.

It's possibly also worth noting, that current versions of Windows (i.e. Windows 10 and Windows Server 2016) default to using SMBv3.1.1. AFAIK Samba currently only fully implements SMBv3.0.0 (with some limited support for later versions). I did try to find confirmation of that and I certainly recall reading about it somewhere, but I can't find it right now...

Add new comment