ON CONFLICT (hour) DO UPDATE SET count = global_registration_counts.count + EXCLUDED.count, decremented_count = global_registration_counts.decremented_count + EXCLUDED.decremented_count
[24266]:ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
[24266]:HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
[24266]:STATEMENT: INSERT INTO global_registration_counts (count, decremented_count, hour) VALUES
Posts made by marco
-
RE: Error in global registration counts
-
RE: Error in global registration counts
Hey Dan!
Thanks again for the time to respond.
We are running the latest version of FusionAuth: 1.30.2 and Postgres version 11.12.Currently we are not on a support plan, as our app is quite simple yet.
But I appreciate if you have any direction for us to check.Thanks!
-
RE: Error in global registration counts
More details on error:
PM ERROR com.inversoft.scheduler.LogAndRetainFailureHandler - The scheduled service [class io.fusionauth.api.service.authentication.RegistrationCounterAggregator] failed but will be re-run. ### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time ### The error may exist in io/fusionauth/api/domain/RegistrationCountMapper.xml ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: INSERT INTO global_registration_counts (count, decremented_count, hour) VALUES (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) , (?, ?, ?) ON CONFLICT (hour) DO UPDATE SET count = global_registration_counts.count + EXCLUDED.count, decremented_count = global_registration_counts.decremented_count + EXCLUDED.decremented_count ### Cause: org.postgresql.util.PSQLException: ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time
-
Error in global registration counts
Hello guys.
We are having some issues with FusionAuth's logs and counts.
Logged error is:ON CONFLICT (hour) DO UPDATE SET count = global_registration_counts.count + EXCLUDED.count, decremented_count = global_registration_counts.decremented_count + EXCLUDED.decremented_count [4576]:ERROR: ON CONFLICT DO UPDATE command cannot affect row a second time [4576]:HINT: Ensure that no rows proposed for insertion within the same command have duplicate constrained values.
Can you help us fix it?
-
RE: [ERROR] FusionAuth's login page redirecting issue on Android
Hey mgetka.
Sorry for the delay. Yes, we are using pseudo URLs.
Is there anything we can try?Thanks!
-
[ERROR] FusionAuth's login page redirecting issue on Android
Hey guys.
We are using FusionAuth's login page for our mobile application.
As our users are using the app, we found out that there is a redirecting issue when we log in using Google Provider on Android phones.
After the user is logged in (we think it is), the page keeps loading and waiting for a page redirection;
So we close the app and try to log in again, and the user is automatically redirected (because it is already logged in).
Can you guys help us out?
Video link: https://www.icloud.com/iclouddrive/0rJB--7z6KA_NI6iC1CgVsbBw#google_login_error
Other info:
FusionAuth's Version: 1.19.8 -
Webhook on user creation using social logins
Hey guys.
We are trying to send a welcome email when the user first registers to our application.
But when users login using social providers (ex: facebook), we cannot see "user.create.registration" webhook fire.Is there a better way of doing this??
-
RE: JWT token with roles
@dan said in JWT token with roles:
"applicationId": "ffbbef97-a2c0-49eb-990d-bd6e96acf2f9",
"roles": [
"USER"
]Hey Dan!
Now we got it working.
For reference, we were not passing applicationId inside the request body, that's why the roles were not included in the token.
Thanks again for the time Dan!
-
RE: JWT token with roles
Hey Dan!
So let me answer one by one:
- I am logging the user using Facebook, Google and Apple with FusionAuth's UI;
- The version we are using is 1.19.8;
-
RE: JWT token with roles
Hey Dan!
Have you added any roles to your FusionAuth application? Those roles should be put into the JWT automatically.
Yes, we added one role on the application (USER), but still, there is no "roles" claim inside the token.
Any advice on where to look Dan?
Thanks again.
-
JWT token with roles
Re: Implementing a Role-Based Access System for Authorization
Hey everyone.
We have a question about JWTs and roles;
Our application is an admin panel which uses FusionAuth's Login API for authentication, and every other request will hit our own back-end;
We need to protect endpoints by using the roles that are decoded from the token, and there is none;
So I ask you guys:
-
Is it wrong to put it like that?
-
If not, how should we include the roles inside the token, knowing that on the docs, the claim "roles" is reserved? (https://fusionauth.io/docs/v1/tech/lambdas/jwt-populate)
Thank you!
-
-
RE: Social login with Flutter App
Hey Dan.
I just wanted to thank you for the support.
We are now using FusionAuth login pages directly (as you suggested), and it works perfectly!
For reference, we used this flutter package: https://pub.dev/packages/flutter_appauth/example
Thank you again!
-
RE: Social login with Flutter App
Hey dan, thanks for taking the time.
About your suggestion, we tried to login using a web client, and it works fine!
So, the next step would be to use a webview inside our flutter app, and it should work, right?
Unfortunately, we tested many flutter plugins for webviews, including the official one, but they all have some issues with the keyboard (most are experimental), and that will block users from logging in, because they can't type their passwords.
About the token validation error I mentioned on the first question, as flutter generates native apps, we used the mobile token provided by google developer, and that does not work because fusion auth expects a web token instead. After that experience, we tried to find a solution using the web token, but we end up with the problems above.
That is why we asked if fusion auth would allow and validate mobile tokens. I hope someone in the community have already used fusion auth social login within a flutter app.
-
Social login with Flutter App
Hey there!
We are having some difficulties with social login inside our flutter app.
Whenever we try to login using Google (for example) we are able to get the token inside the app, but when it goes through Fusion Auth there is an error.
The logged error is:
Request to the [https://www.googleapis.com/oauth2/v3/tokeninfo] endpoint failed. Status code [400]. Error response is { "error_description" : "Invalid Value" }
Is there a way to use iOS/Android tokens inside FusionAuth?
We think that might be the problem, but if you have any suggestion would be nice.
Thank you guys.