-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMB shares on Windows not working as external storage when using smbclient #30751
Comments
Same problem on Ubuntu 20.04 with
What I don't get is, that the connection is working to another SMB share (created by the institution) but not to a Win10 machine. Difference is, that on the working host with
instead of
which results in the NC connection error. |
Same problem here. NC 24.1 on RHEL 8.5. I was forced to use smbclient instead of libsmbclient because libsmbclient is not compatible with our entreprise class NAS (Dell/EMC Isilon). And finally smbclient works with our Isilon NAS, but does not work with windows server 2012+ ... I would be great if @icewind1991 could provide a real solution. |
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you! My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort! If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+ |
@szaimen - can confirm the issue persists in {
"reqId": "Y9W9tLxGSergDnL49_CWOwAAABE",
"level": 3,
"time": "2023-01-29T00:28:37+00:00",
"remoteAddr": "56.220.245.121",
"user": "FD4D640E-29AA-4B1D-9378-DDBC90F6C642",
"app": "PHP",
"method": "PUT",
"url": "/index.php/apps/files_external/globalstorages/10",
"message": "Undefined array key 1 at /usr/share/webapps/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php#46",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36",
"version": "25.0.3.2",
"exception": {
"Exception": "Error",
"Message": "Undefined array key 1 at /usr/share/webapps/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php#46",
"Code": 0,
"Trace": [
{
"file": "/usr/share/webapps/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php",
"line": 46,
"function": "onError",
"class": "OC\\Log\\ErrorHandler",
"type": "::",
"args": [
2,
"Undefined array key 1",
"/usr/share/webapps/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php",
46
]
}, thats on
with relevant Try "help" to get a list of possible commands.
smb: \> allinfo /
NT_STATUS_INVALID_PARAMETER getting alt name for \
smb: \> allinfo \\
NT_STATUS_INVALID_PARAMETER getting alt name for \\ |
Is there a workaround for this? Just updated from 23 to 24 and got this issue. Have now updated to 25 and the issue still persists. As all our data is on windows SMB shares, it means we can't access anything via Nextcloud. Is the only fix to go back to v23? |
As far as I know this is not a problem that will be solved when you downgrade to v23… |
@ultnrg You could try the php-smbclient approach instead. IIRC that works with NC 24 and I think it should also work with NC 25. Depending on your distribution you might be able to install it via the distribution's package manager or you have to install it from source (https://pecl.php.net/package/smbclient). |
Okay, looks like issue #36773 was what was causing my error. Downgraded libsmbclient and my SMB shares are working again. |
@sempervictus Your issue looks like #36773 |
Can you check if #50284 fixes the problem. If you can't apply the PR on the NC version you're using, you can try replacing |
How to use GitHub
Steps to reproduce
smbclient
-package to attach SMB-shares as external storageExpected behaviour
As a user logged into nextcloud I should be able to access the external storage-mount from the files app (potentially after entering credentials if configured so). When I click onto the share, I should enter the directory on the Windows server's share that I configured as external storage.
Actual behaviour
If I enter the credentials in the external storage's configuration, the status icon at the beginning of the row shows the red exclamation mark, which indicates that the configuration is problematic. If I configure the share s.t. users have to enter credentials, they simply won't be taken into the share but be asked to re-enter the credentials every time they click on it.
The nextcloud log however shows
Icewind\SMB\Exception\Exception: Unknown error (NT_STATUS_OBJECT_NAME_INVALID) for /
. (see below for full excerpt).Description of the underlying issue
nextcloud uses icewind/smb (https://github.com/icewind1991/SMB) to communicate with SMB servers. icewind/smb is a wrapper around either libsmbclient-php or the
smbclient
command line tool if the former is not available. When entering a directory backed by SMB, NC performs a "stat" on the share's root-directory. For the SMB root directory the "stat" translates to asmbclient allinfo
. If thatsmbclient allinfo
fails, icewind retries withsmbclient allinfo .
, which is answered with STATUS_OBJECT_NAME_INVALID by W2k12r2 and W2k19. However that's only part of the issue, because undoing the changes to src/Share.php made in icewind1991/SMB@286024d is not enough. I managed to get thesmbclient
implementation working with these changes: erbth@a2afcac. However it's pretty slow.By the way, I came across this issue because libsmbclient-php, which is usually packaged as php-smbclient by Debian/Ubuntu, is not part of Debian Buster (and recent Ubuntu versions, I think) due to licensing issues. That means one would have to install (and update) it manually or use the version from Debian sid. This motivated me to try the smbclient-approach (and might motivate others ;-)).
Server configuration
Operating system: Debian 11 Bullseye with up-to-date packages
Web server: Apache2
Database: MariaDB
PHP version: 7.4
Nextcloud version: (see Nextcloud admin page) 23.0.0
Updated from an older Nextcloud/ownCloud or fresh install: Updated from an older version
Where did you install Nextcloud from: Originally downloaded zip-archive from nextcloud.com and followed the admin-manual
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: smb
Are you using encryption: no
Are you using an external user-backend, if yes which one: ActiveDirectory
Client configuration
Browser: Firefox ESR 91.5.0
Operating system: Debian 11 Bullseye
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
The text was updated successfully, but these errors were encountered: