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

Seeing on conflict errors in the database logs in docker #1466

Closed
mooreds opened this issue Oct 29, 2021 · 1 comment
Closed

Seeing on conflict errors in the database logs in docker #1466

mooreds opened this issue Oct 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mooreds
Copy link
Collaborator

mooreds commented Oct 29, 2021

Seeing on conflict errors in the database logs in docker

Description

After I run the vanilla docker compose install for a while (noticed it this morning, started docker yesterday) I see these errors in stdout:

db_1          | 	    ON CONFLICT (applications_id, hour) DO UPDATE SET count = application_registration_counts.count + EXCLUDED.count, decremented_count = application_registration_counts.decremented_count + EXCLUDED.decremented_count
db_1          | 2021-10-29 16:21:32.246 UTC [7313] ERROR:  insert or update on table "application_registration_counts" violates foreign key constraint "application_registration_counts_fk_1"
db_1          | 2021-10-29 16:21:32.246 UTC [7313] DETAIL:  Key (applications_id)=(cbc4db19-8f9b-46dd-807e-105b7f1fb525) is not present in table "applications".
db_1          | 2021-10-29 16:21:32.246 UTC [7313] STATEMENT:  INSERT INTO application_registration_counts (applications_id, count, decremented_count, hour) VALUES
db_1          | 	      
db_1          | 	      ($1, $2, $3, $4)
db_1          | 	     , 
db_1          | 	      ($5, $6, $7, $8)
db_1          | 	     
db_1          | 	    ON CONFLICT (applications_id, hour) DO UPDATE SET count = application_registration_counts.count + EXCLUDED.count, decremented_count = application_registration_counts.decremented_count + EXCLUDED.decremented_count
db_1          | 2021-10-29 16:24:26.082 UTC [7322] ERROR:  insert or update on table "application_registration_counts" violates foreign key constraint "application_registration_counts_fk_1"
db_1          | 2021-10-29 16:24:26.082 UTC [7322] DETAIL:  Key (applications_id)=(cbc4db19-8f9b-46dd-807e-105b7f1fb525) is not present in table "applications".
db_1          | 2021-10-29 16:24:26.082 UTC [7322] STATEMENT:  INSERT INTO application_registration_counts (applications_id, count, decremented_count, hour) VALUES

Happens every 10ish minutes.

Affects versions

1.30.2

Steps to reproduce

See above. No certain steps.

I did delete a tenant with an application in this instance. So maybe it is:

  • create tenant
  • create application
  • delete tenant
  • see error

But I'm not sure.

Expected behavior

No error messages.

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

Docker-compose, postgresql

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

Additional context

A user had a similar issue: https://fusionauth.io/community/forum/topic/1334/error-in-global-registration-counts

@mooreds mooreds added the bug Something isn't working label Oct 29, 2021
@robotdan
Copy link
Member

robotdan commented Nov 1, 2021

We'll take a look, we are doing some of this async now to improve performance. It is likely related to deleting the tenant, maybe we aren't properly clearing out pending counts for applications that will be deleted as the result of deleting the tenant.

@robotdan robotdan self-assigned this Nov 1, 2021
@robotdan robotdan added this to Backlog in FusionAuth Issues via automation Nov 1, 2021
@robotdan robotdan added this to the 1.31.0 milestone Nov 1, 2021
@robotdan robotdan assigned bguyza and unassigned robotdan Nov 2, 2021
@bguyza bguyza moved this from Backlog to In progress in FusionAuth Issues Nov 3, 2021
@bguyza bguyza moved this from In progress to Code complete in FusionAuth Issues Nov 3, 2021
FusionAuth Issues automation moved this from Code complete to Done Nov 19, 2021
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
FusionAuth Issues
  
Delivered
Development

No branches or pull requests

3 participants