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

SMB File Share enumerating everything as folders #5340

Closed
wilhil opened this issue Jun 12, 2017 · 19 comments
Closed

SMB File Share enumerating everything as folders #5340

wilhil opened this issue Jun 12, 2017 · 19 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: external storage needs info stale Ticket or PR with no recent activity

Comments

@wilhil
Copy link

wilhil commented Jun 12, 2017

Steps to reproduce

  1. Installed a Windows Server 2016 Test Environment - Domain Controller, File Server, Win 10 client, Nextcloud on Ubuntu following install guide.
  2. Setup a SMB file share pointing toward the file server

Expected behaviour

I should see all files and folders listed.

Actual behaviour

Everything appears as folders - if I click on a folder, it enumerates. If I click on a file, I get an error and it takes me back to the first page after login.

Server configuration

Operating system:
Ubuntu 16.04 LTS
Web server:
Apache
Database:
Sqlite3 (testing only)
PHP version:
7.0.18
Nextcloud version: (see Nextcloud admin page)
Nextcloud 12.0.0
Updated from an older Nextcloud/ownCloud or fresh install:
fresh install
Where did you install Nextcloud from:
home page
Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Enabled:

  • activity: 2.5.2
  • admin_audit: 1.2.0
  • bruteforcesettings: 1.0.2
  • comments: 1.2.0
  • dav: 1.3.0
  • encryption: 1.6.0
  • federatedfilesharing: 1.2.0
  • federation: 1.2.0
  • files: 1.7.2
  • files_external: 1.3.0
  • files_pdfviewer: 1.1.1
  • files_sharing: 1.4.0
  • files_texteditor: 2.4.1
  • files_trashbin: 1.2.0
  • files_versions: 1.5.0
  • files_videoplayer: 1.1.0
  • firstrunwizard: 2.1
  • gallery: 17.0.0
  • logreader: 2.0.0
  • lookup_server_connector: 1.0.0
  • nextcloud_announcements: 1.1
  • notifications: 2.0.0
  • oauth2: 1.0.5
  • password_policy: 1.2.2
  • provisioning_api: 1.2.0
  • serverinfo: 1.2.0
  • sharebymail: 1.2.0
  • survey_client: 1.0.0
  • systemtags: 1.2.0
  • theming: 1.3.0
  • twofactor_backupcodes: 1.1.1
  • updatenotification: 1.2.0
  • user_external: 0.4
  • workflowengine: 1.2.0
    Disabled:
  • user_ldap

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

{
"system": {
"instanceid": "ocgg72f2njgu",
"passwordsalt": "REMOVED SENSITIVE VALUE",
"secret": "REMOVED SENSITIVE VALUE",
"trusted_domains": [
"xx.xx.xx.xx"
],
"datadirectory": "/var/www/html/nextcloud/data",
"overwrite.cli.url": "http://xx.xx.xx.xx/nextcloud",
"dbtype": "sqlite3",
"version": "12.0.0.29",
"installed": true

Are you using external storage, if yes which one: local/smb/sftp/...
SMB
Are you using encryption: yes/no
no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM oc_appconfig WHERE appid = 'user_ldap';

Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

</details>

### Client configuration
**Browser:**
Chrome
**Operating system:**
Win 10
### Logs
#### Web server error log
<details>
<summary>Web server error log</summary>

Insert your webserver log here

</details>

#### Nextcloud log (data/nextcloud.log)
<details>
<summary>Nextcloud log</summary>

{"reqId":"DlsX1CL6ZHJnp6vgPSb3","level":4,"time":"2017-06-12T02:24:30+00:00","remoteAddr":"xx.xx.xx.xx","user":"wil-admin","app":"webdav","method":"PROPFIND","url":"\/nextcloud\/remote.php\/webdav\/SMB\/gfds.bmp","message":"Exception: {\"Message\":\"Unknown error () for \\\/gfds.bmp\",\"Exception\":\"Icewind\\\\SMB\\\\Exception\\\\Exception\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Exception\\\/Exception.php(35): Icewind\\\\SMB\\\\Exception\\\\Exception::unknown('\\\/gfds.bmp', false)\\n#1 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Parser.php(72): Icewind\\\\SMB\\\\Exception\\\\Exception::fromMap(Array, false, '\\\/gfds.bmp')\\n#2 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Share.php(392): Icewind\\\\SMB\\\\Parser->checkForError(Array, '\\\/gfds.bmp')\\n#3 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Share.php(126): Icewind\\\\SMB\\\\Share->parseOutput(Array, '\\\/gfds.bmp')\\n#4 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/SMB.php(150): Icewind\\\\SMB\\\\Share->dir('\\\/gfds.bmp')\\n#5 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/lib\\\/Lib\\\/Storage\\\/SMB.php(404): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\SMB->getFolderContents('\\\/gfds.bmp')\\n#6 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(97): OCA\\\\Files_External\\\\Lib\\\\Storage\\\\SMB->opendir('gfds.bmp')\\n#7 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(97): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->opendir('gfds.bmp')\\n#8 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Availability.php(106): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->opendir('gfds.bmp')\\n#9 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(97): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Availability->opendir('gfds.bmp')\\n#10 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(97): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->opendir('gfds.bmp')\\n#11 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(359): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->opendir('gfds.bmp')\\n#12 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(410): OC\\\\Files\\\\Cache\\\\Scanner->getNewChildren('gfds.bmp')\\n#13 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(390): OC\\\\Files\\\\Cache\\\\Scanner->handleChildren('gfds.bmp', false, 3, '128', true, 0)\\n#14 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Cache\\\/Scanner.php(324): OC\\\\Files\\\\Cache\\\\Scanner->scanChildren('gfds.bmp', false, 3, '128', true)\\n#15 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1311): OC\\\\Files\\\\Cache\\\\Scanner->scan('gfds.bmp', false)\\n#16 \\\/var\\\/www\\\/html\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1352): OC\\\\Files\\\\View->getCacheEntry(Object(OCA\\\\Files_Trashbin\\\\Storage), 'gfds.bmp', 'SMB\\\/gfds.bmp')\\n#17 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/ObjectTree.php(160): OC\\\\Files\\\\View->getFileInfo('\\\/wil-admin\\\/file...')\\n#18 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(966): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\ObjectTree->getNodeForPath('SMB\\\/gfds.bmp')\\n#19 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1665): Sabre\\\\DAV\\\\Server->getPropertiesIteratorForPath('SMB\\\/gfds.bmp', Array, 1)\\n#20 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(355): Sabre\\\\DAV\\\\Server->generateMultiStatus(Object(Generator), false)\\n#21 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPropFind(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#22 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#23 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:PROPFIND', Array)\\n#24 \\\/var\\\/www\\\/html\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#25 \\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/webdav.php(71): Sabre\\\\DAV\\\\Server->exec()\\n#26 \\\/var\\\/www\\\/html\\\/nextcloud\\\/remote.php(162): require_once('\\\/var\\\/www\\\/html\\\/n...')\\n#27 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/nextcloud\\\/apps\\\/files_external\\\/3rdparty\\\/icewind\\\/smb\\\/src\\\/Exception\\\/Exception.php\",\"Line\":17,\"User\":\"wil-admin\"}","userAgent":"Mozilla\/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/58.0.3029.110 Safari\/537.36","version":"12.0.0.29"}
</details>

#### Browser log
<details>
<summary>Browser log</summary>

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

</details>

@wilhil
Copy link
Author

wilhil commented Jun 12, 2017

image
image

@jospoortvliet
Copy link
Member

Summoning @icewind1991 as this might be his area of expertise

@icewind1991
Copy link
Member

Can you try connecting to the smb share using smbclient and then positing the output of ls here

@wilhil
Copy link
Author

wilhil commented Jun 13, 2017

image

It download the text file fine - no EOL character, so, prompt came out on a same line straight after.

Appears to look all correct? - And sorry, I'm a sysadmin, but, never used Samba/smbclient directly (other than indirectly on a NAS/appliance)... Please let me know if I did it wrong or if I should be testing another way

@wilhil
Copy link
Author

wilhil commented Jun 16, 2017

Ok - I am totally confused.

Still getting this issue, but I wanted to experiment as I really want to get this working.

The main shared folder is on a DFS root, I thought maybe that is causing issues (I remember a SAMBA bug a few years ago).

I created a new share outside of DFS - Works fine.

I created a subfolder called test in DFS - Same bug.

I created a subfolder called test2 in DFS, Set external storage from / to /test2 - the share works fine

I then changed external storage from /test2 to / - now when I browse, I can go to the test2 subfolder fine, but everything else returns the same bug/problem...

After a few minutes, I go back/hit refresh - I now have the same problem and all files are showing up as a directory again

Any advice? Is DFS shares just not supported or is there anyway to get this working?

@icewind1991
Copy link
Member

@wilhil can you also post the output of allinfo from one of the files that show up as folder

@wilhil
Copy link
Author

wilhil commented Jun 16, 2017

@icewind1991 - Sorry, please can you give a bit more info - is that a smbclient command or something else? I'm looking/experimenting now...

@wilhil
Copy link
Author

wilhil commented Jun 16, 2017

@icewind1991 -

image

This is for the two files in the root - I am guessing the attribute D is the problem? SMBClient does allow me to download and view the files fine (well, only tested with a few text files) as the earlier picture shows.

image

This looks more promising in a non DFS share coming from the same server.

Any idea what is causing this?

@necrevistonnezr
Copy link

I have the same issue when accessing my Nextcloud via WebDAV using an iOS app like Documents or Goodreader. DOCs and PDFs are shown as folders when in a subfolder:

The first screenshot shows the first level of the sync folder "CM" - everything is fine (PDFs are shown with the right icon, no file extension. And they actually open).

The second Screenshot shows a subfolder called "2007.09. ..." with PDFs. Instead of the files, folders are shown with the files' names and a ".pdf" extension. If you click on the folders, it's shown empty.

image1

image2

@jospoortvliet
Copy link
Member

Maybe there's a way @icewind1991 could get access to a server that has this issue from somebody who experiences the bug? Or can you reproduce it, Robin?

@necrevistonnezr
Copy link

I can provide access - just let me know.

@jospoortvliet
Copy link
Member

@icewind1991 ping ;-)

@BlackEdder0815
Copy link

I think, this issue is still open?
I tried to connect my nextCloud to a webdav of pCloud. Same behavior here: all files are recognized as folders.
If I mount this webdav via windows, all works fine. Seems to be a rendering-problem, so that all items wer recognized as folders.
Also: It seems, that this is related to #5543 - only just the other direction.
There was a bug in the related sabre-dav lib. Maybe this is the same, and files_external is still using a buggy one?
@icewind1991 any suggestions?

@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@ghost ghost removed the stale Ticket or PR with no recent activity label Jun 12, 2019
@skjnldsv
Copy link
Member

As I cannot reproduce the original issue anymore using latest samba, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.

@wilhil
Copy link
Author

wilhil commented Mar 10, 2020

I had a look a couple of months ago and it was still happening. Please note, for me originally, this was not an issue with SMB itself, it worked fine when mounting directly at the CLI. this seemed strictly to be an issue when going to a DFS share.

@skjnldsv
Copy link
Member

DFS share

Define DFS?
Thanks for helping on this issue :)

@skjnldsv skjnldsv reopened this Mar 10, 2020
@wilhil
Copy link
Author

wilhil commented Mar 10, 2020

Windows Distributed File System - https://docs.microsoft.com/en-us/windows-server/storage/dfs-namespaces/dfs-overview

At large clients, we typically use a DFS over a standard file share for redundancy. I always thought the DFS was simply server to server and clients connected the normal way.

In fact, Linux/Mac clients seem to work fine, as do many third party tools (As you can see above, I used cat on a file without issue)... It's purely nextcloud for some reason sees the files as folders!

@skjnldsv
Copy link
Member

Thanks! :)
Then pinging Dr @icewind1991 👨‍⚕️

@ghost
Copy link

ghost commented Apr 9, 2020

This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.

@ghost ghost added the stale Ticket or PR with no recent activity label Apr 9, 2020
@ghost ghost closed this as completed Apr 23, 2020
This issue was closed.
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 feature: external storage needs info stale Ticket or PR with no recent activity
Projects
None yet
Development

No branches or pull requests

8 participants