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

[13.0.0beta4] SMB mounts work poorly or not at all #7748

Closed
waynehawken opened this issue Jan 8, 2018 · 24 comments
Closed

[13.0.0beta4] SMB mounts work poorly or not at all #7748

waynehawken opened this issue Jan 8, 2018 · 24 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@waynehawken
Copy link

waynehawken commented Jan 8, 2018

Steps to reproduce

  1. Mount SMB shares
  2. Enter a subfolder to the mounted SMB share
  3. Notice that nothing is listed

Expected behaviour

SMB shares should be listed, not only the root folders in that share.

Actual behaviour

We can mount SMB just fine with the smbclient in Ubuntu. Listing shows up as expected and all the files and folders are showing up as expected, not in Nextcloud though.

Server configuration detail

Operating system: Linux 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64

Webserver: Apache/2.4.18 (Ubuntu) (apache2handler)

Database: mysql 10.2.12

PHP version: 7.0.22-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, redis, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Nextcloud version: 13.0.0 Beta 4 - 13.0.0.9

Updated from an older Nextcloud/ownCloud or fresh install:
Fresh install

Where did you install Nextcloud from:
Tech and Me VM with installation help from @enoch85

Signing status

Array

List of activated apps
Enabled:
 - activity: 2.6.1
 - calendar: 1.5.7
 - comments: 1.3.0
 - contacts: 2.0.1
 - dav: 1.4.6
 - federatedfilesharing: 1.3.1
 - federation: 1.3.0
 - files: 1.8.0
 - files_external: 1.4.1
 - files_pdfviewer: 1.2.0
 - files_sharing: 1.5.0
 - files_texteditor: 2.5.1
 - files_trashbin: 1.3.0
 - files_versions: 1.6.0
 - files_videoplayer: 1.2.0
 - firstrunwizard: 2.2.1
 - gallery: 18.0.0
 - issuetemplate: 0.3.0
 - logreader: 2.0.0
 - lookup_server_connector: 1.1.0
 - nextcloud_announcements: 1.2.0
 - notifications: 2.1.2
 - oauth2: 1.1.0
 - password_policy: 1.3.0
 - previewgenerator: 1.0.9
 - provisioning_api: 1.3.0
 - richdocuments: 1.12.39
 - serverinfo: 1.3.0
 - sharebymail: 1.3.0
 - survey_client: 1.1.0
 - systemtags: 1.3.0
 - theming: 1.4.1
 - twofactor_backupcodes: 1.2.3
 - updatenotification: 1.3.0
 - user_ldap: 1.3.1
 - workflowengine: 1.3.0
Disabled:
 - admin_audit
 - encryption
 - user_external

Configuration (config/config.php)
{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "10.2.0.143",
        "eqxnexcloud02",
        "collabora.spd.adventist.org",
        "files.spd.adventist.org"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "https:\/\/eqxnexcloud02.sda.local\/",
    "dbtype": "mysql",
    "version": "13.0.0.9",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "maintenance": false,
    "mail_smtpmode": "smtp",
    "log_rotate_size": "10485760",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "filelocking.enabled": true,
    "memcache.distributed": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0,
        "dbindex": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "htaccess.RewriteBase": "\/",
    "loglevel": "2",
    "log_type": "file",
    "logfile": "\/var\/ncdata\/nextcloud.log",
    "logtimezone": "Australia\/Sydney",
    "ldapIgnoreNamingRules": false,
    "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory"
}

Are you using external storage, if yes which one: local/smb/sftp/...
SMB

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

**VERY BIG UNREADABLE OUTPUT**

Client configuration

Browser: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0

Operating system:
Windows Server 2012 R2 Datacenter

Logs

Browser log
Nothing relevant
Nextcloud log
Nothing relevant
Browser log

Nothing relevant

@enoch85 enoch85 added the bug label Jan 8, 2018
@enoch85
Copy link
Member

enoch85 commented Jan 8, 2018

cc @icewind1991

@waynehawken
Copy link
Author

Same goes for 12.0.3 and 12.0.4.

@enoch85
Copy link
Member

enoch85 commented Jan 8, 2018

Related: #6597

@twrhills
Copy link

twrhills commented Jan 10, 2018

