-
Notifications
You must be signed in to change notification settings - Fork 115
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
remove user to prevent ForeignKeyViolation #17024
base: master
Are you sure you want to change the base?
remove user to prevent ForeignKeyViolation #17024
Conversation
114ce65
to
1c361a6
Compare
trigger: test-robottelo |
PRT Result
|
This sounds like a bug in the application to me. Was one filed? |
@ekohl |
If you see a PostgreSQL error as a user, I'd consider it a bug. IMHO it should either cascade (delete any permissions the user has) or provide a proper error why the user can't be deleted. |
A bug has already been raised for this issue - https://issues.redhat.com/browse/SAT-18656. |
1c361a6
to
e831eb0
Compare
trigger: test-robottelo |
PRT Result
|
trigger: test-robottelo |
PRT Result
|
Problem -
When creating another user with a specific role and adding resources in the filter with the 'view_facts' permission, an error occurred ('PG::ForeignKeyViolation: ERROR: update or delete on table "hosts" violates foreign key constraint "fact_values_host_id_fk" on table "fact_values"') during the teardown process while deleting the host. This happened because a user with only view permissions existed for the host and making it impossible to update or delete the user associated with the fact.
Solution -
To prevent this error, the user was removed before the teardown process.