Skip to content
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

Exception not catched for PostgreSQL when attaching DIDs twice. #1668

Closed
hahahannes opened this issue Oct 16, 2018 · 0 comments
Closed

Exception not catched for PostgreSQL when attaching DIDs twice. #1668

hahahannes opened this issue Oct 16, 2018 · 0 comments
Assignees
Milestone

Comments

@hahahannes
Copy link
Contributor

hahahannes commented Oct 16, 2018

Motivation

While running the test of this PR, I encountered an exception only with PostgreSQL as database, that is not catched. It raised after tryting to attach a dataset to a container twice.

rucio add-container mock:container
rucio add-dataset mock:dataset
rucio attach mock:container mock:dataset
rucio attach mock:container mock:dataset

ERROR	An unknown exception occurred.
Details: [u'(psycopg2.IntegrityError) duplicate key value violates unique constraint "CONTENTS_PK"\nDETAIL:  Key (scope, name, child_scope, child_name)=(mock, co, mock, da) already exists.\n']

With other databases a DuplicateContent gets thrown.

Modification

I would add it to the pattern matching of the IntegrityError here

@hahahannes hahahannes self-assigned this Oct 16, 2018
@bari12 bari12 added this to the 1.18.4 milestone Oct 16, 2018
bari12 added a commit that referenced this issue Oct 16, 2018
…tegrity_exception

Core & Internals: added catch of PostgreSQL exception & added test; Fix #1668
bari12 added a commit that referenced this issue Oct 16, 2018
…tegrity_exception

Core & Internals: added catch of PostgreSQL exception & added test; Fix #1668
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants