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
'drive' is trying to re-push a subset of files when it should not #236
Comments
While I do not receive the JSON error reported therein, probably #191 is related to this problem. I get additional copies of files when I agree to And, this problem could be specific to Linux/amd64, as well! |
Hello @odeke-em! I have verified that the subset of files that $ drive push -ignore-checksum=false |
Hello @js-ojus thank you for reporting this and welcome to drive. My apologies for the late reply. Thank you for the investigation. To start debugging what could be wrong, would you mind:
If interesting results don't come out of that and if your files are not confidential, could you please send to me a zip of them, if you don't mind? |
@odeke-em : Thanks for (re-)welcoming me! I am an existing user :-). I even reported #92 a while ago. Mime TypesHere are what Images: JPEG image data, EXIF standard Duplicates remotely?Duplicates get created when I agree to re-push. Opened somewhere else?As the upload happened, I previewed some of them for verification. But, those were not the files marked for re-push! Being
|
Hello @odeke-em! I have just now upgraded to 0.2.4 by compiling from source (latest commit). The behaviour remains the same. The same subset of files continues to be marked All of As I have already mentioned, the MD5 checksums match for both the versions (offline and online). To answer your last question, the pictures and videos are of the family and extended family, so I'm afraid I cannot share them. My apologies! |
Giving it some more thought, here is what I propose.
Please let me know your thoughts. |
Aha gotcha @js-ojus my apologies, I hadn't recognized your name. I can't seem to reproduce your issue but due to the recurrance of it, am suspecting something might not be registering with file sizes and matching checksums. I can't start to guess what the issue could be off the top of my head :( without any error messages or suspicions. |
@odeke-em : Here are my responses.
I shall try to look into the implementation, too. I have not done that so far, on account of my own schedule being full. |
To get the full build information, do |
Hello @odeke-em! This afternoon (I live in India), I spent some time debugging this. I have narrowed down the proximal cause of my woes! For each of the files marked for re-push, no corresponding index file exists in Why are indices missing for those files specifically? I have not comprehended that yet. But, this - hopefully - gives you a clue. |
That's cool, you are living in my time future. Here it is still morning :) Please try out this patch to help in debugging diff --git a/config/config.go b/config/config.go
index b7e11ae..25a0f67 100644
--- a/config/config.go
+++ b/config/config.go
@@ -103,7 +103,9 @@ func (c *Context) SerializeIndex(index *Index, p string) (err error) {
if data, err = json.Marshal(index); err != nil {
return
}
- return ioutil.WriteFile(IndicesAbsPath(p, index.FileId), data, 0600)
+ indicesPath := IndicesAbsPath(p, index.FileId)
+ fmt.Println("indicesPath: ", indicesPath)
+ return ioutil.WriteFile(indicesPath, data, 0600)
}
func (c *Context) Write() (err error) {
diff --git a/src/push.go b/src/push.go
index 9185b8b..24c8cc7 100644
--- a/src/push.go
+++ b/src/push.go
@@ -334,6 +334,7 @@ func (g *Commands) remoteMod(change *Change) (err error) {
return
}
index := rem.ToIndex()
+ g.log.Logln("index", index)
wErr := g.context.SerializeIndex(index, g.context.AbsPathOf(""))
// TODO: Should indexing errors be reported? |
@odeke-em : Some progress here. Even before I apply the patch, I have been able to reproduce the error! After When I re-ran I have not looked into the source yet, but it could probably be a case of the goroutine that encountered the error not flushing the pending writes of the indices, before exiting. |
Good morning @js-ojus, now that is interesting. Thanks for the debugging and heads up. Am taking notes for future error handling as we can see this was a silent error. |
Re-posting from #249 to re-establish the context Creation of indices has taken place as intended. Good thus far! Now, running drive push continues to mark the same set of files for a re-push. I have investigated it a little. The reason is that the 'mtime' on GDrive is set to whatever was the UTC at the time of the original push, not that of the pushed file itself. To illustrate using an example, the local file has 'mtime' 2007-11-08 18:30:02, while the corresponding copy in GDrive has 2015-06-15 17:32:56 (the time when push uploaded this file). For those files whose indices were created properly upon the first push, the local 'mtime' and the remote one match perfectly. It will be good if push and pull gained a capability (sub-command) to update the target's (remote file's metadata in the case of push, local file's index in the case of pull) 'mtime' when MD5 sums match. Alternatively, such a sub-command could exist for index itself. E.g. drive index push and drive index pull. The overriding criteria here is that MD5 sums match, but 'mtime's do not! Other cases are already handled quite well. Should you think that it is reasonable, I can create an issue for the same. |
Thanks @js-ojus for reposting, I'll do the same here: Unless some bug just crept, drive always updates the mtime derived from local file itself and this has Please let me know what you think. Btw were you able to apply the patch I had provided? |
Do you sleep at all, @odeke-em? :-) I shall get back to you shortly. |
Haha, oh yes I do sleep, I'll actually head to bed soon after releasing drive v0.2.5 in a few ;) Thanks for the work and investigations. |
@odeke-em : Glad to report that things work as they should. Upon actually Now, re-issuing Thus, in combination with PR #256, the normal Thanks for the great work! I now close this issue. |
Woot woot, this is good to know. Your investigation was very useful in helping get this resolved, thank you again and cheers! |
Please get the latest from master. Uploading is faster, there is an retry mechanism on encountering retryable errors as well. Also after passing in |
Description
Even though the files are identical in the local system and Google Drive, when
drive push
is run repeatedly, it sometimes reports that some local files need to be pushed.Steps to reproduce
drive push
.drive push
.The last step may have to be repeated several times.
Expected
Pushed files that are identical in the local system and on Google Drive should not be pushed again. Checking
md5sum
verifies that the files are indeed identical.Observed
A subset of the files get listed for push, and are marked
M
.Operating system
Ubuntu 14.04.1 LTS 64-bit
'drive' version
0.2.3
The text was updated successfully, but these errors were encountered: