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

Sync Failure due to Precondition Failed #18515

Closed
kalletabur opened this issue Aug 24, 2015 · 9 comments
Closed

Sync Failure due to Precondition Failed #18515

kalletabur opened this issue Aug 24, 2015 · 9 comments

Comments

@kalletabur
Copy link

kalletabur commented Aug 24, 2015

Similar issues seems to have reported before Sync Failure due to Precondition Failed and precondition failed (412) from the server but these are closed now and we have newer clients.

Steps to reproduce

  1. User1 created document and shared with user2.
  2. Document user2 modified is still old in user1 sync folder on computer.
  3. In web browser, its showing the modifications user2 made. Owncloud client insists that everything is up to date.
  4. Then user1 made some modifications on the file in his computer and then initiated sync

Expected behaviour

Owncloud should be able to resolve the conflict.

Actual behaviour

Error file is created, precondition error is replied

6.05.2015 11:42User1/Exainf.docx ownCloud Downloaded, renamed conflicting file7.9 KiB
6.05.2015 11:42User1/Exainf.docx ownCloud Error downloading https://owncloud.example.com/remote.php/webdav/User1/Exainf.docx - server replied: Precondition failed (An If-Match header was specified, but none of the specified the ETags matched.)12 KiB 

Server configuration

Operating system:
Debian 7.8

Web server:
NGINX 1.2.1-2.2+wheezy3

Database:
MySQL 5.5.44-0+deb7u1

PHP version:
PHP 5.4.41-0+deb7u1

ownCloud version: (see ownCloud admin page)
8.0.2-8

Updated from an older ownCloud or fresh install:
updated

List of activated apps:

Enabled:
 - activity
 - files
 - files_encryption
 - files_locking
 - files_pdfviewer
 - files_sharing
 - files_texteditor
 - files_trashbin
 - files_versions
 - files_videoviewer
 - firstrunwizard
 - gallery
 - user_ldap
Disabled:
 - external
 - files_external
 - provisioning_api
 - templateeditor
 - user_external
 - user_webdavauth

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => '8a7s6df87as76',
  'passwordsalt' => '*** removed for security reasons',
  'trusted_domains' => 
  array (
    0 => 'oc.oc.oc',
  ),
  'datadirectory' => '/var/ocdatafolder/',
  'dbtype' => 'mysql',
  'version' => '8.0.2.0',
  'dbname' => 'ocmysqldatabase',
  'dbhost' => 'ocmysqldatabasehost',
  'dbtableprefix' => 'oc_dbtableprefix',
  'dbuser' => 'dbuser',
  'dbpassword' => '*** removed for security reasons',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'loglevel' => '0',
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => 'smtp.oc.oc',
  'mail_smtpport' => '25',
  'forcessl' => true,
  'maintenance' => false,
  'logtimezone' => 'Europe/Europe',
  'theme' => '',
  'share_folder' => '/Shared',
  'preview_libreoffice_path' => 'libreoffice',
  'secret' => '*** removed for security reasons',
);

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

Are you using encryption: yes/no
yes

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

LDAP configuration (delete this part if not used)

|appid|configkey|configvalue|
|user_ldap|cleanUpJobOffset|600|
|user_ldap|enabled|yes|
|user_ldap|has_memberof_filter_support|1|
|user_ldap|home_folder_naming_rule||
|user_ldap|installed_version|0.5.0|
|user_ldap|last_jpegPhoto_lookup|0|
|user_ldap|ldap_agent_password||
|user_ldap|ldap_attributes_for_group_search||
|user_ldap|ldap_attributes_for_user_search||
|user_ldap|ldap_backup_host||
|user_ldap|ldap_backup_port||
|user_ldap|ldap_base|DC=example,DC=local|
|user_ldap|ldap_base_groups|DC=example,DC=local|
|user_ldap|ldap_base_users|DC=example,DC=local|
|user_ldap|ldap_cache_ttl|600|
|user_ldap|ldap_configuration_active|1|
|user_ldap|ldap_display_name|displayname|
|user_ldap|ldap_dn|CN=Comp-Ownc,OU=COM,OU=Company,DC=example,DC=local|
|user_ldap|ldap_email_attr|mail|
|user_ldap|ldap_experienced_admin|0|
|user_ldap|ldap_expert_username_attr|sAMAccountName|
|user_ldap|ldap_expert_uuid_group_attr||
|user_ldap|ldap_expert_uuid_user_attr||
|user_ldap|ldap_group_display_name|cn|
|user_ldap|ldap_group_filter|(&(|(objectclass=group))(|(cn=Dev)(CN=Comp-Ownc)(cn=Comp-admis)))|
|user_ldap|ldap_group_filter_mode|0|
|user_ldap|ldap_group_member_assoc_attribute|member|
|user_ldap|ldap_groupfilter_groups|Comp-DevComp-Owncloud Comp-admis|
|user_ldap|ldap_groupfilter_objectclass|group|
|user_ldap|ldap_host|dc300|
|user_ldap|ldap_login_filter|(&(&(|(objectclass=person))(|(memberof=CN=Comp-Ownc,OU=DL,OU=Company,DC=example,DC=local)(memberof=CN=Comp-Dev,OU=DL,OU=Company,DC=example,DC=local)(memberof=CN=Comp-admis,OU=DL,OU=Company,DC=example,DC=local)))(samaccountname=%uid))|
|user_ldap|ldap_login_filter_mode|0|
|user_ldap|ldap_loginfilter_attributes||
|user_ldap|ldap_loginfilter_email|0|
|user_ldap|ldap_loginfilter_username|1|
|user_ldap|ldap_nested_groups|0|
|user_ldap|ldap_nocase|1|
|user_ldap|ldap_override_main_server|0|
|user_ldap|ldap_paging_size|500|
|user_ldap|ldap_port|389|
|user_ldap|ldap_quota_attr||
|user_ldap|ldap_quota_def||
|user_ldap|ldap_tls|0|
|user_ldap|ldap_turn_off_cert_check|1|
|user_ldap|ldap_user_filter_mode|1|
|user_ldap|ldap_userfilter_groups||
|user_ldap|ldap_userfilter_objectclass||
|user_ldap|ldap_userlist_filter|(&(|(objectclass=person))(|(memberof=CN=Comp-Ownc,OU=DL,OU=Company,DC=example,DC=local)(memberof=CN=Comp-Dev,OU=DL,OU=Company,DC=example,DC=local)(memberof=CN=Comp-SystemAdministrators,OU=DL,OU=Company,DC=example,DC=local)))|
|user_ldap|ocsid|166061|
|user_ldap|types|authentication|

Client configuration

Browser:
FireFox

Operating system:
Windows 8.1

OwnCloud Client
1.8.4

Logs

ownCloud log (data/owncloud.log)

``{"reqId":"a8s7df98as9df87a9s8","remoteAddr":"10.10.10.10","app":"webdav","message":"Exception: {\"Message\":\"An If-Match header was specified, but none of the specified the ETags matched.\",\"Code\":0,\"Trace\":\"
#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/connector\\\/sabre\\\/server.php(70): Sabre\\\\DAV\\\\Server->checkPreconditions(false)\\n
#1 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(878): OC_Connector_Sabre_Server->checkPreconditions()\\n
#2 [internal function]: Sabre\\\\DAV\\\\Server->httpPut('User1\\\/Ex ...')\\n
#3 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(474): call_user_func(Array, 'User1\\\/Ex ...')\\n
#4 \\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php(214): Sabre\\\\DAV\\\\Server->invokeMethod('PUT', 'User1\\\/Ex ...')\\n
#5 \\\/var\\\/www\\\/owncloud\\\/apps\\\/files\\\/appinfo\\\/remote.php(61): Sabre\\\\DAV\\\\Server->exec()\\n
#6 \\\/var\\\/www\\\/owncloud\\\/remote.php(54): require_once('\\\/var\\\/www\\\/ownclo...')\\n
#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/Sabre\\\/DAV\\\/Server.php\",\"Line\":1962}","level":0,"time":"2015-05-06T11:42:38+03:00","method":"PUT","url":"\/remote.php\/webdav\/User1\/Exainf.docx"}
@PVince81
Copy link
Contributor

The conflict situation is normal. If the client of user1 did not download the latest version, and at this time user1 makes changes to the document, it is technically a conflict.

The issue here is rather the question why the client of user1 did not download in the first place.
I suspect that it could be an etag propagation issue

@PVince81
Copy link
Contributor

Etag propagation has been reworked and improved in 8.1.1 (see #14726). You could also try 8.0.6 but I'm not sure if it will improve there.

@PVince81
Copy link
Contributor

If you can provide more details about the path names of the shared files, from the point of view of user1 and from the point of view of user2, I might be able to tell you if this is the situation where this bug happens.

@kalletabur
Copy link
Author

Is this view suitable?

/ownclouddatadirectory/user2/files_encryption/keys/Shared/Exainf.docx
/ownclouddatadirectory/user2/files_encryption/keys/Shared/Exainf.docx/fileKey
/ownclouddatadirectory/user2/files_encryption/keys/Shared/Exainf.docx/user2.shareKey

/ownclouddatadirectory/user1/user1datafolder/keyfiles/User1/Exainf.docx.key

/ownclouddatadirectory/user1/user1datafolder/share-keys/User1/Exainf.docx.recovery_83kjh34c.shareKey
/ownclouddatadirectory/user1/user1datafolder/share-keys/User1/Exainf.docx.user1.shareKey

/ownclouddatadirectory/user1/files_encryption/keys/User1/Exainf.docx
/ownclouddatadirectory/user1/files_encryption/keys/User1/Exainf.docx/fileKey
/ownclouddatadirectory/user1/files_encryption/keys/User1/Exainf.docx/user2.shareKey
/ownclouddatadirectory/user1/files_encryption/keys/User1/Exainf.docx/recovery_83kjh34c.shareKey
/ownclouddatadirectory/user1/files_encryption/keys/User1/Exainf.docx/user1.shareKey

/ownclouddatadirectory/user1/files/User1/Exainf.docx

/ownclouddatadirectory/user1/files_versions/User1/Exainf.docx.v1418641549
/ownclouddatadirectory/user1/files_versions/User1/Exainf.docx.v1418642796
/ownclouddatadirectory/user1/files_versions/User1/Exainf.docx.v1419248125

@kalletabur
Copy link
Author

@PVince81 Any updates on this?

@kalletabur
Copy link
Author

If @PVince81 cannot help on this maybe someone else has ideas?

@PVince81
Copy link
Contributor

I think this is fixed in 8.1.3, you might want to retest with that version.

There isn't much to be done for older versions as the improved etag propagation code cannot be backported. If you still see this issue in 8.1.3 with the same sharing configuration then it might be a different issue.

@PVince81
Copy link
Contributor

Please let me know if you still have this issue in 8.2.3 or 9.0.1.

@lock
Copy link

lock bot commented Aug 2, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants