-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Creating a new file from the web interface in an external SMB storage causes all external SMB storages to be unavailable #33115
Comments
The bug is still here after upgrade to 23.0.8. |
This comment was marked as resolved.
This comment was marked as resolved.
Hi, tanks for your reply. I'm now on 24.0.9 version and the bug persists. |
Hi, I can see my subfolders and files of my smb share using the SMB-Test app but after creating a new file in that smb share i can see the same errors in my log as cheneraie mentioned above. My SMB-Test runs into an TimedOutException and i am unable to open my smb shares anymore. Even the "Click to recheck the configuration" button went from green to red. After a few minutes everything is "normal" again.. |
@szaimen Warning | no app in context | OCP\Files\StorageAuthException: Storage unauthorized. / After that i cannot access any of my shares anymore, but the file was created. |
Hi @szaimen, this bug is making NC practically unusable for our business. TL;DR |
Hi @szaimen, Cheers |
I fear I dont have knowledge about this part of the code. If you are an enterprise customer you can speed things up by creating a ticket at support.nextcloud.com |
Hello @icewind1991, we can reproduce this "bug" with a fresh installation of NextCloud and with the NextCloud development version (27.0.0-dev) aswell. If you need further information just tell me. |
Hey @icewind1991, have you already been able to take a look at this Issue? |
Hello @icewind1991 do you have any information for me/us? Cheers |
When trying to get to the bottom of SMB related issues the following details are highly relevant and therefore needed:
Sometimes there are clues on the SMB server side as well in the logs - or with extended logs that can be enabled. For good measure the following are also useful since sometimes they turn out to be relevant:
The TimeoutException gets triggered from not getting a response after waiting 20*1000ms (20s). In case of @cheneraie (I can't speak to the others which may or may not be the same issue) this suggests the underlying libsmbclient and/or libsmbclient-php is timing out when we ask for some extended attributes for the target file from the SMB server. I'm particularly suspicious since this is coming from |
Hello @joshtrichards, thanks for your reply. Nextcloud: 26.0.3 smbclient: 4.18.3 We are using for our external storage our fileserver which is a Windows Server 2016. Our configuration looks like this: After saving or "rechecking the configuration" it states green everytime. It just breaks somehow after we start creating files in that specific share. If you need more just let me know. |
Hey @joshtrichards do you have any updates for me/us? Cheers |
No. Might be worth capturing some more about the SMB transaction from the Windows server-side when reproducing this behavior: |
This issue is still present and reproducable in latest stable 27 |
Hey @joshtrichards, for testing purposes i created a debian virtual machine and configured it as a samba file server. Cheers |
Hello @joshtrichards, I am a co-worker of @pbuchholz123. I managed to capture network traffic from our WindowsServer2016 file server while trying to create a new file in the SMB share through the Nextcloud GUI. I used The SMB share is The file is indeed being created at the desired location, but after a short waiting time the previously mentioned error pops up and the share is disabled for 10 minutes. See .pcapng file attached. Hopefully a big 💡 will light up on your head looking at the packets. |
Hey @joshtrichards any news for us 👉👈 Cheers |
Anyone? |
I can only confirm that the bug is still present in Nextcloud 25.0.12. I've just tested it.
|
I've just tested this by uninstalling php-smbclient. Nextcloud then uses the system's smbclient backend. In this case, the problem no longer appears. But without the php-smbclient module, performance for samba mounts is much lower. |
@cheneraie I guess this certainly narrows down the issue to the package It may be worth to do some research about the behavior of @joshtrichards What is your opinion about it? I'm just trying to think about some possible scenarios behind this extremely annoying bug... |
In our case, SMB mounts are performed from a Windows Server 2016 file server. |
Hello, are there any news/updates? Cheers |
Hi, in the directory: in the file: on line 299 find:
The whole function should look like this:
In my case it helped. The configuration I use:
I noticed that when creating a new file, the connection to the LDAP server is lost. After entering the server, I found information in the antivirus system logs that there was an attempt to exploit the SMB.CVE-2011-1267 security vulnerability and the connection was blocked. In the nextcloud manual, in the SMB section, there is information that the built-in library "smbclient" and the optional php module "libsmbclient-php" which I had installed are used to connect to shares. Analyzing further, I discovered that when creating a file, the system tries to perform the same action of creating a new empty file twice, which is recognized by the systems as a DoS attack described in the above-mentioned security vulnerability. You must remember that this is not an official nextcloud solution and with some updates, the @icewind1991 library will be replaced with the official version, so the changes will no longer work. You can always add a script ;-) When I have some time, I will try to analyze whether it is a problem of the library itself and write to its author, or maybe how the library is used by the nextcloud backend. Let me know if it worked for you. |
Bug description
The attempt to create a file with the "Add file" button in a smb external storage folder causes an error. We get an alert "Unable to create new file from template".
After this, all SMB external storage on the instance are unavalaible ("Storage with mount id ## is not available" or "External storage not available: Storage unauthorized").
The SMB external storage go back after few minutes. And we can see the file was created anyway.
Steps to reproduce
Expected behavior
Just the possibility to create new files without crashing samba mounts.
Installation method
Manual installation
Operating system
Debian/Ubuntu
PHP engine version
PHP 7.4
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
The text was updated successfully, but these errors were encountered: