Open wioch opened 1 year ago
Try downgrade to libsmbclient-4.17.2 as discribed here solved it for me.
# dnf downgrade libsmbclient-4.17.2 --allowerasing
# systemctl restart php-fpm.service
Downgraded to 4.17.1, SMB shares are now working, Thank you ! But still, it is a WoA, not solution (I may not remember to exclude samba from next update run).
I also had problems with smbclient library in the past with Nextcloud. Funny thing is, that removing php-smbclient library package made it work correctly for me those days (i was using RockyLinux/RHEL 8). I was trying to figure this out, but diagnosing libraries is very hard, and i didn't see any interest in that from anyone.
Downgrading client libraries is probably not an option in corporate environments where patch levels have to be maintained at current (or at least "not flagging as being vulnerable to high or critical severity concerns") versions.
Is this due to the recent CIFS machinations by Microsoft, something in Samba, or some interaction between recent Samba changes and the PHP API?
As I've mentioned, it is workaround, not solution. Either way, with lib-smbclient:
Problem is probably because of the getxattr behaviour change in 4.17.5. See the release notes on the samba site: https://www.samba.org/samba/history/samba-4.17.5.html
Following the trail, looks like return codes were corrected: https://bugzilla.samba.org/show_bug.cgi?id=14808
Reached out to the committer listed atop that changelog, and according to him, the callers will need to be updated:
I'm afraid the code change was correct. The spec says the smbc_getxattr() call should return 0 on success, -1 on error.
The callers are going to have to be fixed, sorry.
Have to report the same issue un Ubuntu 20.04 (Samba 4.17.5) too. Downgrade to 4.13.x did not solve the problem :-(
Have to report the same issue un Ubuntu 20.04 (Samba 4.17.5) too. Downgrade to 4.13.x did not solve the problem :-(
I did downgrade to Samba 4.13.13+dfsg-1~deb11u5 on Devuan (Debian 11) over the weekend (needed to move more than 512MB, see nextcloud bug #31308 ) and I got my system working again. Though I do need 4.17 for SMBMultichannel, but I can live without the Multichannel for now. Perhaps you should recompile phpsmbclient: https://www.server-world.info/en/note?os=Debian_11&p=nextcloud&f=11
@Ryushin
sudo aptitude install smbclient=2:4.13.17~dfsg-0ubuntu1.20.04.5
solved the problem, thx
Edit: Same problem after rebooting the server. So I decided to go back to current SAMBA version and live with the bug at the moment.
Downgrading Samba to older versions isn't a viable approach - commercial environments often do not permit running anything but the latest stable and no environment should be running any version with a publicly known CVE against it (at that point, you're not "getting hacked," you're being pwned by script kiddies for your own reticence to keep up-to-date). Since upstream made this significant change with no compatibility flag options available to retain old behavior, it seems the only thing to do is update all SMB client bindings to the new modality and hope they never run against the old one.
Hi, I thing the problem not is smbclient because using shell command work fine. smbclient -U usuario%senha //ipserver/share get bigfile.tar ok
Ok... solved it for the moment.
Hi, I thing the problem not is smbclient because using shell command work fine. smbclient -U usuario%senha //ipserver/share get bigfile.tar ok
Thats a GET
verb, wont show you all of the attributes (or lack thereof) in the response, just gets a data stream. Try to list directories with lots of stuff in them - more likely to trip over the concern.
The patch from @BenzinoNapoloni appears to work in my testing as well, hopefully it gets merged upstream and becomes part of libsmbclient-php
. In the meantime, everyone will just have to rebuild their package of it as supported PHP versions increase.
Ok... solved it for the moment.
- apt remove php8.1-smbclient -y
- git clone git://github.com/eduardok/libsmbclient-php.git
- apt install php8.1-dev -y
- cd libsmbclient-php
- edit smbclient.c (enable this patch https://github.com/eduardok/libsmbclient-php/files/10843385/smbclient.patch.txt )
- phpize
- ./configure
- make
- make test
- make install
- echo 'extension="smbclient.so"' >> /etc/php/8.1/fpm/php.ini
- service php8.1-fpm restart
Ok I try and work. Thanks
Thanks for testing @sempervictus, @makabar and @wellington1979!
I've created a fork with the patch on a branch and a PR to the original repo. Maybe it get's merged - let's wait an see for the moment.
Further tests welcome!
Did anybody try the PR of remi? Seems more mature than the fix mentioned here - and is there since february 2022 I REALLY don't think there is any chance it's going to be fixed in the libsmbclient-php repo of @eduardok
from remi: https://github.com/eduardok/libsmbclient-php/pull/96 commit discussed here: https://github.com/eduardok/libsmbclient-php/pull/99
forget my question - it addressed another issue but the fact even this isn't merged yet is a clear indicator for a dead package/git
Notice:
@wioch
As for Fedora update, there were minor updates. Example of version update for selected packages: php: from 8.1.13-1.fc37 to 8.1.15-1.fc37 httpd: from 2.4.54-5.fc37 to 2.4.55-1.fc37 samba: from 4.17.4-2.fc37 to 4.17.5-0.fc37
As your report was about Fedora 37, you can try php-smbclient-1.1.0-1.fc37 from testing repository.
So, as I'm not sure I understand, will this be fixed when the Nextcloud team integrates a patched php smbclient (which I assume depends on the respective php maintainer) or?
Also, I don't think this is linked with the smbclient. The Nextcloud container I use is built on alpine and has this version {libsmbclient-4.16.10-r0 x86_64 {samba} (GPL-3.0-or-later LGPL-3.0-or-later) [installed]}. Works just fine and connects to the SMB share, it's only in Nextcloud that it doesn't work.
Maybe worth mentioning, for me everything was fine on 25.0.4, it's when I updated to 25.0.5 where SMB shares stopped working. Am now on 26.0.0 and, well, obviously, it's not fixed either.
So, as I'm not sure I understand, will this be fixed when the Nextcloud team integrates a patched php smbclient (which I assume depends on the respective php maintainer) or?
It is not dependent on nextcloud, but on the version of smbclient that is used.
You don't need to wait for the maintainer. You only have to wait for a new release of smbclient.
If it is finally released, you can install it with pecl
pecl install smbclient
You should remove the manintainer packages first, if they are installed.
Updated NC to 26.0.1. Samba mounts:
@wioch Did you also update your php-smbclient? Looks like Fedora now has the latest:
https://packages.fedoraproject.org/pkgs/php-smbclient/php-smbclient/
@razvansarbu You probably only notice it with NC because it's an interaction between the PHP SMB extension and Samba's underlying libsmbclient due to a change in behavior of the latter. So unless you're using other PHP based apps to access SMB shares it's unnoticeable. Neither the PHP extension or the underlying library are provided by Nextcloud. They're dependencies the user must provide either via their OS package management or some other means.
I have php-smbclient updated latest version.
The libsmbclient needed to be downgraded for NC to work correctly with SMB mounts.
php-smbclient.x86_64 1.1.1-1.fc37
libsmbclient.x86_64 2:4.17.1-1.fc37
It's seems - that the BUG is still existing.
Bug description
Error on NC 28 Undefined array key 1 at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php#46
"reqId": "F6pzdrukiTlbi0cE2PVY", "level": 3, "time": "2024-01-04T10:51:17+00:00", "remoteAddr": "---", "user": "---", "app": "PHP", "method": "PUT", "url": "/apps/files_external/userstorages/8", "message": "Undefined array key 1 at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php#46", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0", "version": "28.0.1.1", "data": { "app": "PHP" }, "id": "659727d5e0a34" }
Steps to reproduce
Note Sure
Expected behavior
Not Sure
Installation method
Community Manual installation with Archive
Nextcloud Server version
28.0.1
Operating system
Ubuntu 23.04 as LXC Container in Proxmox
PHP engine version
PHP 8.1
Web server
nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
this bug exist after fresh-install with + migration from old version
I have to config memcache and redis - but this thing i have not allready done, because i don't know how to do this.
My Config file
<?php
$CONFIG = array (
'instanceid' => 'occ---',
'passwordsalt' => 'c81f82---',
'secret' => '5df3917eb8e--->
'trusted_domains' =>
array (
0 => 'nxcloud.---.--',
1 => '10.0.---',
2 => 'localhost',
),
'trusted_proxies' =>
array (
0 => '10.0.---',
),
'datadirectory' => '/var/www/nextcloud/data',
'dbtype' => 'mysql',
'version' => '28.0.1.1',
'overwrite.cli.url' => 'http://localhost',
'dbname' => '---',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => '---',
'dbpassword' => '---',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 2,
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mail_sendmailmode' => 'smtp',
'mail_from_address' => 'Info',
'mail_domain' => '---',
'mail_smtpauthtype' => 'PLAIN',
'mail_smtpauth' => 1,
'mail_smtphost' => '---',
'mail_smtpname' => '---',
'mail_smtppassword' => '---',
'mail_smtpport' => '---',
'app_install_overwrite' =>
array (
0 => 'riotchat',
),
);
libsmbclient 2:4.17.7+dfsg-1ubuntu2.3
Nextcloud 28.0.1
LXC Container under Proxmox Running Ubuntu 23.04 Linux 5.15.116-1-pve x86_64
nginx/1.22.0 php 8.1.12
⚠️ This issue respects the following points: ⚠️
Bug description
After update to NC 25.0.3 (from 25.0.2) and after maintenance system update (Fedora 37) external Samba shares stopped working and cannot be mounted. SMB shares are marked with red exclamation mark.
As for Fedora update, there were minor updates. Example of version update for selected packages: php: from 8.1.13-1.fc37 to 8.1.15-1.fc37 httpd: from 2.4.54-5.fc37 to 2.4.55-1.fc37 samba: from 4.17.4-2.fc37 to 4.17.5-0.fc37
Steps I've taken to troubleshoot:
Preliminary conclusion: Linux update brought something that may not be compatible with Icewind app for SMB support.
Steps to reproduce
Expected behavior
Every Samba share working correctly after both NC update and OS update.
Installation method
Community Web installer on a VPS or web space
Operating system
RHEL/CentOS
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
MySQL
Is this bug present after an update or on a fresh install?
Updated from a minor version (ex. 22.2.3 to 22.2.4)
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