DB Error: constraint violation on anonymous user contribution/membership registration after 5.8.2 -> 5.9.0...












1















I upgraded two Joomla sites from 5.8.x to 5.9 and one of them now gives an error for anonymous contributions or membership registrations:



Error:



Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452


Additional Details:



Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)



[code] => -3
[message] => DB Error: constraint violation
[mode] => 16
[debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[type] => DB_Error
[user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
[to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]


)



This matches a similar issue after 5.9.0 upgrade: DB Error: constraint violation on anonymous user event registration after 5.8.2 -> 5.9.0 update



I have Mail enabled. The error doesn't occur when logged in so I've matched and then enabled more permissions than the other site which works, but it makes no difference.










share|improve this question



























    1















    I upgraded two Joomla sites from 5.8.x to 5.9 and one of them now gives an error for anonymous contributions or membership registrations:



    Error:



    Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452


    Additional Details:



    Array
    (
    [callback] => Array
    (
    [0] => CRM_Core_Error
    [1] => handle
    )



    [code] => -3
    [message] => DB Error: constraint violation
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]


    )



    This matches a similar issue after 5.9.0 upgrade: DB Error: constraint violation on anonymous user event registration after 5.8.2 -> 5.9.0 update



    I have Mail enabled. The error doesn't occur when logged in so I've matched and then enabled more permissions than the other site which works, but it makes no difference.










    share|improve this question

























      1












      1








      1








      I upgraded two Joomla sites from 5.8.x to 5.9 and one of them now gives an error for anonymous contributions or membership registrations:



      Error:



      Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452


      Additional Details:



      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )



      [code] => -3
      [message] => DB Error: constraint violation
      [mode] => 16
      [debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
      [type] => DB_Error
      [user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
      [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]


      )



      This matches a similar issue after 5.9.0 upgrade: DB Error: constraint violation on anonymous user event registration after 5.8.2 -> 5.9.0 update



      I have Mail enabled. The error doesn't occur when logged in so I've matched and then enabled more permissions than the other site which works, but it makes no difference.










      share|improve this question














      I upgraded two Joomla sites from 5.8.x to 5.9 and one of them now gives an error for anonymous contributions or membership registrations:



      Error:



      Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452


      Additional Details:



      Array
      (
      [callback] => Array
      (
      [0] => CRM_Core_Error
      [1] => handle
      )



      [code] => -3
      [message] => DB Error: constraint violation
      [mode] => 16
      [debug_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
      [type] => DB_Error
      [user_info] => INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
      [to_string] => [db_error: message="DB Error: constraint violation" code=-3 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(0, 0, 'View') [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`zzz`.`civicrm_acl_contact_cache`, CONSTRAINT `FK_civicrm_acl_contact_cache_user_id` FOREIGN KEY (`user_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]


      )



      This matches a similar issue after 5.9.0 upgrade: DB Error: constraint violation on anonymous user event registration after 5.8.2 -> 5.9.0 update



      I have Mail enabled. The error doesn't occur when logged in so I've matched and then enabled more permissions than the other site which works, but it makes no difference.







      joomla error acl update






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 16 at 20:18









      NicNic

      34018




      34018






















          2 Answers
          2






          active

          oldest

          votes


















          5














          This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?



          If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.



          Cheers



          Pradeep






          share|improve this answer
























          • Thanks alot Pradeep, that solves the issue. I've commented on the PR.

            – Nic
            Jan 16 at 20:58



















          0














          This is fixed in 5.9.1 ............






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "605"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcivicrm.stackexchange.com%2fquestions%2f28096%2fdb-error-constraint-violation-on-anonymous-user-contribution-membership-registr%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            5














            This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?



            If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.



            Cheers



            Pradeep






            share|improve this answer
























            • Thanks alot Pradeep, that solves the issue. I've commented on the PR.

              – Nic
              Jan 16 at 20:58
















            5














            This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?



            If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.



            Cheers



            Pradeep






            share|improve this answer
























            • Thanks alot Pradeep, that solves the issue. I've commented on the PR.

              – Nic
              Jan 16 at 20:58














            5












            5








            5







            This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?



            If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.



            Cheers



            Pradeep






            share|improve this answer













            This is a core bug and Eileen has send a PR for the fix. Will you be able to try by applying the patch from here?



            If the patch works for you than please comment your test result on PR so that it will speed up process of merging into core and having it available in next release.



            Cheers



            Pradeep







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 16 at 20:28









            Pradeep NayakPradeep Nayak

            11.2k1520




            11.2k1520













            • Thanks alot Pradeep, that solves the issue. I've commented on the PR.

              – Nic
              Jan 16 at 20:58



















            • Thanks alot Pradeep, that solves the issue. I've commented on the PR.

              – Nic
              Jan 16 at 20:58

















            Thanks alot Pradeep, that solves the issue. I've commented on the PR.

            – Nic
            Jan 16 at 20:58





            Thanks alot Pradeep, that solves the issue. I've commented on the PR.

            – Nic
            Jan 16 at 20:58











            0














            This is fixed in 5.9.1 ............






            share|improve this answer




























              0














              This is fixed in 5.9.1 ............






              share|improve this answer


























                0












                0








                0







                This is fixed in 5.9.1 ............






                share|improve this answer













                This is fixed in 5.9.1 ............







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 17 at 8:18









                user4278user4278

                70938




                70938






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to CiviCRM Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcivicrm.stackexchange.com%2fquestions%2f28096%2fdb-error-constraint-violation-on-anonymous-user-contribution-membership-registr%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Human spaceflight

                    Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                    張江高科駅