FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Error in global registration counts

    Scheduled Pinned Locked Moved
    General Discussion
    0
    6
    700
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      marco
      last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • M
        marco
        last edited by

        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
        
        
        1 Reply Last reply Reply Quote 0
        • danD
          dan
          last edited by

          @marco

          Hmmm, haven't seen this before.

          What version of FusionAuth are you running? What database (name and version)?

          If you have purchased support, please open a ticket: https://account.fusionauth.io/account/support/

          --
          FusionAuth - Auth for devs, built by devs.
          https://fusionauth.io

          1 Reply Last reply Reply Quote 0
          • M
            marco
            last edited by

            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!

            1 Reply Last reply Reply Quote 0
            • M
              marco
              last edited by

              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
              
              1 Reply Last reply Reply Quote 0
              • danD
                dan
                last edited by

                Hmmm. I saw a similar issue and filed a bug: https://github.com/FusionAuth/fusionauth-issues/issues/1466

                Feel free to file a bug with reproducible steps in the issues repository or add comments to #1466 if you have any more info.

                --
                FusionAuth - Auth for devs, built by devs.
                https://fusionauth.io

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post