Skip to content
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

[Bug]: SMB shares stopped mounting in NC25.0.3 after Fedora 37 update #36773

Open
6 of 9 tasks
wioch opened this issue Feb 18, 2023 · 30 comments
Open
6 of 9 tasks

[Bug]: SMB shares stopped mounting in NC25.0.3 after Fedora 37 update #36773

wioch opened this issue Feb 18, 2023 · 30 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: external storage

Comments

@wioch
Copy link

wioch commented Feb 18, 2023

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

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:

  • disable/enable SELinux - no improvement
  • mounted shares via smbclient from linux console - shares are working correctly
  • deploy fresh NC 25.0.2 and 25.0.3 - same issue with SMB shares
  • checked NativeFileInfo.php on both NC 25.0.2 and 25.0.3, file is exactly the same

Preliminary conclusion: Linux update brought something that may not be compatible with Icewind app for SMB support.

Steps to reproduce

  1. Update Nextcloud from 25.0.2 to 25.0.3 via web installer
  2. Maintenance Fedora 37 update, followed by reboot
  3. External Samba shares not working anymore

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?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.domain.local"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.3.2",
        "overwrite.cli.url": "https:\/\/cloud.domain.local",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "updater.release.channel": "stable",
        "default_phone_region": "PL",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***"
    }
}

List of activated Apps

Enabled:
  - admin_audit: 1.15.0
  - bruteforcesettings: 2.5.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - contactsinteraction: 1.6.0
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - files: 1.20.1
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - support: 1.8.0
  - survey_client: 1.13.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - twofactor_totp: 7.0.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - activity: 2.13.1
  - calendar: 4.2.3
  - comments: 1.10.0
  - contacts: 5.1.0
  - dashboard: 7.0.0
  - encryption
  - federation: 1.10.1
  - recommendations: 1.4.0
  - suspicious_login
  - systemtags: 1.10.0
  - user_ldap
  - weather_status: 1.0.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

[PHP] Error: Error: Undefined array key 1 at /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php#46 at <<closure>>

 0. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php line 46
    OC\Log\ErrorHandler::onError(2, "Undefined array key 1", "/datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php", 46)
 1. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php line 69
    Icewind\SMB\Native\NativeFileInfo->stat()
 2. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php line 114
    Icewind\SMB\Native\NativeFileInfo->getSize()
 3. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 191
    Icewind\SMB\Native\NativeShare->stat("/")
 4. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 348
    OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")
 5. /datashare/html/domain.local/nextcloud_nc21/lib/private/Files/Storage/Common.php line 462
    OCA\Files_External\Lib\Storage\SMB->stat("")
 6. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 729
    OC\Files\Storage\Common->test()
 7. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/MountConfig.php line 131
    OCA\Files_External\Lib\Storage\SMB->test("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 8. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Controller/StoragesController.php line 288
    OCA\Files_External\MountConfig::getBackendStatus("*** sensitive parameters replaced ***")
 9. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Controller/UserGlobalStoragesController.php line 126
    OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensitive parameters replaced ***")
10. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Files_External\Controller\UserGlobalStoragesController->show(8, "*** sensitive parameters replaced ***")
11. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Extern ... {}, "show")
12. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Extern ... {}, "show")
13. /datashare/html/domain.local/nextcloud_nc21/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main("OCA\\Files_Exte ... r", "show", OC\AppFramework\ ... {}, ["8","files_exte ... "])
14. /datashare/html/domain.local/nextcloud_nc21/lib/base.php line 1047
    OC\Route\Router->match("/apps/files_ext ... 8")
15. /datashare/html/domain.local/nextcloud_nc21/index.php line 36
    OC::handleRequest()

GET /index.php/apps/files_external/userglobalstorages/8?testOnly=false
from 10.3.1.99 by root at 2023-02-17T18:37:49+00:00


[no app in context] Warning: Icewind\SMB\Exception\Exception: Invalid attribute response at <<closure>>

 0. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php line 69
    Icewind\SMB\Native\NativeFileInfo->stat()
 1. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php line 114
    Icewind\SMB\Native\NativeFileInfo->getSize()
 2. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 191
    Icewind\SMB\Native\NativeShare->stat("/")
 3. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 348
    OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")
 4. /datashare/html/domain.local/nextcloud_nc21/lib/private/Files/Storage/Common.php line 462
    OCA\Files_External\Lib\Storage\SMB->stat("")
 5. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Lib/Storage/SMB.php line 729
    OC\Files\Storage\Common->test()
 6. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/MountConfig.php line 131
    OCA\Files_External\Lib\Storage\SMB->test("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 7. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Controller/StoragesController.php line 288
    OCA\Files_External\MountConfig::getBackendStatus("*** sensitive parameters replaced ***")
 8. /datashare/html/domain.local/nextcloud_nc21/apps/files_external/lib/Controller/GlobalStoragesController.php line 201
    OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensitive parameters replaced ***")
 9. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Files_External\Controller\GlobalStoragesController->update("*** sensitive parameters replaced ***")
10. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Extern ... {}, "update")
11. /datashare/html/domain.local/nextcloud_nc21/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Extern ... {}, "update")
12. /datashare/html/domain.local/nextcloud_nc21/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main("OCA\\Files_Exte ... r", "update", OC\AppFramework\ ... {}, ["8","files_exte ... "])
13. /datashare/html/domain.local/nextcloud_nc21/lib/base.php line 1047
    OC\Route\Router->match("/apps/files_external/globalstorages/8")
14. /datashare/html/domain.local/nextcloud_nc21/index.php line 36
    OC::handleRequest()

PUT /index.php/apps/files_external/globalstorages/8
from 10.3.1.99 by root at 2023-02-17T18:56:18+00:00


[webdav] Error: Sabre\DAV\Exception\ServiceUnavailable: Storage with mount id 7 is not available at <<closure>>

 0. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Tree.php line 78
    OCA\DAV\Connector\Sabre\Directory->getChild("SMB_czarny")
 1. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 971
    Sabre\DAV\Tree->getNodeForPath("files/root/SMB_czarny")
 2. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 1662
    Sabre\DAV\Server->getPropertiesIteratorForPath("files/root/SMB_czarny", ["{DAV:}getetag"], 0)
 3. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 1647
    Sabre\DAV\Server->writeMultiStatus(Sabre\Xml\Writer ... ]}, Generator {}, false)
 4. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 346
    Sabre\DAV\Server->generateMultiStatus(Generator {}, false)
 5. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/event/lib/WildcardEmitterTrait.php line 89
    Sabre\DAV\CorePlugin->httpPropFind(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
 6. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 472
    Sabre\DAV\Server->emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
 7. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 253
    Sabre\DAV\Server->invokeMethod(Sabre\HTTP\Request {}, Sabre\HTTP\Response {})
 8. /datashare/html/domain.local/nextcloud_nc21/3rdparty/sabre/dav/lib/DAV/Server.php line 321
    Sabre\DAV\Server->start()
 9. /datashare/html/domain.local/nextcloud_nc21/apps/dav/lib/Server.php line 360
    Sabre\DAV\Server->exec()
10. /datashare/html/domain.local/nextcloud_nc21/apps/dav/appinfo/v2/remote.php line 35
    OCA\DAV\Server->exec()
11. /datashare/html/domain.local/nextcloud_nc21/remote.php line 171
    require_once("/datashare/html ... p")

PROPFIND /remote.php/dav/files/root/SMB_czarny/
from 10.3.1.1 by root at 2023-02-17T18:50:55+00:00


[no app in context] Warning: Icewind\SMB\Exception\Exception: Invalid attribute response at <<closure>>

 0. /datashare/html/domain.local/nc2503/apps/files_external/3rdparty/icewind/smb/src/Native/NativeFileInfo.php line 69
    Icewind\SMB\Native\NativeFileInfo->stat()
 1. /datashare/html/domain.local/nc2503/apps/files_external/3rdparty/icewind/smb/src/Native/NativeShare.php line 114
    Icewind\SMB\Native\NativeFileInfo->getSize()
 2. /datashare/html/domain.local/nc2503/apps/files_external/lib/Lib/Storage/SMB.php line 191
    Icewind\SMB\Native\NativeShare->stat("/")
 3. /datashare/html/domain.local/nc2503/apps/files_external/lib/Lib/Storage/SMB.php line 348
    OCA\Files_External\Lib\Storage\SMB->getFileInfo("/")
 4. /datashare/html/domain.local/nc2503/lib/private/Files/Storage/Common.php line 462
    OCA\Files_External\Lib\Storage\SMB->stat("")
 5. /datashare/html/domain.local/nc2503/apps/files_external/lib/Lib/Storage/SMB.php line 729
    OC\Files\Storage\Common->test()
 6. /datashare/html/domain.local/nc2503/apps/files_external/lib/MountConfig.php line 131
    OCA\Files_External\Lib\Storage\SMB->test("*** sensitive parameters replaced ***", "*** sensitive parameters replaced ***")
 7. /datashare/html/domain.local/nc2503/apps/files_external/lib/Controller/StoragesController.php line 288
    OCA\Files_External\MountConfig::getBackendStatus("*** sensitive parameters replaced ***")
 8. /datashare/html/domain.local/nc2503/apps/files_external/lib/Controller/StoragesController.php line 363
    OCA\Files_External\Controller\StoragesController->updateStorageStatus("*** sensitive parameters replaced ***")
 9. /datashare/html/domain.local/nc2503/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Files_External\Controller\StoragesController->show(1, "*** sensitive parameters replaced ***")
10. /datashare/html/domain.local/nc2503/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Extern ... {}, "show")
11. /datashare/html/domain.local/nc2503/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Extern ... {}, "show")
12. /datashare/html/domain.local/nc2503/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main("OCA\\Files_Exte ... r", "show", OC\AppFramework\ ... {}, ["1","files_exte ... "])
13. /datashare/html/domain.local/nc2503/lib/base.php line 1047
    OC\Route\Router->match("/apps/files_external/globalstorages/1")
14. /datashare/html/domain.local/nc2503/index.php line 36
    OC::handleRequest()

GET /index.php/apps/files_external/globalstorages/1?testOnly=true
from 10.3.1.99 by root at 2023-02-18T06:09:12+00:00

Additional info

No response

@wioch wioch added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Feb 18, 2023
@ib54003
Copy link

ib54003 commented Feb 18, 2023

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

@wioch
Copy link
Author

wioch commented Feb 18, 2023

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).

@nicrame
Copy link

nicrame commented Feb 18, 2023

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.

@sempervictus
Copy link

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?

@wioch
Copy link
Author

wioch commented Feb 18, 2023

As I've mentioned, it is workaround, not solution. Either way, with lib-smbclient:

  • 4.17.1 shares are working
  • 4.17.5 shares were NOT working
    and I have both Windows and Linux SMB shares.

@puzzle-it-nu
Copy link

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

@wioch
Copy link
Author

wioch commented Feb 22, 2023

Following the trail, looks like return codes were corrected: https://bugzilla.samba.org/show_bug.cgi?id=14808

@sempervictus
Copy link

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.

@bnerickson
Copy link

Related eduardok/libsmbclient-php#98

@makabar
Copy link

makabar commented Feb 27, 2023

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 :-(

@Ryushin
Copy link

Ryushin commented Feb 27, 2023

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

@makabar
Copy link

makabar commented Feb 27, 2023

@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.

@sempervictus
Copy link

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.

@wellington1979
Copy link

wellington1979 commented Mar 5, 2023

Hi, I thing the problem not is smbclient because using shell command work fine.
smbclient -U usuario%senha //ipserver/share
get bigfile.tar
ok

@makabar
Copy link

makabar commented Mar 7, 2023

Ok... solved it for the moment.

  1. apt remove php8.1-smbclient -y
  2. git clone git://github.com/eduardok/libsmbclient-php.git
  3. apt install php8.1-dev -y
  4. cd libsmbclient-php
  5. edit smbclient.c (enable this patch https://github.com/eduardok/libsmbclient-php/files/10843385/smbclient.patch.txt )
  6. phpize
  7. ./configure
  8. make
  9. make test
  10. make install
  11. echo 'extension="smbclient.so"' >> /etc/php/8.1/fpm/php.ini
  12. service php8.1-fpm restart

@sempervictus
Copy link

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.

@wellington1979
Copy link

Ok... solved it for the moment.

  1. apt remove php8.1-smbclient -y
  2. git clone git://github.com/eduardok/libsmbclient-php.git
  3. apt install php8.1-dev -y
  4. cd libsmbclient-php
  5. edit smbclient.c (enable this patch https://github.com/eduardok/libsmbclient-php/files/10843385/smbclient.patch.txt )
  6. phpize
  7. ./configure
  8. make
  9. make test
  10. make install
  11. echo 'extension="smbclient.so"' >> /etc/php/8.1/fpm/php.ini
  12. service php8.1-fpm restart

Ok I try and work. Thanks

@BenzinoNapoloni
Copy link

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!

@nachfuellbar
Copy link

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:
eduardok/libsmbclient-php#96
commit discussed here:
eduardok/libsmbclient-php#99

@nachfuellbar
Copy link

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

@remicollet
Copy link

remicollet commented Apr 4, 2023

Notice:

@remicollet
Copy link

@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.

@razvansarbu
Copy link

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.

@theroch
Copy link

theroch commented Apr 16, 2023

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.

@theroch
Copy link

theroch commented Apr 17, 2023

@eduardok released version 1.1.1 of smbclient with the fix.
The release is also available via pecl

@wioch
Copy link
Author

wioch commented May 20, 2023

Updated NC to 26.0.1.
Samba mounts:

  • are working correctly with 4.17.1
  • are NOT working with latest 4.17.8

@joshtrichards
Copy link
Member

joshtrichards commented Jun 15, 2023

@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.

@wioch
Copy link
Author

wioch commented Jun 17, 2023

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

@Git-ChrisSc
Copy link

Git-ChrisSc commented Jan 4, 2024

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

@icewind1991
Copy link
Member

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 apps/files_external/3rdparty/icewind with https://github.com/icewind1991/SMB/tree/v3.7.0 instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 25-feedback bug feature: external storage
Projects
None yet
Development

No branches or pull requests