SMB folders are empty

For a while now off and on folders in Owncloud show up as empty in the web and desktop clients. To get the files to appear again sometimes just modifying a file in the folder through Windows file explorer will bring it back or flipping ‘allow cache’ off/on in the file server. The issue is exactly as described in this topic from a couple years ago SMB External Storage not showing files. I tried the troubleshooting steps mentioned in that thread but it did not work.

I have rebuilt the server many times, changed distros, tried docker nothing helps.

Steps to reproduce

  1. Share Windows drive
  2. Install External Storage add-on
  3. Create SMB share External Storage with the correct SMB credentials

Expected behaviour

All the files show up in the ownCloud webUI and OS client.

Actual behaviour

The SMB share is empty and does not show any files.

Server configuration

Operating system: centos 7

Web server: Apache

Database: MarianDB

PHP version: 7.7

ownCloud version: (see ownCloud admin page)
10.5.0.10

Updated from an older ownCloud or fresh install:
fresh install

Where did you install ownCloud from:
Directly

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results into https://gist.github.com/ and puth the link here.
```No errors have been found.


[root@srv-owncloud2 owncloud]# sudo -u apache php occ config:list system
{
    "system": {
        "updatechecker": false,
        "instanceid": "oc89g3psfchx",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.4.28",
            "files.ccclife.org"
        ],
        "datadirectory": "\/var\/www\/html\/owncloud\/data",
        "overwrite.cli.url": "http:\/\/192.168.4.29\/owncloud",
        "dbtype": "mysql",
        "version": "10.5.0.10",
        "dbname": "owncloud",
        "dbhost": "localhost",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/owncloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/owncloud\/apps-external",
                "url": "\/apps-external",
                "writable": true
            }
        ],
        "installed": true,
        "ldapIgnoreNamingRules": false
    }
}


[root@srv-owncloud2 owncloud]# sudo -u apache php occ app:list
Enabled:
  - comments: 0.3.0
  - configreport: 0.2.0
  - dav: 0.6.0
  - federatedfilesharing: 0.5.0
  - federation: 0.1.0
  - files: 1.5.2
  - files_external: 0.7.1
  - files_mediaviewer: 1.0.3
  - files_sharing: 0.13.0
  - files_trashbin: 0.9.1
  - files_versions: 1.3.0
  - firstrunwizard: 1.2.0
  - market: 0.6.0
  - notifications: 0.5.2
  - provisioning_api: 0.5.0
  - systemtags: 0.3.0
  - updatenotification: 0.2.1
  - user_ldap: 0.15.2
Disabled:
  - encryption
  - external
  - user_external


**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:** 
AD


+-------------------------------+----------------+
| Configuration                 | s02            |
+-------------------------------+----------------+
| hasMemberOfFilterSupport      | 0              |
| hasPagedResultSupport         |                |
| homeFolderNamingRule          |                |
| lastJpegPhotoLookup           | 0              |
| ldapAgentName                 |                |
| ldapAgentPassword             | ***            |
| ldapAttributesForGroupSearch  |                |
| ldapAttributesForUserSearch   |                |
| ldapBackupHost                |                |
| ldapBackupPort                |                |
| ldapBase                      |                |
| ldapBaseGroups                |                |
| ldapBaseUsers                 |                |
| ldapCacheTTL                  | 600            |
| ldapConfigurationActive       | 0              |
| ldapDynamicGroupMemberURL     |                |
| ldapEmailAttribute            |                |
| ldapExperiencedAdmin          | 0              |
| ldapExpertUUIDGroupAttr       |                |
| ldapExpertUUIDUserAttr        |                |
| ldapExpertUsernameAttr        |                |
| ldapGroupDisplayName          | cn             |
| ldapGroupFilter               |                |
| ldapGroupFilterGroups         |                |
| ldapGroupFilterMode           | 0              |
| ldapGroupFilterObjectclass    |                |
| ldapGroupMemberAssocAttr      | uniqueMember   |
| ldapHost                      |                |
| ldapIgnoreNamingRules         |                |
| ldapLoginFilter               |                |
| ldapLoginFilterAttributes     |                |
| ldapLoginFilterEmail          | 0              |
| ldapLoginFilterMode           | 0              |
| ldapLoginFilterUsername       | 1              |
| ldapNestedGroups              | 0              |
| ldapNetworkTimeout            | 2              |
| ldapOverrideMainServer        |                |
| ldapPagingSize                | 500            |
| ldapPort                      |                |
| ldapQuotaAttribute            |                |
| ldapQuotaDefault              |                |
| ldapTLS                       | 0              |
| ldapUserDisplayName           | displayName    |
| ldapUserDisplayName2          |                |
| ldapUserFilter                |                |
| ldapUserFilterGroups          |                |
| ldapUserFilterMode            | 0              |
| ldapUserFilterObjectclass     |                |
| ldapUserName                  | samaccountname |
| ldapUuidGroupAttribute        | auto           |
| ldapUuidUserAttribute         | auto           |
| turnOffCertCheck              | 0              |
| useMemberOfToDetectMembership | 1              |
+-------------------------------+----------------+

There are a couple of important things missing:

  • ownCloud’s log file
  • mount point configuration (a screenshot of the settings page - external storage - might be easy)

In addition, for general troubleshooting of SMB problems, please check with the smbclient cli app and verify there is no problem with the connection to the server and that you can access to the files normally.

I’m not fully sure, but I think for recent libsmbclient versions ownCloud will need a domain set in the configuration. If you don’t have a real domain for the SMB server, “WORKGROUP” usually works.

1 Like

I’ll upload the log and a screenshot of the external storage config. SMB shares work fine on the host OS when mounted with fstab. We do have a domain configured for our LDAP users, is that what you mean by “domain set in the configuration” or is there someone else in the config I need to add it?

Thanks!

owncloud.log (1.2 MB)

In the screenshot you see there is a “domain” field. That’s what you might need to fill.
Using smbclient could give you an idea:

~# smbclient -U user '//server/opt'
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.3.11-Ubuntu]
smb: \>

On the other hand, your network doesn’t seem quite reliable according to the logs. There are a lot of LDAP bind exceptions, timeout exceptions connecting to the SMB server and also rename exceptions.
You need to pay more attention to the logs while accessing to the SMB folders in order to know what’s going on. Right now, I don’t know if you’ve fixed those problems or not.

1 Like