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

Webdav download with subdirectories creates only directories #5543

Closed
joergbormet opened this issue Jun 26, 2017 · 28 comments
Closed

Webdav download with subdirectories creates only directories #5543

joergbormet opened this issue Jun 26, 2017 · 28 comments
Labels
Milestone

Comments

@joergbormet
Copy link

Steps to reproduce

Dear nextcloud Team,please have a look on the following eMail dialog. For Reproduction feel free to use the readdle account on my nextcloud 12 Server installation. Best Regards Joerg

Hello Joerg,

Thanks a lot for all the info provided, though our developers have confirmed, that the issue is occurring on the server side and we don't have any access to change this behavior.

Looks like the last update of the server dictates, that your files are folders, so the app draws the folder icon.

I may suggest you to contact your server administrator to address this issue.

Please contact me if you need any info and have an amazing week ahead.

Best Regards,
Olga Piskunovska
Readdle Support Team

Joerg Bormet - [email protected] - Jun 25 2017, 11:14 PM
Dear Olga,
for exact reproduction of the error I have created a user "readdle" (password: "Readdle#" (write it without hyphens)) on my nextcloud server. The URL is "https://nc.bormet.info/nextcloud/remote.php/webdav/". You will find a folder "a" with a subfolder "b" and a subsubfolder "c" with additional PDF-files within the folders. Start the Documents app. Connect to the cloud with the URL and the credentials given above and just download folder "a". Then have a look into the folders and subfolders. Only in folder "a" the PDF-file is downloaded als a pdf. In the subfolders the Documents app creates additional folders instead. I hope this will ultimately lead to the solution to fix this error.

Best regards
Joerg

Von meinem iPad gesendet

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

Server configuration

Operating system:

Web server:

Database:

PHP version:

Nextcloud version: (see Nextcloud admin page)

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

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.

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

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, …)

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

Are you using encryption: yes/no

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

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

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.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

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

a) The javascript console log
b) The network log
c) ...
@rajo
Copy link

rajo commented Jun 27, 2017

+1 I'm encountering exactly the same issue here; everything in the top level directory is synced perferctly but anything in a subdirectory is considered a directory even if it is a file thus breaking the document. Strangely this only happens if the directory is consiered a sync folder. If the folder sync is disabled in the documents app and one selects the nextcloud web share from the side panel directly, any file in any subdirectory can be accessed as it should. So I'm not entirely sure if it is solely nextcloud's failure here, as I as well cannot even view something in the access log when trying to access some file from a subdirectory in documents.

EDIT:
also tested against an owncloud Enterprise 9.1 -- here the error does not occur.

@FlyinFistOfJuda
Copy link

I have this problem too, tried it with Documents Version 5 and 6, same behaviour.

@critzinger
Copy link

critzinger commented Jun 29, 2017

i have the same problem see my post #5486

the problem exists since nc12 until nc11.0.3 all was perfect!

@FlyinFistOfJuda
Copy link

Hi @nickvergessen, sorry to bother, but is there any chance this issue may get into the 12.0.1 pipeline? It's quite a showstopper for workflows in environments where nextcloud is accessed via webdav clients.

@nickvergessen
Copy link
Member

If someone posts step-by-step clear instructions how to reproduce, we may have a look

@joergbormet
Copy link
Author

joergbormet commented Jul 6, 2017 via email

@FlyinFistOfJuda
Copy link

FlyinFistOfJuda commented Jul 6, 2017

I do have a step by step instruction from my company that i have to anonymize first, this may take a while. If anyone else got one or is ready to create one, it may be quicker.
@joergbormet : If the Devs opt in to test it on your server, the server may need to be running in debug level regarding rajo's comment of an empty access.log. But i guess they got some of their own :)

@rajo
Copy link

rajo commented Jul 6, 2017

Hi there,

I've put some steps to recreate together (pdf with screenshots from the documents app). Can be found here: https://www.jochem.name/nextcloud/index.php/s/vbMe1OK0uUu9S7R

And I've enabled the debug mode on my nextcloud. As far as I can see, there occur many messages like the following when starting the documents-app-webdav-sync:

rewinddir(): 88 is not a valid Directory resource at /var/www-ssl/nextcloud-12.0.0/3rdparty/icewind/streams/src/Wrapper.php#31

And in the apache logs, there seems to be no attempt to access some subdirectories by the app - just stuff from the top level directory is listed like this:

"GET /nextcloud/remote.php/webdav/ebooks/smart_home2.pdf HTTP/1.1" 200 702197 "-" "ReaddleDAV Documents/6.0.2.354 (redirects)"

If anything further is needed - just ask

@nickvergessen
Copy link
Member

Hmm, can you report this to the documents app developer? Seems to be a problem on their side.

@rajo
Copy link

rajo commented Jul 7, 2017

Been there, done that. They point fingers to nextcloud:

Our specialists have checked the case and figured out that issue is occurring on the Nextcloud
server side. Please note that as much as we'd love to help, there is nothing we can do on our side.
The thing is that your server passes the information that your files are folders, so the app draws the
folder icon. I suggest that you contact your server administrator to address this issue.

I can try again there though. I have too little knowledge of the webdav protocol to understand the expected behaviour and what kind of operations are supported and should work.

But: as I've written earlier, I have tested the very same documents app against an owncloud 9 instance and the sync worked! And the others above tell, that nextcloud versions < 12 also worked perfectly! So the claim that it is on their side doesn't seem to hold.

When diffing the nextcloud 11 and 12 versions, I can see that some pieces of code have changed in the webdav modules - although I am not in the position to tell what those changes are doing and if they could be relevant (but I wouldn't be surprised if they are ;) )

I was also so keen to try the webdav module of nc11 in nc12 but as it seems there have happened some api changes as well, so things don't fit easily and I have abandoned this.

So in short again: I suspect some changes in the webdav subsytem between nc11 and nc12 but for myself I have no experience how to debug this. If someone can provide me with some instructions / proof-of-concept code, I am willing to try it on my server.

@nickvergessen
Copy link
Member

The thing is that your server passes the information that your files are folders, so the app draws the
folder icon.

Hmm okay, but that seems to be useful information.

@nickvergessen
Copy link
Member

Can someone click that button and then look in the accesslog which path has been called? That would be very helpful. 👍

@nickvergessen
Copy link
Member

nickvergessen commented Jul 7, 2017

Do you have a link to that conversion? Or was it by email?
Because I checked our dav backend, and it correctly reports folders as:

<d:resourcetype>
    <d:collection/>
</d:resourcetype>

Files have no resource type but a mimetype as content type.

<d:getcontenttype>image/jpeg</d:getcontenttype>
<d:resourcetype/>

@rajo
Copy link

rajo commented Jul 7, 2017

Conversation was by email.

Edit: https://www.jochem.name/readdle.txt
This is the entire session of yesterday evening where I've toyed around with the sync option

@nickvergessen
Copy link
Member

Can you forward it to https://github.com/nextcloud/server/blob/master/apps/dav/lib/CalDAV/Activity/Backend.php#L3 so I can reply back to the devs of the app and ask for their calls?

@rajo
Copy link

rajo commented Jul 7, 2017

Sorry, now you've lost me :) forward what?

@nickvergessen
Copy link
Member

The email of the documents app developers 😄

@critzinger
Copy link

critzinger commented Jul 7, 2017

The error is clearly with Nextcloud 12.0.0 webdav server

I have the same problem with same answer from the manufacturer of app #5486

Until nextcloud 11.0.3 everything worked perfectly

@nickvergessen
Copy link
Member

Yeah I emailed them, to find out what their request to the server is, let's see.

@FlyinFistOfJuda
Copy link

Just my 2 cent: Perhaps this only happens with mimetype:pdf ? I only experienced the problem with these files so far.

@rajo
Copy link

rajo commented Jul 7, 2017

@FlyinFistOfJuda just tested that: created a subfolder with .doc .epub and .txt and .doc / .txt are shown as folders as well, .epub has an ?-icon and neither of them can be opened. Also makes no difference if there is only one file in the subfolder. Same error.

@blancjerome
Copy link

Hi,

I had the same problem with the brand new owncloud X and I found the way to correct it. Here is my correction submission, maybe it will help :)

owncloud/core#28341

@rajo
Copy link

rajo commented Jul 8, 2017

@blancjerome that's it! Although for nc12 the path is nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php
I applied your proposed fixes and indeed, sync to the documents app is now working.

@nickvergessen if the proposed fix doesn't break something else, I would hereby vote to include it to the next release.

Thanks for everyone's help!

@critzinger
Copy link

@blancjerome thanks for your advice

i have tested it with nc 12.0.0 and pdf expert app

now it works perfectly again

@nickvergessen
please includ the fix in the next release

@nickvergessen
Copy link
Member

@LukasReschke patch dav in our 3rdparty until sabre-dav has it merged?

@nickvergessen
Copy link
Member

@blancjerome do you want to report and fix the issue in https://github.com/fruux/sabre-dav ? Or shall I copy your solution and create a PR there?

@blancjerome
Copy link

You can report the fix to sabre-dav team.

Regards,

Jérôme

@nickvergessen
Copy link
Member

Proposed the patch at https://github.com/fruux/sabre-dav/pull/982/files

I wrote a little test, which also confirms the issue and the solution. Thanks @blancjerome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants