Database constraint errors when starting 0.7.4 controller

After upgrading to Boundary 0.7.4, I’m getting the following error when starting controller services:

{"id":"4KRY3eqGTA","source":"https://hashicorp.com/boundary/docker-controller","specversion":"1.0","type":"error","data":{"error":"db.Query: duplicate key value violates unique constraint \"job_pkey\": unique constraint violation: integrity violation: error #1002","error_fields":{"Code":1002,"Msg":"","Op":"db.Query","Wrapped":{"Code":1002,"Msg":"duplicate key value violates unique constraint \"job_pkey\"","Op":"","Wrapped":{"Code":1002,"Msg":"unique constraint violation","Op":"","Wrapped":null}}},"id":"e_mn7b9o33gg","version":"v0.1","op":"db.Query"},"datacontentype":"application/cloudevents","time":"2022-02-09T21:09:18.7497072Z"}

These errors seem to be coming from the controller trying to insert duplicate values in the “job” table at startup, as clearing that table allows for the service to be started without issues (at least for that run - subsequent restarts bring the error back again).

This seems to have been introduced on 0.7.4, as I tested with 0.6.2, 0.7.2 and 0.7.4 and haven’t had this issue.

Is this a known issue and can it be disregarded as a transient error or can this have additional impacts to the functionality of boundary 0.7.4?

Thanks for the help and for developing such an awesome app!!!

Hey @glmacedo1 thanks for using Boundary and providing feedback!

The error you are seeing is expected as Boundary will attempt to register jobs each time it starts up; therefore, if the job was registered in a previous run it gets the unique violation error. While the scheduler code does suppress this error, the db.Query op is still logging it as part of events when wrapping any error received from the database.

In an effort to reduce noise I will look into this, but for now you can ignore that specific error.

This should now be resolved in the next release of Boundary.