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

Foreign key constraint violation when targets.(Service).deleteFromRepo #2064

Closed
jakubbujny opened this issue May 9, 2022 · 3 comments · Fixed by #2065
Closed

Foreign key constraint violation when targets.(Service).deleteFromRepo #2064

jakubbujny opened this issue May 9, 2022 · 3 comments · Fixed by #2065
Assignees

Comments

@jakubbujny
Copy link

Describe the bug
Boundary v0.8.0
boundary targets delete -id XXX
gives

Error from controller when performing delete on target

Error information:
  Kind:                Internal
  Message:             targets.(Service).deleteFromRepo: unable to delete target: target.(Repository).DeleteTarget: db.DoTx: target.(Repository).DeleteTarget: db.Delete: insert or update on table "session_state" violates foreign key constraint
  "session_valid_state_enm_fkey": integrity violation: error #1003
  Status:              500
  context:             Error from controller when performing delete on target

To Reproduce
I'm not sure how to reproduce it exactly - we did the upgrade from 0.7.0 to 0.8.0
It seems only some part of targets is affected (these created in 0.7.0) - when I create new "test" target I'm able to delete it.

@jakubbujny
Copy link
Author

I found now that we have the same problem for the host-sets

boundary host-sets delete -id hsst_q5cqOuwUja
Error from controller when performing delete on host set

Error information:
  Kind:                Internal
  Message:             host_sets.(Service).deleteFromRepo: unable to delete host: static.(Repository).DeleteSet: delete failed for hsst_q5cqOuwUja: db.DoTx: static.(Repository).DeleteSet: db.Delete: insert or update on table "session_state"
  violates foreign key constraint "session_valid_state_enm_fkey": integrity violation: error #1003
  Status:              500
  context:             Error from controller when performing delete on host set

@irenarindos irenarindos self-assigned this May 9, 2022
@irenarindos
Copy link
Collaborator

Thanks for reporting this! I've been able to recreate it & am working on a fix.

@irenarindos
Copy link
Collaborator

Thanks again- this has been fixed in #2065 and will be in our next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants