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

SQL UNIQUE constraint failed #286

Closed
yeya24 opened this issue Oct 12, 2021 · 1 comment
Closed

SQL UNIQUE constraint failed #286

yeya24 opened this issue Oct 12, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@yeya24
Copy link
Contributor

yeya24 commented Oct 12, 2021

Got error log from Parca server:

name=parca ts=2021-10-12T06:21:36.359750987Z caller=log.go:168 level=error protocol=grpc grpc.component=server grpc.service=parca.profilestore.v1alpha1.ProfileStoreService grpc.method=WriteRaw grpc.method_type=unary grpc.start_time=2021-10-12T06:21:36Z grpc.code=Internal grpc.error="rpc error: code = Internal desc = failed to normalize pprof: execute SQL statement: constraint failed: UNIQUE constraint failed: locations.mapping_id, locations.is_folded, locations.normalized_address, locations.lines (2067)" grpc.time_ms=109.181 finishedcall=(MISSING)

Looks like there are duplicate sets for UNIQUE (mapping_id, is_folded, normalized_address, lines) in the locations table.

@brancz brancz added the bug Something isn't working label Oct 12, 2021
@brancz
Copy link
Member

brancz commented Oct 12, 2021

Thanks for reporting! Yeah, this just needs retries, because what's happening is that two write requests are trying to create the same location, which errors in uniqueness, and one was slightly faster than the other, a retry should detect that it already exists in the database on the next attempt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants