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

Owncloud doesn't create versions when syncing using different Webdav client (Goodsync) #18307

Open
JH6 opened this issue Aug 14, 2015 · 22 comments

Comments

@JH6
Copy link

JH6 commented Aug 14, 2015

Steps to reproduce

  1. Setup Goodsync WebDav Client to sync with owncloud server
  2. Make one txt file containing some random text and save
  3. make sure Goodsync synced this file to the server.
  4. Change the text inside the txt file and save again
  5. make sure Goodsync synced the changed file to the server
  6. Login on the webinterface and browse to the file
  7. Check for excisting versions.
  8. Try the same thing but then with the owncloud client.

Expected behaviour

There should be multiple versions available when syncing using webdav using the goodsync client, the same as with the owncloud client.

Actual behaviour

There are no versions available when using the goodsync client but there are versions available when using the owncloud client.

Server configuration

Operating system: Ubuntu 14.04.3 server (with desktop environment installed on top)

Web server: Apache 2

Database: MySQL 5.5.44

PHP version: 5.5.9

ownCloud version: 8.1.1

Updated from an older ownCloud or fresh install: no

List of activated apps: Only the apps which are enabled by the default installation

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder
Enabled:
- activity: 2.0.1
- files: 1.1.10
- files_locking:
- files_mv: 0.8.1a
- files_pdfviewer: 0.7
- files_sharing: 0.6.2
- files_texteditor: 0.4
- files_trashbin: 0.6.3
- files_versions: 1.0.6
- files_videoviewer: 0.1.3
- firstrunwizard: 1.1
- gallery: 0.6.0
- provisioning_api: 0.2
- templateeditor: 0.1
Disabled:
- encryption
- external
- files_external
- user_external
- user_ldap
- user_webdavauth

The content of config/config.php:

'ocnbfbt1m77k', 'trusted_domains' => array ( 0 => '127.0.0.1', ), 'datadirectory' => '/ownclouddata/data', 'overwrite.cli.url' => 'http://127.0.0.1/owncloud', 'dbtype' => 'mysql', 'version' => '8.1.1.3', 'dbname' => 'owncloud', 'dbhost' => 'localhost', 'dbtableprefix' => 'oc_', 'dbuser' => 'oc_admin', 'logtimezone' => 'UTC', 'installed' => true, 'loglevel' => 0, ); **Are you using external storage, if yes which one:** no **Are you using encryption:** no **Are you using an external user-backend, if yes which one:** WebDav (goodsync) ### Client configuration **Browser: Google Chrome **Operating system:Windows 10 Pro ### Logs #### Web server error log How do I get those? Insert your webserver log here How do I get those? #### ownCloud log (data/owncloud.log) Is extremely large….. because a lot is syncing it’s difficult to find the correct sections.
@MorrisJobke
Copy link
Contributor

@schiesbn @PVince81 Usually it shouldn't matter which webdav client is used to generate versions. Do you have any idea what this could have caused?

@PVince81
Copy link
Contributor

Yes, it shouldn't matter which Webdav client is used.
Simply using the Webdav interface to upload files should trigger version creation.

It would be good to find out how GoodSync is uploading files.
@JH6 can you run a single upload and provide the matching access.log entries ?

Just guessing, maybe some clients have their own part files and instead of overwriting the files directly, they'd upload a copy into a temporary file (PUT to temp file) and then rename that file to the target file (MOVE temp file to final file). If they do that, then no versions will be created because the temp file itself didn't have any version. This is a situation that ownCloud cannot resolve because we cannot reliably decide whether overwriting a file should merge the versions or not. @schiesbn @karlitschek what do you think ?

@MorrisJobke
Copy link
Contributor

Just guessing, maybe some clients have their own part files and instead of overwriting the files directly, they'd upload a copy into a temporary file (PUT to temp file) and then rename that file to the target file (MOVE temp file to final file). If they do that, then no versions will be created because the temp file itself didn't have any version. This is a situation that ownCloud cannot resolve because we cannot reliably decide whether overwriting a file should merge the versions or not. @schiesbn @karlitschek what do you think ?