I have this same issue since at least 12.0.3. Feedback below is based on 12.0.4.

I found that what is failing on my particular set up is the auth file being provided via the /proc/self/fd/3

When I change apps/files_external/3rdparty/icewind/smb/src/RawConnection.php function writeAuthentication to point to a physical file which I create with the content provided by getAuthStream() then everything "just works".

@icewind1991 I followed your test instructions regarding the example.php in https://github.com/icewind1991/SMB and that again "just works".

@icewind1991
Copy link
Member

Which version of smbclient are you using, I know that the smb wrapper shipped with 12.0.x doesn't like the /proc trick.

You can try applying #7774 and see if that fixes the issue for you

@enoch85
Copy link
Member

enoch85 commented Jan 10, 2018

@icewind1991 Do we use the latest smbclient libs in 13.0.0beta4 as well, because it's exactly the same issue there as in 12.0.4.

@enoch85
Copy link
Member

enoch85 commented Jan 10, 2018

And just to be clear, it's working perfectly fine without involving Nextcloud, in other words when using smbclient. It's the External Storage App that is dysfunctional.

@icewind1991
Copy link
Member

if you're experiencing the issue with 13 then it's most likely a separate one as @twrhills has

Try running the steps described in #6597 (comment) to narrow down the issue to either the smb library or the NC integration of it

@enoch85
Copy link
Member

enoch85 commented Jan 10, 2018

@icewind1991 I already tried to reach you on IRC when I was debugging it, but you didn't answer. :)

My question there was where to put all the info, I mean "test" must be replaced with the real values to get a valid result right?

@icewind1991
Copy link
Member

Yes, on line 8/10 you put the server address, user name and password in that order

then on line 13 the name of the share

@enoch85
Copy link
Member

enoch85 commented Jan 11, 2018

@icewind1991 Great!

@waynehawken Maybe we can schedule a meeting for this?

@waynehawken
Copy link
Author

@enoch85 - happy to set up another - it is probably fastest - however looking at the details we aren't providing user/pwd details in the config as we are using at runtime accounts and per user authentication to the shares. Providing a single user account in the backend would defeat this authentication purpose would it not?

@enoch85
Copy link
Member

enoch85 commented Jan 12, 2018

@waynehawken Aah you're right. Forgot about that. I don't remember, did it work when we used a single account or not?

@icewind1991 This is a little bit special case as the users authenticate with LDAP and permissions to the different CIFS shares are set in AD. So testing just one account might not provide fair result, and in @waynehawken setup we have about 10 000 users if I'm not mistaken.

@waynehawken
Copy link
Author

ok - have had to do something as it has been unusable for us for an extended time period. Have build a new v11 VM and reverted back to 11.03 - problems are gone & SMB working fine again. There is something buggy in at least v12.3 - possibly 12.02 and maybe 12.01, but we have been trying to work around the issue for so long now that failed/change history doesn't align with end user reports enough.

@enoch85
Copy link
Member

enoch85 commented Jan 23, 2018

11.03 - problems are gone & SMB working fine again. There is something buggy in at least v12.3 - possibly 12.02 and maybe 12.01

Yup, I can confirm that I had multiple customers that complained about this since 11.X.X cc @icewind1991

@Witmann
Copy link

Witmann commented Mar 6, 2018

Same here with NC 13.0.0, having this kind of problems since I was using Owncloud back to 2015. Samba shares doesn't work proprely at all, bad files' size shown, files truncated when downloaded etc.

During these years I tried to:

  • Migrated owncloud to NC (13.0.0)
  • Updated the PHP wrapper for samba (with PECL, smbclient 0.9.0).
  • Applied handle exceptions in SMB::stat #7556
  • Didn't applied [12] update icewind/smb to 2.0.3 #7774 (icewind/smb to 2.0.3) because I saw in the conf that I use icewind/smb 2.0.4
  • And I did a lot of tests while watching nginx/samba/php/NC logs, the only strange thing I noticed during a share download was in nginx error.log, but I am not enough a good Linux user to understand and make appropriates Google searches about it, or even if these errors have a thing to do with this issue.

2018/03/03 11:04:33 [error] 758#758: *74 FastCGI sent in stderr: "PHP message: PHP Warning: smbclient_state_errno(): supplied resource is not a valid smbclient state resource in /var/www/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeState.php on line 45 PHP message: PHP Fatal error: Uncaught Error: Access to undeclared static property: Icewind\SMB\NativeState::$exceptionMap in /var/www/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeState.php:49 Stack trace: #0 /var/www/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeState.php(61): Icewind\SMB\NativeState->handleError(NULL) #1 /var/www/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeState.php(263): Icewind\SMB\NativeState->testResult(false, Resource id #56) #2 /var/www/owncloud/apps/files_external/3rdparty/icewind/smb/src/NativeStream.php(64): Icewind\SMB\NativeState->close(Resource id #56) #3 [internal function]: Icewind\SMB\NativeStream->stream_close() #4 /var/www/owncloud/apps/files_external/3rdparty/icewind/streams/src/Wrapper.php(124): fclose(Resource id #60) #5 /var/www/owncloud/apps/files_external/3rdparty/icewind/streams/src/CallbackWrapper.php(107): Icewind\Streams\Wrapper->stream_close() #6 [internal function]: Icewind\Streams\CallbackWrapper->stream_close()" while reading upstream, client: xx.xxx.xxx.xx, server: aaaaa.aaaaa.com, request: "GET /owncloud/index.php/s/Qm7Z9K6BsLNtFEF/download HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.xxxxx.com:443"

I was thinking about a memory problem, I only have 2 Go ram on an XU4 Odroid, but it doesn't seems, I tried to share and download a > 8 Go file using Webdav and there was no problem.

@enoch85
Copy link
Member

enoch85 commented Mar 6, 2018

IMHO I think this should be looked at. We have a lot of Windows users that use SMB, and that it's broken since 11.0.X is just sad. Dunno if this has priority on the todo-list?

@Witmann
Copy link

Witmann commented Mar 9, 2018

Issues with big files using smb shares exists at least since 2015 (as I know) in OC or NC, unfortunatly maybe Samba is not very popular among NC users so I guess it's not realy a priority :s.

@waynehawken
Copy link
Author

@icewind1991

With NC11 no longer supported, but this functionality is still not working in v12 or v13, is there any timeline or plans to resolve this or should we be looking for a replacement product and moving to something else?

@enoch85
Copy link
Member

enoch85 commented Jun 4, 2018

Hi @waynehawken and others. I think this matter would be resolved pretty quickly after a discussion with Nextcloud looking at this: https://nextcloud.com/enterprise/

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jul 5, 2018
@j4mb4l4j4
Copy link

Also having Samba Errors.

We are using Nextcloud 14.03 and everything works fine until I try to open a PDF or a Image File. Then I get mostly:

smbclient_state_errno(): supplied resource is not a valid smbclient state resource at /var/www/domain.de/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php#57

With smbclient I can successfully mount everything. Also with the Nextcloud App but accessing files is sometimes possible and sometimes not and I dont know why...

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Nov 9, 2018
@aignerat
Copy link
Member

aignerat commented Jan 7, 2019

Also having Samba Errors.

We are using Nextcloud 14.03 and everything works fine until I try to open a PDF or a Image File. Then I get mostly:

smbclient_state_errno(): supplied resource is not a valid smbclient state resource at /var/www/domain.de/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php#57

With smbclient I can successfully mount everything. Also with the Nextcloud App but accessing files is sometimes possible and sometimes not and I dont know why...

Just tested that on nextcloud 15, at least .pdf/.jpeg opens as expected from a samba-share. I only got a problem getting smb work with kerberos-tickets atm, as the libary seems not to use the ticket that is generated at the login.

@alarmix
Copy link

alarmix commented Feb 16, 2019

15.0.4 we have exactly the same error:
smbclient_state_errno(): supplied resource is not a valid smbclient state resource at /var/www/nextcloud/apps/files_external/3rdparty/icewind/smb/src/Native/NativeState.php#57
Apart from the error in the log, everything seems to be working fine.
And this error occured after the installation of php-smbclient

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@skjnldsv
Copy link
Member

As the version of the software you've reported this for has reached end of life, I will close this ticket. If this is still happening after an upgrade to the latest version, feel free to reopen

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 bug
Projects
None yet
Development

No branches or pull requests

10 participants