Duplicate folders/files in Google Drive

Hi,

Files (and folders) added to odrive get duplicated (with the same name) in Google Drive. Duplicated files can’t be deleted in odrive - I do an Empty Trash and they seem to come back again a few minutes later. Any ideas for tracking the issue down?

Hi @nick,
If odrive sees that a file exists it will perform a “update” which will update the file rather than uploading a new file. The tricky thing with Google Drive is that it will freely allow you to have files with the same name in the same folder. So, if for some reason, odrive doesn’t see that the filename already exists, it will upload it as a “new” file rather than a “new version” of a file. Google will accept it, and now you have 2 files with the same name. This should not be happening, generally, though. It would take a special set of circumstances to create this type of scenario.

In general, odrive will only show the most recent file, if there are files with the same names. If you choose to delete a file, that file object should be deleted, but then you may see the next most recent file with that name. If you delete that, I would expect it to be deleted, revealing the next in line, if one exists.

Now that all of that explanation is out of the way, can you tell me if your particular scenario fits into the above? If not, are you able to reproduce the issue and then send a diagnostic from the odrive menu? I can take a close look. Please give me the path and filename of the file, also.

I just cd’ed to a folder somewhere in odrive, and did an “echo HELLO >test.txt”. Looking at it in Google Drive, I immediately got a “test.txt” and a “test (1).txt” with the same content. I just fired off a diagnostic report.

(I’m on a Mac, FWIW.)

(For duplicate files, they have the same content. For duplicate folders, one is empty.)

Hi @nick,
Do you happen to have the Google Drive client running too? The behavior I am seeing is strange and seems to indicate that there is another application in the mix here, besides odrive.

If you are running the Google Drive client also, can you shut that down and see if you can still reproduce the problem with odrive?

I installed the Google Drive (aka Backup and Sync) client very recently, to try and see what was going on. The problem was present before that - I noticed duplicate files and folders in Google Drive online after creating them via odrive.

Hi @nick,
In the case you generated above, it seemed like the Google Drive app was conflict with odrive, although it was difficult to tell exactly how.

If you temporarily shut down the Google Drive app, are you able to reproduce that case? If so, can you do so and immediately send another diagnostic?

Done and done. Same outcome (verified in Google Drive online). I’ve just fired off another diagnostic…

Hi @nick,
I took a look and the diagnostic only shows one upload being made odrive/google-drive-rave/test.txt. No activity is shown for a duplicate test (1).txt file. It doesn’t appear your odrive client, itself, is creating the additional file, unless it was created after the diagnostic was sent. In fact, the only time odrive will create its own copy of a file is in a conflict situation, and when that happens conflict is appended to the file name before it is uploaded, like test (conflict).txt.

When you look in the Google Drive web client, click on the duplicate file, and select the information icon on the top right to get the details and activity of the file, what does it show? odrive-uploaded files should odrive • in the activity listing, like this:

OK, did that. Both files uploaded by odrive.

I tried creating “newtest.txt” and didn’t get duplicates, but “test.txt” did. One possible difference is perhaps there was an old test.txt in the odrive trash?

Hi @nick,
That is correct. The odrive trash holds remote deletes until it is emptied. If there was a test.txt in odrive trash then this could cause this issue because the file still exists on the remote side and then we upload a new one alongside the old.

That might be a mitigating factor, but I just made sure the trash was empty, made sure I’d synced the deletes, created a test2.txt, and lo and behold I now have two of those as well.

Hi @nick,
Myself and QA ran lots of tests this weekend and this morning, but we weren’t able to reproduce what you are seeing here.

Something strange is going on, for sure. In the diagnostics of yours I looked at, I wasn’t able to find an instance where your odrive client actually uploaded a duplicate, although it saw the duplicate later, once it was in the cloud.

If you get a chance, can you reproduce this once more and provide the following?

  • A diagnostic (Wait a couple of minutes after reproducing)
  • A screenshot of the details and activity information for each file when viewing it from the Google Drive web client

I haven’t managed to reproduce this exact behaviour reliably, but now have a folder that someone else has shared with me which contains a handful of PDF’s (when viewed in Google Drive on the web, and the Google Drive app) but is empty in odrive. Any idea how I might track this problem down?

Hi @nick,
Do you see the files listed in the odrive web client, or are they missing there too? https://www.odrive.com/browse/

Typically files not showing up is due to certain characters or white space. Take a look at this post for more details: Why are some of my files/folders missing from odrive? (Google Drive and others)

The files are in odrive online, but not on-disk locally.

The only slightly odd character is an “&” in the top-level directory; that doesn’t appear in your excludes list, I don’t think (though it’s probably unwise).

Here’s a screen-grab video showing Google app and odrive directories, and Google Drive on the same directory as I do a file create/delete cycle:

Hi @nick,
It is the forward slash ‘/’ characters in the file names. Technically this character isn’t allowed on Mac because it is a directory delimiter.

odrive supports what the remote storage and the local storage allow and it doesn’t perform any character mapping (we used to, but it ended up causing more problems than it solved). Google Drive appears to be mapping the ‘/’ to an underscore ‘_’

To make things even more confusing, Finder makes it seem like a ‘/’ is supported, because it lets you have it in a name. What is really happening is that Finder is replacing the ‘/’ with a ‘:’ character and then displaying that as a ‘/’. You can verify this by looking at the “true” file name in a terminal session. Finder also won’t let you add a ‘:’ character to a filename… :confused:

Ah, missed that. OK, will correct, then go back to tracking down the duplicate files issue…