basak / glacier-cli

Command-line interface to Amazon Glacier
Other
617 stars 55 forks source link

sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one() #66

Closed xloem closed 8 years ago

xloem commented 8 years ago

I've been trying to use glacier-cli with git-annex for a while and currently getting this on sync:

move SHA3_512-s78968--58aa331db254fd53cc422b6b8ba22b492cccec00b888497eb0bab8763d371b6232a854e1419190ab61685f5be82fa
be9b614cafd30f79f09044a3daea1291cfa (checking glacier...) Traceback (most recent call last):
  File "/home/annex/bin/glacier", line 737, in <module>
    main()
  File "/home/annex/bin/glacier", line 733, in main
    App().main()
  File "/home/annex/bin/glacier", line 719, in main
    self.args.func()
  File "/home/annex/bin/glacier", line 600, in archive_checkpresent
    self.args.vault, self.args.name)
  File "/home/annex/bin/glacier", line 161, in get_archive_last_seen
    result = self._get_archive_query_by_ref(vault, ref).one()
  File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2404, in one
    "Multiple rows were found for one()")
sqlalchemy.orm.exc.MultipleResultsFound: Multiple rows were found for one()
(user error (glacier ["--region=us-east-1","archive","checkpresent","glacier-c22e72f3-62a4-4c74-afe1-ad946906e3e1","--quiet","SHA3_512-s78968--58aa331db254fd53cc422b6b8ba22b492cccec00b888497eb0bab8763d371b6232a854e1419190ab61685f5be82fabe9b614cafd30f79f09044a3daea1291cfa"] exited 1)) failed
basak commented 8 years ago

Please see http://git-annex.branchable.com/bugs/Glacier_remote_uploads_duplicates/ which I think is the likely cause for your problem. If so I suggest you move this discussion to the comments section there. Or if after reading you think your root cause is different, feel free to reopen this issue here.

xloem commented 8 years ago

Well, it turns out that is my issue, but my setup is different. I have glacier locked to disallow deleting, so I cannot ever remove the duplicates. I guess perhaps I can modify glacier-cli to return success for these duplicate entries.