I also just thought about this way of handling uploads and the problems we will have with this approach.

@PVince81
Copy link
Contributor

Or should we make file overwrite through MOVE automatically keep the old versions of the overwritten file ? Might be fine to do that in case someone wants to restore to an older state before the overwrite.

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

Hi PVince81 and MorrisJobke

I made a new folder in my owncloud account called test1. synced this folder using Goodsync. Added on my computer in the synced folder a file called test2.txt with random text in that folder. Waited till on my server the clock changed time and synced this single file using owncloud. I then copied all lines from the access.log in /var/log/apache2 from that time.
I replaced my name with "user" and the IP of the server with "server_IP"

server_IP - - [17/Aug/2015:10:36:06 +0200] "OPTIONS /owncloud/remote.php/webdav/test1/ HTTP/1.1" 401 2501 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "OPTIONS /owncloud/remote.php/webdav/test1/ HTTP/1.1" 200 947 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1 HTTP/1.1" 207 1333 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/lock.gsl HTTP/1.1" 404 1005 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_v4._gs HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "GET /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_v4._gs HTTP/1.1" 200 1085 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_v4._gs HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1718 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:06 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - - [17/Aug/2015:10:36:09 +0200] "OPTIONS /owncloud/remote.php/webdav/test1/ HTTP/1.1" 401 2501 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:09 +0200] "OPTIONS /owncloud/remote.php/webdav/test1/ HTTP/1.1" 200 947 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:09 +0200] "PROPFIND /owncloud/remote.php/webdav/test1 HTTP/1.1" 207 1333 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:09 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/ HTTP/1.1" 207 1342 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:09 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_v4._gs HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:09 +0200] "DELETE /owncloud/remote.php/webdav/test1/_gsdata_/_insync_v4.gsl HTTP/1.1" 204 718 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:10 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/lock.gsl HTTP/1.1" 404 1005 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:10 +0200] "PUT /owncloud/remote.php/webdav/test1/_gsdata_/lock.gsl HTTP/1.1" 201 835 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:11 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:11 +0200] "PUT /owncloud/remote.php/webdav/test1/_gsdata_/f966ec44af959844944ff0f4e9598b3c._gstmp HTTP/1.1" 201 835 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:11 +0200] "MOVE /owncloud/remote.php/webdav/test1/_gsdata_/f966ec44af959844944ff0f4e9598b3c._gstmp HTTP/1.1" 201 748 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:12 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/test2.txt HTTP/1.1" 207 1247 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:12 +0200] "PUT /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_upload._gstmp HTTP/1.1" 201 835 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:12 +0200] "MOVE /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_upload._gstmp HTTP/1.1" 204 751 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/_file_state_v4._gs HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/_gsdata_/_cleanup.gss HTTP/1.1" 207 1259 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "PROPFIND /owncloud/remote.php/webdav/test1/ HTTP/1.1" 207 1267 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "MOVE /owncloud/remote.php/webdav/test1/_gsdata_/lock.gsl HTTP/1.1" 201 748 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "PUT /owncloud/remote.php/webdav/test1/_gsdata_/_log._gstmp HTTP/1.1" 201 835 "-" "SibSocket/9.8.5.5 (Windows 8)"
server_IP - user [17/Aug/2015:10:36:14 +0200] "MOVE /owncloud/remote.php/webdav/test1/_gsdata_/_log._gstmp HTTP/1.1" 201 748 "-" "SibSocket/9.8.5.5 (Windows 8)"

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

I also noted that goodsync makes an folder with the name _gsdata. Probably to keep track of file changes.

@PVince81
Copy link
Contributor

I see it's indeed doing PUTs and MOVEs. This confirms my theory above.
The access.log doesn't show the MOVE destination because it's in a header "Destination" so it's not clean which one of the PUT/MOVE pairs is the one that affects the final file.

Currently the only way to create versions is to do a PUT directly on the final file, which would be PUT /owncloud/remote.php/webdav/test1/test2.txt.

Regardless, this shows that there is a need to merging versions on overwrite.

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

If I see it correctly goodsync moves the file from the _gsdata folder. There is an option in owncloud to disable the use of the _gsdata folder. I will try this. Maybe with that it will work for now.

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

Tested that. Doesn't work. Still get PUT and MOVE but then not from the _gsdata anymore but from the test1 folder.
So I think that means there is currently no good solution?

@PVince81
Copy link
Contributor

No solution that wouldn't involve changing OC's behavior regarding overwriting of files.

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

Okay. Thanks for looking into this.
I'm basically using GoodSync because it supports removable media on the client side. So that when a client removes a external harddrive goodsync doesn't try to sync and when connected (regardless of drive letter, it uses the drive name) the drive syncs. The owncloud client didn't support this as far as I know. I used Goodsync in the past and that worked well for that purpouse. If I really need versioning I will use the goodsync versioning if needed.

@PVince81
Copy link
Contributor

@JH6 did you raise a feature request in the desktop client's repo ? https://github.com/owncloud/client

@JH6
Copy link
Author

JH6 commented Aug 17, 2015

Not yet. was still planing on doing so. Will do it now since I have time.

@PVince81
Copy link
Contributor

I just remembered that SabreDAV (the webdav server library) automatically deletes the file before calling the move operation. This makes it tricky if not impossible to catch. Raised here https://github.com/fruux/sabre-dav/issues/705

@devz3r0
Copy link

devz3r0 commented Sep 17, 2015

I have the same issue, but I mounted my owncloud storage via davfs/gvfs
via gvfs-mount dav://192.168.122.42/owncloud/remote.php/webdav/
and used rsync to syncronize under ubuntu.

@PVince81
Copy link
Contributor

The following changes will need to be done:

  • update Sabre version to get the fix that makes it possible to prevent deletion
  • change the behavior in OC to keep versions of the original on MOVE + overwrite

@PVince81 PVince81 added this to the 9.1-next milestone Mar 2, 2016
@PVince81
Copy link
Contributor

PVince81 commented Mar 2, 2016

Another alternative would be to change the files_versions app to use the fileid for version to file mapping. But that would be a much bigger change. @schiesbn

@PVince81 PVince81 modified the milestones: 9.1, 9.1.1 Jul 18, 2016
@luilegeant
Copy link

Hello,
Using OC 9.1, I'm having an issue and I believe the source might be identical.
I'm accessing my KeePass database through webdav using the KeePass application and I have NO version available in the OC web interface.
If the update towards 9.1.1 (or whenever this fix is release) doesn't fix the issue, I'll file a proper ticket.
I thought this note might help.
Kind regards and thank you for the great work

@PVince81 PVince81 modified the milestones: 9.1.2, 9.1.1 Sep 21, 2016
@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 20, 2016
DeepDiver1975 added a commit that referenced this issue Nov 9, 2017
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Nov 10, 2017
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Nov 14, 2017
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Nov 15, 2017
…ons - related to #18307 but needs to be addressed for MOVE
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@PVince81 PVince81 reopened this Feb 23, 2018
DeepDiver1975 added a commit that referenced this issue Apr 9, 2018
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Apr 25, 2018
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Apr 26, 2018
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue May 17, 2018
…ons - related to #18307 but needs to be addressed for MOVE
phil-davis pushed a commit that referenced this issue May 28, 2018
…ons - related to #18307 but needs to be addressed for MOVE
phil-davis pushed a commit that referenced this issue May 31, 2018
…ons - related to #18307 but needs to be addressed for MOVE
DeepDiver1975 added a commit that referenced this issue Jun 4, 2018
…ons - related to #18307 but needs to be addressed for MOVE
phil-davis pushed a commit that referenced this issue Jun 7, 2018
…ons - related to #18307 but needs to be addressed for MOVE
patrickjahns pushed a commit that referenced this issue Jun 11, 2018
…ons - related to #18307 but needs to be addressed for MOVE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants