Skip to content

Repetitives sync with Mac Client (again) #7774

Closed

Description

@piotr58

Hi,

This follows the post #7641 closed a little faster in my opinion.

I followed the advice of Dragotin which seemed to indicate that he had to use php-mysqlnd instead php-mysql. But the problem remains!

Here is a complete example of improper transaction log.

An example of local log of unatended sync. This file (02 Love Song.mp3) is stores since a long time, I never touch it. Look the log:

---- --logwindow log ----------------------------------------------------------
.......................
03-17 09:23:58:739 oc_module: owncloud_stat ownclouds:///remote.php/webdav/Partages-Piotr/Musiques/02 Love Song.mp3 called
03-17 09:23:58:739 csync_walker: file: ownclouds:///remote.php/webdav/Partages-Piotr/Musiques/02 Love Song.mp3
03-17 09:23:58:739 csyncdetect_update: ==> file: Partages-Piotr/Musiques/02 Love Song.mp3 - hash 7105420082254617972, mtime: 1370103920, fileId: 0016038550bf3dbe239c8
03-17 09:23:58:739 csyncdetect_update: Database entry found, compare: 1370103920 <-> 1370103920, etag: 531f03373a195 <-> 52d722bcdecd6, inode: 0 <-> 32521574
03-17 09:23:58:739 csyncdetect_update: file: Partages-Piotr/Musiques/02 Love Song.mp3, instruction: INSTRUCTION_EVAL <<=
.................................................................
03-17 09:23:58:767 oc_module: closedir method called 0x608000634820!
03-17 09:23:58:767 csync_ftw: <= Closing walk for ownclouds:///remote.php/webdav with read_from_db 0
03-17 09:23:58:767 csync_update: Update detection for remote replica took 164,71 seconds walking 9437 files.
03-17 09:23:58:767 <<#### Update end #################################################### 168116 
.................................................................
03-17 09:23:58:798 csyncmerge_algorithm_visitor: INSTRUCTION_NONE file: Partages-Piotr/Musiques/02 Love Song.mp3
.................................................................
03-17 09:23:58:927 csync_reconcile: Reconciliation for remote replica took 0,08 seconds visiting 9437 files.
03-17 09:23:58:937 Transaction Start "checkConnect" 
03-17 09:23:58:937 Columns in the current journal: ("phash", "pathlen", "path", "inode", "uid", "gid", "mode", "modtime", "type", "md5", "fileid") 
03-17 09:24:02:769 \* csync thread started 
03-17 09:24:02:769 Folder in overallStatus Message: Mirall::Folder(0x104135150) with name "ownCloud" 
03-17 09:24:02:770 Sync state changed for folder "ownCloud" : "Sync Running" 
03-17 09:24:02:770 SocketApi: Sync state changed 
03-17 09:24:02:771 SocketApi: Broadcasting to 0 listeners: "UPDATE_VIEW" 
03-17 09:23:58:987 N------N Network Limits changed! 
03-17 09:23:58:997 "INSERT OR REPLACE INTO downloadinfo (path, tmpfile, etag, errorcount) VALUES ( ? , ?, ? , ? )" "Partages-Piotr/Musiques/02 Love Song.mp3" "Partages-Piotr/Musiques/.02 Love Song.mp3.~41a7" "531f03373a195" 0 
03-17 09:23:58:997 Transaction Start "download file start" 
03-17 09:23:59:184 Content encoding ist with status 200
03-17 09:24:14:102 !!! Mirall::CheckQuotaJob created for QUrl( "https://" ) querying "/" 
03-17 09:24:14:141 "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid) VALUES ( ? , ?, ? , ? , ? , ? , ?, ? , ? , ?, ? )" 7105420082254617972 40 "Partages-Piotr/Musiques/02 Love Song.mp3" 32523501 0 0 0 "1370103920" "0" "531f03373a195" "0016038550bf3dbe239c8" 
03-17 09:24:14:141 "DELETE FROM downloadinfo WHERE path=?" "Partages-Piotr/Musiques/02 Love Song.mp3" 
03-17 09:24:14:141 Transaction Start "download file start2" 
03-17 09:24:14:142 void Mirall::CSyncThread::transferCompleted(const Mirall::SyncFileItem&) "Partages-Piotr/Musiques/02 Love Song.mp3" 4 ""
.................................................................
---- End of --logwindow log ------------------------------------------------

If I understand something to this log:
1- a different checksum is found ==> NSTRUCTION_EVAL
2- the évaluation give ==> "csyncmerge_algorithm_visitor: INSTRUCTION_NONE"
3- but, in fact, it download the file...

Take a look to this file on my computer:

$ ls -l OwnCloud_plm/Partages-Piotr/Musiques/02\ Love\ Song.mp3 
-rw-r--r-- 1 piotr ird 1361559 1 jui 2013 /Users/Shared/OwnCloud_plm/Partages-Piotr/Musiques/02 Love Song.mp3
$ md5 OwnCloud_plm/Partages-Piotr/Musiques/02\ Love\ Song.mp3 
MD5 (OwnCloud_plm/Partages-Piotr/Musiques/02 Love Song.mp3) = 46d9037a3dc7c8c6c3321a69b878a125

And this file on our server:

# ls -la files/Partages-Piotr/Musiques/02\ Love\ Song.mp3

-rw-r--r-- 1 www-data www-data 1361559 juin 1 2013 files/Partages-Piotr/Musiques/02 Love Song.mp3
# md5sum files/Partages-Piotr/Musiques/02\ Love\ Song.mp3

46d9037a3dc7c8c6c3321a69b878a125 files/Partages-Piotr/Musiques/02 Love Song.mp3

As you can see, their is no differences between theese files!
Their is no log in "owncloud.log" file after "2014-03-17T08:19:29+00:00" and this sync start at "03-17 09:23:58:739".

And it's the case for 555 Mb which are not really different...

I don't understand! If these log can help you... I can also check the MySQL datables but I don't know where to see.

Best whishes

Activity

  1. karlitschek commented on Mar 18, 2014

    @karlitschek
    Contributor

    @dragotin Any idea?

  2. PVince81 commented on Mar 18, 2014

    @PVince81
    Contributor

    @piotr58 in your original post I saw you were using OC 6.0.1. and the sync client 1.5.2
    Have you tried upgrading to OC 6.0.2 and the sync client 1.5.3 ?

  3. PVince81 commented on Mar 18, 2014

    @PVince81
    Contributor

    Note: the php-mysqlnd change mentionned in the other post was a mistake and intended for a different report, see #7641 (comment)

  4. dragotin commented on Mar 18, 2014

    @dragotin
    Contributor

    see in the logfile:
    03-17 09:23:58:739 csyncdetect_update: Database entry found, compare: 1370103920 <-> 1370103920, etag: 531f03373a195 <-> 52d722bcdecd6, inode: 0 <-> 32521574
    while analyzing the remote repository, which is the one on the server.

    That shows that the server reports a different ETag than the one the client knows for the file. That happens if the file on the server changed, which results in a download. Exactly what you experience. The empty inode is ok for the server walkthrough.

    But why does the server deliver a different ETag? Was the filecache on the server rebuild? Is the file on an external storage which changed? Is the file a long term resident on your ownCloud and the server db is not consistent? @PVince81 can that happen? In that case, the rebuild of the fs-cache could help, but lets please follow @PVince81 advice on that.

    Does the download happen once or all the time?

  5. piotr58 commented on Mar 18, 2014

    @piotr58
    Author

    @PVince81 "Have you tried upgrading to OC 6.0.2 and the sync client 1.5.3 ?"
    Yes, I have update the server to 6.0.2 and my client is effectively 1.5.3 for Mac OS X.

    When I leave my home this morning OC sync 1.2 Gb, this evening 2.3 Gb... It never stop.

    After the suggestion of php_myslnd, as I would to test from scratch, I erase my local home repository and rebuild it to a new local directory from file stored on OC server. So, after that, their is no "zombies" like ".csync..." or else.

  6. piotr58 commented on Mar 18, 2014

    @piotr58
    Author

    @dragotin

    see in the logfile:

    03-17 09:23:58:739 csyncdetect_update: Database entry found, compare: 1370103920 <-> 1370103920, etag: 531f03373a195 <-> 52d722bcdecd6, inode: 0 <-> 32521574
    while analyzing the remote repository, which is the one on the server.

    That shows that the server reports a different ETag than the one the client knows for the file. That happens if the file on the server changed, which results in a download. Exactly what you experience. The empty inode is ok for the server walkthrough.

    Nobody, even me has touch any file. I was away today and, at night, I sleep :-)

    But why does the server deliver a different ETag? Was the filecache on the server rebuild? Is the file on an external storage which changed? Is the file a long term resident on your ownCloud and the server db is not consistent? @PVince81 can that happen? In that case, the rebuild of the fs-cache could help, but lets please follow @PVince81 advice on that.

    The filecache was not rebuild
    The file is not change and on a local FS
    I'll wait advice from PVince81

    Does the download happen once or all the time?

    All the time

    Thanks

  7. PVince81 commented on Mar 18, 2014

    @PVince81
    Contributor

    Does it redownload all the files or just a few of them ?

  8. PVince81 commented on Mar 18, 2014

    @PVince81
    Contributor

    Ok, on your other post you said everything.
    I still have no clue what is happening here or what could trigger this.

    Are you using the external storage app ?
    Did you set a quota ? Maybe disable it if you have one.

    In another post you mentionned that you had "numbers", "notes", etcs files. Maybe you can try remove them all from ownCloud and see if the problem persists (in case it's related somehow, who knows...).

    Another idea to try: remove all files from your ownCloud and just upload one or two, that might help finding out what happens on a smaller set of files.
    If you don't want to remove them all, you can create a separate test user and do the sync test with 1-2 files with that user.

    Here is the idea:

    1. Create a new user "testuser"
    2. Configure the sync client for that user (you can use owncloud --confdir /path/to/configdir --logfile /path/to/logfile.log to have a separate config)
    3. Copy a very small set of files into the local folder
    4. Let the sync client upload them
    5. Wait.
    6. See if the client redownloads the files.

    If the sync client redownloads them, then do the following:

    1. Once the sync client is done, close it.
    2. Have a look at the server database: select * from oc_storages, find the "numeric_id" of the test user.
    3. Do as select * from oc_filecache where storage = %numeric_id% order by path (replace the "%numeric_id%" with the id from before.
      Post the result here.
    4. Run the sync client again and close it once the sync is done, before it restarts.
    5. Redo step 3

    This way we can compare what happens before and after.

    But from what I understand, there must be something in-between that modifies the etags directly on the server.

    If the sync client works correctly, then increase the number of files and see when the redownloading starts happening.
    Maybe we can find a pattern.

    Thanks.

  9. PVince81 commented on Mar 18, 2014

    @PVince81
    Contributor

    Would also be good to see the logs (server log, sync log) at steps 3 and 5 (between sync client runs).
    I asked you to use less files because with too many files it will be hard to read the logs.

    Thanks.

  10. piotr58 commented on Mar 20, 2014

    @piotr58
    Author

    @PVince81 Thanks for all these advises. I'll try then as far I can, I would not be home until Friday...
    Meanwhile, I noticed that the same repository does not have the same fault when I am on my computer at work ... I have the same set: iMac, Mac OS X 10.9, OC 1.5.3, even I synchronizes user rsync, .... The only difference is that my work computer is connected to the same network than the server.
    I tried, last night, to replace the deposit of my home configuration with the one of my work computer. Both deposit are stored outside of my home directory (/Users/Shared/OwnCloud_PLM) but they are on the same disk than home directory, not an external one. I created a tar archive of work deposit and I have installed in my home in the house.
    Initially, after the analysis phase of the customer OC, I really thought have passed since only new files created during the day have been added :-) But it did not last :-(. Approximately half hour, OC decided to take the entire deposit (3.1 GB) and started ballet.
    I have the log file since I launched OC mod "logWindow" but it is heavy and I do not want to clutter the list.
    A question: were is stored this log file? Is it a way to force OC to write a log file?

    Best whishes

  11. PVince81 commented on Mar 20, 2014

    @PVince81
    Contributor

    Like I said above, you need to run the client as follows:
    owncloud --confdir /path/to/configdir --logfile /path/to/logfile.log
    It will create the log file in the specified location.

    Yes, to avoid a huge log file it would be better to do a test with very few files so we can maybe have a look at the DB for these files.

  12. piotr58 commented on Mar 21, 2014

    @piotr58
    Author

    @PVince81

    Like I said above, you need to run the client as follows:
    owncloud --confdir /path/to/configdir --logfile /path/to/logfile.log
    It will create the log file in the specified location.

    Ok RTFM, I should read this link: http://doc.owncloud.org/desktop/1.5/advancedusage.html

    On Mac OS X, it could also be:
    open -a /Applications/owncloud.app --args --confdir /path/to/configdir --logfile /path/to/logfile.log

    I have trying your suggestion and create a test user at work last afternoon, test it at home last evening and let it synchronize all night. This is a local user (not LDAP one), basic quota (500 Mb) with about 165 Mb of images files (.jpg) and music (.mp3).
    Their is no problems:

    • The first synchronization: Ok
    • after adding a new file: synchronization Ok
    • after adding a iWork's file (directory with data): synchronization Ok
    • all night with no activity: everything Ok
      I'll let it this week-end and see.
      At least I don't uderstand problems with iWork's pseudo file (Pages, Numbers, Keynotes). This is only a directory storage (a little bit like OpenOffice old documents) in place of archive one with all coponents of document (XML, data, description, …). In my opinion, it's not a good idea because if one of theses files is corrupted or erasing, the document is corrupted and no one can suppose it. But their is no special file or attributes in this system. Take a look of the file structure I add at the end of this message.

    I'll also test your other suggests.

    Are you using the external storage app ?

    No

    Did you set a quota ? Maybe disable it if you have one.

    Yes, a specific one (défaut 512 Mb, mine 10 Gb) I'll try this we also.

    A question:
    I use my LDAP account to test OC since OC 4. We have had an huge problem with LDAP user references when UUID were gave in place of UID. All our accounts became UUID on a simple update from 4.5 to 5.
    My question is: is our MySQL DB could be corrupted?
    May I can clean all references of my deposit on oc_filecache?
    Or erase all references of my account in all table? you must help me to do that...

    Thanks

    PS:
    Structure of Numbers file "Piles.numbers":

    `piotr@rascasse:~/Desktop$ ls -lRa Piles.numbers/
    total 608
    drwxr-xr-x@   8 piotr  ird     272 20 mar 21:09 .
    drwx------+ 113 piotr  ird    3842 20 mar 22:58 ..
    drwxr-xr-x+   2 piotr  ird      68 20 mar 21:09 Data
    -rw-r--r--@   1 piotr  ird  157450 20 mar 21:09 Index.zip
    drwxr-xr-x+   5 piotr  ird     170 20 mar 21:09 Metadata
    -rw-r--r--@   1 piotr  ird    1658 20 mar 21:09 preview-micro.jpg
    -rw-r--r--@   1 piotr  ird   14509 20 mar 21:09 preview-web.jpg
    -rw-r--r--@   1 piotr  ird  129107 20 mar 21:09 preview.jpg
     -
    Piles.numbers//Data:
    total 0
    drwxr-xr-x+ 2 piotr  ird   68 20 mar 21:09 .
    drwxr-xr-x@ 8 piotr  ird  272 20 mar 21:09 ..
     -
    Piles.numbers//Metadata:
    total 24
    drwxr-xr-x+ 5 piotr  ird  170 20 mar 21:09 .
    drwxr-xr-x@ 8 piotr  ird  272 20 mar 21:09 ..
    -rw-r--r--@ 1 piotr  ird  252 20 mar 21:09 BuildVersionHistory.plist
    -rw-r--r--@ 1 piotr  ird   36 20 mar 21:09 DocumentIdentifier
    -rw-r--r--@ 1 piotr  ird  270 20 mar 21:09 Properties.plist`
    

    And about specials attributs:

    `piotr@rascasse:~/Desktop$ xattr -prx com.apple.FinderInfo com.apple.iwork.documentIIUD.synced com.apple.quarentine Piles.numbers/
    com.apple.iwork.documentIIUD.synced: 
    xattr: No such file: com.apple.iwork.documentIIUD.synced
    com.apple.quarentine: 
    xattr: No such file: com.apple.quarentine
    Piles.numbers//Data: 
    xattr: Piles.numbers//Data: No such xattr: com.apple.FinderInfo
    Piles.numbers//Index.zip: 
    xattr: Piles.numbers//Index.zip: No such xattr: com.apple.FinderInfo
    Piles.numbers//Metadata/BuildVersionHistory.plist: 
    xattr: Piles.numbers//Metadata/BuildVersionHistory.plist: No such xattr: com.apple.FinderInfo
    Piles.numbers//Metadata/DocumentIdentifier: 
    xattr: Piles.numbers//Metadata/DocumentIdentifier: No such xattr: com.apple.FinderInfo
    Piles.numbers//Metadata/Properties.plist: 
    xattr: Piles.numbers//Metadata/Properties.plist: No such xattr: com.apple.FinderInfo
    Piles.numbers//Metadata: 
    xattr: Piles.numbers//Metadata: No such xattr: com.apple.FinderInfo
    Piles.numbers//preview-micro.jpg: 
    xattr: Piles.numbers//preview-micro.jpg: No such xattr: com.apple.FinderInfo
    Piles.numbers//preview-web.jpg: 
    xattr: Piles.numbers//preview-web.jpg: No such xattr: com.apple.FinderInfo
    Piles.numbers//preview.jpg: 
    xattr: Piles.numbers//preview.jpg: No such xattr: com.apple.FinderInfo
    Piles.numbers/: 
    xattr: Piles.numbers/: No such xattr: com.apple.FinderInfo`
    
  13. PVince81 commented on Mar 21, 2014

    @PVince81
    Contributor

    @piotr58 please don't mix different issues here.
    For the "numbers" information, please post it in #7103

    Let's focus on the syncing problem of regular files here.

    If the syncing works properly with a local user, then next step is doing the same with a LDAP user. I don't see why it would make a difference, but let's test it still to be sure.

    Please post the result for this, and replace "username" with the user.
    select * from oc_storages where id like '%username%';

    Do this for:

    1. the new non-LDAP test user
    2. the new LDAP test user
    3. your own user, the one where the re-download happens.
  14. piotr58 commented on Mar 22, 2014

    @piotr58
    Author

    @PVince81 Thanks

    If the syncing works properly with a local user, then next step is doing the same with a LDAP user. I don't see why it would make a difference, but let's test it still to be sure.

    I have an other LDAP account which were never be used :-)

    Please post the result for this, and replace "username" with the user.
    select * from oc_storages where id like '%username%';

    This give only the line with "numeric_id" corresponding to the string "home:<LDAP_UUID>". I thing you want the:
    select * from oc_filecache where storage = %numeric_id% order by path;
    for each account?

    The test LDAP account with the same set of data seem to work. I'll let it live during this night.

    Do this for:

    1. the new non-LDAP test user

    Follow the link to get the test non-LDAP account filecache DB result file: oc_filecache-testpiotr.txt (*)

    1. the new LDAP test user

    Follow the link to get the test LDAP account filecache DB result file:oc_filecache-espace_plm.txt (*)

    1. your own user, the one where the re-download happens.

    Here, their is an strange thing! The "numeric_id" in "oc_storage" corresponding to LDAP_UUID account (home::<MY_LDAP_UUID>) have no file in "oc_filecache". But their an other "numeric_id" which have an other string (local::<OC_BASE_DIRECTORY>/owncloud/data/<MY_EMAIL>/) seem to refer to my deposits... I have expuged this file of any too personal references...

    You can download it: oc_filecache-espace_mtd-expurgé.txt (*)

    Tell me if it's not you had expect.

    Thanks

    (*) : The link to shared file can't be access after 2014-03-26.

  15. piotr58 commented on Mar 23, 2014

    @piotr58
    Author

    @PVince81 Hi,
    After our test, it seem that all new accounts are normal. Only my "old" LDAP account have problems. I ask my collègues who also test OC with their LDAP account, they don't have problems. That's true they don't test OC with a lot of move...

    It's very important the actual pb can be solved. We are just to purpose this solution to our institute. We have now storage space and it will be very bad if some other users have problems like me. I must know if the origin is that I have too much test and corrupt my account or if it's a structural bug. And, at least, I must know how to solve it.

    I have a question and suggestion:
    If I understand, the only difference between tests configuration is my real LDAP account have a strange reference in MySQL DB attached with OC. It's true I have use this account to do all OC tests since OC 4.
    So, my question:
    Is it possible my account reference can be broken on MySQL DB?

    And my suggestion:
    Is it a way if I erase all references of my real LDAP account in DB in these table:

    • 'oc_ldap_user_mapping' which store LDAP users
    • 'oc_storages' which seems to store a relation between users and a 'numeric_id'. I thing I'll erase the normal reference (home::<LDAP_UUID> and the local::) (*)
    • all references attached on "numeric_id" (oc_filecache and other if need)
    • all other table if need

    If this scenario is good, I'll need your help because I don't want to brake anything...

    Best whishes

    PS:
    (*) in 'oc_storage', I have other records with number with 'Id' (eg: 209b4b7e5f703f9b4795828a2757fad8). It's not on UUID format (eg: de38957a-6dcf-1032-8350-75b60456a2b0). Is it normal?

  16. PVince81 commented on Mar 24, 2014

    @PVince81
    Contributor

    Hi @piotr58, it seems you're onto something, and this looks like the issue described here: #6493 (comment)

    The issue you're having with the "oc_storages" ids is a known issue that can happen in the following conditions:

    1. The user has been migrated from OC <= 5.0.12
      and
    2. The "data" directory has been modified / moved

    As you saw there were some hard-coded paths for your "buggy" user.
    The correct/new format for the storage id is "home::UUID".
    This issue isn't specific to LDAP and could happen to legacy non-LDAP users as well.

    The logic used by OC to find the matching "oc_storage" entry is as follows:

    1. Find an entry in the format "local::$datadir/$user".
    2. If not found, find an entry in the format "home::$user".

    If you changed the $datadir in config.php then 1) will always fail, so it goes to 2) and since it doesn't exist it creates it.

    You said that your "buggy" user has two entries:
    a) "local::$datadir/piotr"
    b) "home::piotr"

    You said that a) has entries in the "oc_filecache" but b) doesn't.
    So I suggest that you delete the "home::piotr" entry in "oc_storages", then rename "local::$datadir/piotr" to "home::piotr" in the "oc_storages" table. This should fix your particular user and avoid losing any shares you might have.

    (*) in 'oc_storage', I have other records with number with 'Id' (eg: 209b4b7e5f703f9b4795828a2757fad8). It's not on UUID format (eg: de38957a-6dcf-1032-8350-75b60456a2b0). Is it normal?

    Whenever "home::$userid" becomes too long, the $userid is replaced with a hash based on the $userid.

    Hope this helps.

    If after fixing your user, syncing works correctly, then let's mark this as duplicate of #6493

  17. PVince81 commented on Apr 10, 2014

    @PVince81
    Contributor

    @piotr58 any update on your situation ?
    I believe that newly created users won't be affected by the issue and should sync normally.

  18. PVince81 commented on Apr 10, 2014

    @PVince81
    Contributor

    Closing as duplicate of #6493
    If the sync issue still happens with newly created users, feel free to reopen.

  19. locked as resolved and limited conversation to collaborators on Nov 10, 2019
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions