Skip to content

Webdav download with subdirectories creates only directories #5543

Closed

Description

@joergbormet

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

Activity

  1. rajo commented on Jun 27, 2017

    @rajo

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

  2. FlyinFistOfJuda commented on Jun 28, 2017

    @FlyinFistOfJuda

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

  3. critzinger commented on Jun 29, 2017

    @critzinger

    i have the same problem see my post #5486

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

  4. FlyinFistOfJuda commented on Jul 6, 2017

    @FlyinFistOfJuda

    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.

  5. nickvergessen commented on Jul 6, 2017

    @nickvergessen
    Member

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

  6. joergbormet commented on Jul 6, 2017

    @joergbormet
    Author
  7. FlyinFistOfJuda commented on Jul 6, 2017

    @FlyinFistOfJuda

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

  8. rajo commented on Jul 6, 2017

    @rajo

    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

  9. nickvergessen commented on Jul 7, 2017

    @nickvergessen
    Member

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

  10. rajo commented on Jul 7, 2017

    @rajo

    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.

  11. nickvergessen commented on Jul 7, 2017

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

  12. nickvergessen commented on Jul 7, 2017

    @nickvergessen
    Member

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

  13. nickvergessen commented on Jul 7, 2017

    @nickvergessen
    Member

    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/>
  14. rajo commented on Jul 7, 2017

    @rajo

    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

  15. nickvergessen commented on Jul 7, 2017

    @nickvergessen
    Member
  16. 7 remaining items

  17. rajo commented on Jul 8, 2017

    @rajo

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

  18. critzinger commented on Jul 9, 2017

    @critzinger

    @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

  19. nickvergessen commented on Jul 11, 2017

    @nickvergessen
    Member

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

  20. nickvergessen commented on Jul 11, 2017

    @nickvergessen
    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?

  21. blancjerome commented on Jul 11, 2017

    @blancjerome

    You can report the fix to sabre-dav team.

    Regards,

    Jérôme

  22. nickvergessen commented on Jul 13, 2017

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

  23. added this to the Nextcloud 13 milestone on Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3. to reviewbugfeature: dav

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions