Recently my GDrive application started showing a "primary key must be unique" error message, asking me to disconnect the drive and start all over again. I did that. Took few hours to resynchronize it all. But the next day I got the same error and asked me again to repeat the operation. I have been poking the forums (including Google's forum) up and down for months and found no real solution. So I had to do the job on my own. This is how to fix the "primary key must be unique" error:
- Start Google Drive
- Hold the SHIFT key pressed while clicking the Google Drive systray icon. This will show the 'Enable diagnostic mode' special menu.
- Click 'Enable diagnostic mode' menu.
- Wait until Google Drive crashes and shows the "primary key must be unique"error message. Let the application shutdown.
- Go to "c:\Users\YOUR_USER_NAME\AppData\Local\Google\Drive" folder and open "sync_log.log".
Note: Replace 'YOUR_USER_NAME' with your Windows account name (the account in which you are logged in). You can see this name when you press the 'Start' button.
- Look up this text: "Detected conflict while trying to download file to".
- After 'to' follows the name of the file that generated the conflict. Locate that file and delete it or (better) rename it. Do this for all conflicted files (if there are more than one).
- Restart Google Drive.
Update 1 - How to do it on Mac OS (thanks to Maik):
Thanks, this fix also works for Apple Mac OS-X.
To get to the log file:
- in finder click the Go menu
- with the menu open click ALT-key so the hidden Library item appears
- open the Library and go to folder Google -> Drive
Update 2 - More GDrive bugs: The trash cannot be purged
Now my Google Drive account shows that is 95% full even if I don't have many files loaded in GDrive (I have a total of 1.1GB). After investigation I have discovered that are files locked in the 'Trash' that cannot be deleted. I contacted Google Drive support and they said they will fix my account. The provided additional Google Drive space so I can keep using my GDrive until they will fix the problem. That was in February 2012. Still no word from them.
Update 3 - How to make GDrive synchronize faster?
How to improve the Google Drive synchronize speed?
With this occasion I want to thanks Google team for the fucking 'good' job they did and to tell them: I don't believe in witches, but they surely exist.