CRM-120 CiviCRM fails to start when running off empty database (no GeneratedData loaded)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      While installing sandbox for php4, I came over this problem: after installing clean db (without generated data), trying to get to contacts list page, I got pretty bad error (sorry, don't have it). After some investigation, I found out that this problem comes out of mysql, which is trying to execute following query:
      INSERT INTO crm_contact (domain_id , contact_type , sort_name ) VALUES ( 1 , 'Individual' , '' );

      The error was:
      ERROR 1216 (23000): Cannot add or update a child row: a foreign key constraint fails

      Dunno if this happens only when running off php4 or does it also affect php5.

        Attachments

          Activity

          [CRM-120] CiviCRM fails to start when running off empty database (no GeneratedData loaded)
          Donald A. Lobo added a comment -

          This is a setup issue. In addition to Contacts.sql we need to also source FixedData.sql (which sets up some basic tables like domain, country etc)

          The code will also fail pretty badly if DB is not created / initialized. Should we add checks for this state, i suspect might be overkill to do so on all requests. IMO, setting up DB is in the same category as making sure all the required php files are present

          lobo

          Michał Mach added a comment -

          Fixed.

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Michał Mach

              Dates

              • Created:
                Updated:
                Resolved: