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 4 hours ago









      NicNic

      34018




      34018






















          1 Answer
          1






          active

          oldest

          votes


















          4














          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
            3 hours ago











          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

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          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
            3 hours ago
















          4














          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
            3 hours ago














          4












          4








          4







          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 4 hours ago









          Pradeep NayakPradeep Nayak

          10.2k1519




          10.2k1519













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

            – Nic
            3 hours ago



















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

            – Nic
            3 hours ago

















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

          – Nic
          3 hours ago





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

          – Nic
          3 hours ago


















          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

          Polycentropodidae

          Magento 2.2: Unable to unserialize value?