alex-phillips / clouddrive-php

Amazon Cloud Drive API and CLI for PHP
MIT License
36 stars 9 forks source link

Integrity constraint violation: 19 column id is not unique #11

Closed untoreh closed 9 years ago

untoreh commented 9 years ago

when uploading directories

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 19 column id is not unique' in :
Stack trace:
#0 /usr/share/php/vendor/j4mie/idiorm/idiorm.php(429): PDOStatement->execute()
#1 /usr/share/php/vendor/j4mie/idiorm/idiorm.php(2004): ORM::_execute()
#2 /usr/share/php/vendor/alex-phillips/clouddrive/src/CloudDrive/Cache/SQL.php(194): ORM->save()
#3 /usr/share/php/vendor/alex-phillips/clouddrive/src/CloudDrive/CloudDrive.php(652): CloudDrive\Cache\SQL->saveNode()
#4 /usr/share/php/vendor/alex-phillips/clouddrive/src/CloudDrive/CloudDrive.php(546): CloudDrive\CloudDrive->uploadFile()
#5 /....php(19): CloudDrive\CloudDrive->uploadDirectory()
#6 {main}
alex-phillips commented 9 years ago

Try running clouddrive clearcache followed by clouddrive sync. The IDs we are storing in the database for nodes are generated by Amazon and should be unique.

Let me know if that doesn't work.

alex-phillips commented 9 years ago

@natostanco did this fix your issue?

untoreh commented 9 years ago

gotta test more, i guess the problem arises because multiple queries are run possibly at the same time, I have to try and use different temp cache for each run

alex-phillips commented 9 years ago

Ah. Well perhaps I should add in the feature of a localId to prevent collisions like this. Just not sure what the best generic method of generating this ID should be. I don't want it to be filename, cause you can have files of the same name in 2 different locations. Not path, because you could be uploading from 2 different machines.

Thoughts?

alex-phillips commented 9 years ago

@Natostanco any update on this?

alex-phillips commented 9 years ago

Closing this issue. Comment here again if this is still a problem.