CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Blank screen, array_key_exists() when moving CiviCRM to new website
Pages: [1] 2

Author Topic: Blank screen, array_key_exists() when moving CiviCRM to new website  (Read 4051 times)

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 01:44:54 pm
I am moving CiviCRM 3.2.3 from a working installation on a subdomain (sub.example.com) to a top-level domain (example.com), running CentOS 5, Apache 2.2, PHP 5.2.10. I have followed the directions here (wiki.civicrm.org/confluence/display/CRMDOC33/Moving+an+Existing+Installation+to+a+New+Server+or+Location) and also here (forum.civicrm.org/index.php?topic=11538.0) but consistently run into a problem at step #6, running example.com/index.php?q=civicrm/admin/setting/updateConfigBackend&reset=1, attempting to get things configured correctly on the new site.

To summarize, I followed steps 1-5 above, doing a clean installation of the same 3.2.3 version of CiviCRM (I'll upgrade once this works), exporting the working database (minus the 5 tables listed), importing the database (which drops the old tables first) on the new server, to the point of clearing out the files under the templates_c directory. So far, so good.

This is where the problems start. I could not load the example.com/index.php?q=civicrm/admin/setting/updateConfigBackend&reset=1 page at all, getting only a white screen with no errors. I have tried to things to fix the problem, neither of which have worked. First, I attempted to edit the "config_backend" field in the `civicrm_domain` table and manually set the new URL (from subdomain to TLD) and correct the filesystem settings. This gets me to the point where I can load the ConfigBackend script, but it generates dozens of errors:

warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/www/vhosts/example.com/httpdocs/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php on line 182.

The second thing I tried was manually resetting the config_backend:

UPDATE civicrm_domain SET config_backend = null;

Neither of these attempts to resolve the problem have worked, I can get as far as the display of errors but none of the rest of the civicrm webapp works, just white screens.

I have reviewed this forum post (forum.civicrm.org/index.php?topic=15672.0) but was not able to resolve the problem. I have reviewed the civicrm.settings.php and everything appears to be set correctly. File permissions are what they should be, config directories are set correctly.

I am at a loss for what configuration I may be missing. Any help would be greatly appreciated.


cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 01:48:24 pm
One more piece: I changed the settings in the ConfigBackend script to the correct path on the filesystem as well as the https: //example.com domain, but after updating, the screen went blank. Checking the database, the entry in config_backend now only shows

N;

Very strange...

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 02:03:46 pm
I don't 100% follow your first post but I would suggest the following:

1. Install a fresh, empty CiviCRM on your top level domain example.com
2. Replace the CiviCRM (and Drupal) database(s) with your existing one from the subdomain.
3. Run
Code: [Select]
UPDATE civicrm_domain SET config_backend = null;
Then see what happens.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 02:17:15 pm
My website is a production website so doing an install of the Drupal database that was running on the subdomain is not possible, as they are entirely different sites.

I tried again with a clean install of the complete CiviCRM database dump that was running on the subdomain, reimported it into the new installation at the top-level domain, then ran

UPDATE civicrm_domain SET config_backend = null;

It still shows the white screen but now there is at least something that shows up in the config_backend field. However, it is obviously corrupted as some of the fields apparently got combined. For instance, the site name "My New Site" got put, seemingly randomly, into more than one configuration, like this:

"/var/www/vhosts/example.com/httpdocsMy New Site/files/civicrm/templates_c/en_US/ConfigAndLog/"

Any clues?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 02:21:11 pm
My advice is the same--remove your civicrm.settings.php file from example.com and install a fresh, empty CiviCRM on that site.

Once you have a working CiviCRM there, then just:

1. Replace the CiviCRM database on example.com with your existing one from the subdomain.
2. Run
Code: [Select]
UPDATE civicrm_domain SET config_backend = null;
That should do it.

No need to touch any Drupal DBs.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 02:56:23 pm
Almost. Here's the latest: I upgraded to 3.3.5 on the subdomain without any problem.

Using the new database dump (minus the 5 tables listed in the instructions) I uninstalled CiviCRM and did a clean install of 3.3.5 on example.com with an empty CiviCRM database. I then imported the working 3.3.5 database from the subdomain. I then cleared the templates_c/* and executed

Code: [Select]
UPDATE civicrm_domain SET config_backend = null;
I then rebuilt the ConfigBackend, which prompted me for the filesystem and the base URL (not the site Name). After submitting the two fields, it came back with an error saying that site name was needed too. I entered it, submitted and more white screens.

Does the theme that is used in Drupal matter to CiviCRM? It shouldn't, right? I'm going to switch to default and try again...

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 09, 2011, 06:03:14 pm
Still no luck. I switched to Garland but things did not improve. Any ideas?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 04:37:30 am
If you get WSOD, there should be an error in your error logs. Can you find that?

BTW, you also confirmed that the fresh install on example.com works? You ran a few CiviCRM pages to test?
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 07:36:02 am
Okay, trying again from the top, brand new civicrm database, installing CiviCRM 3.3.5 using the installation script to an existing Drupal 6 site that was installed using the Acquia install profile. I'm attempting to put the civicrm module in modules/acquia where all the rest of the custom modules I have installed are located.

Note that this site uses a custom theme without a left sidebar block area, meaning the CiviCRM blocks get disabled after install. I am using the Drupal civicrm_theme module to set Garland as the CiviCRM theme, which appears to work well. I can browse through the CiviCRM install and it looks good. There are no other CiviCRM modules enabled, just the core module and the CiviCRM Theme. Any ideas? Thanks for the help!

But the joy ends when I try to add a new Individual:

Code: [Select]
DB Error: constraint violation
Code: [Select]
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`mysite_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_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_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mysite_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_acl_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mysite_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_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_cache (contact_id , acl_id ) VALUES ( 1 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`mysite_civicrm/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]"]
)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 07:48:33 am
Was your DB fresh? Can you use a new DB, not one that had tables removed? One that was dropped and then created fresh in MySQL.

Standard location for addon modules is sites/all/modules although using the one you wrote should not cause a problem AFAIK.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 08:01:52 am
It was a fresh DB, dropped the db completely, then recreated it. I'm trying again but will give the database a new name as well, though it would be surprising if there was anything residual about the database name when doing a clean installation.

When running the install script, it needs the database, user and password for both the CiviCRM database and the Drupal database. What does it do with the Drupal database? Are any changes made to it that might affect the installation/reinstallation process?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 08:06:00 am
Quote from: cyboreal on February 10, 2011, 08:01:52 am
What does it do with the Drupal database? Are any changes made to it that might affect the installation/reinstallation process?

AFAIK it's for READ purposes, not WRITE. The only changes it makes AFAIK, are to enable the module and the blocks.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
Re: Blank screen, array_key_exists() when moving CiviCRM to new website
February 10, 2011, 08:06:39 am
Now I don't even get to the Configuration Checklist page - it loads but has the same DB Error: constraint violation. This is with the brand new CiviCRM database.
Code: [Select]
Database Error Code: Cannot add or update a child row: a foreign key constraint fails (`mysite_civicrm3/civicrm_acl_cache`, CONSTRAINT `FK_civicrm_acl_cache_contact_id` \
FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE), 1452

cyboreal

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.2.3
  • CMS version: Drupal
  • MySQL version: 5.x
  • PHP version: 5.2.x
The weirdness continues, but in a good way?
February 10, 2011, 08:31:00 am
The subdomain.example.com and example.com websites are on the same server, running from the same database server. After the last post to the forum, I edited the civicrm.settings.php file on example.com and switched out the CiviCRM database settings from the broken one on example.com to use the working CiviCRM database on subdomain.example.com, cloning the username, password and db name. I had tried this in one earlier attempt and it did not go well, WSOD, etc.

Surprisingly, it seems to be working. From example.com/civicrm I can browse all existing data, even create (and delete) a new record. When I go to subdomain.example.com/civicrm, I can see the new record I created.

I checked the ConfigBackend setting for example.com and it looks as it should, with the exception of the Site Name being "/sites/default/". The Old (and New) Base URL is https:// example.com and the Old (and New) Base Directory is correct. When I look at the ConfigBackend for subdomain.example.com, I am surprised to see that it is also correct, with the Old/New Base URL set to https:// subdomain.example.com + Old/New Base pointing to the correct subdomain location on the filesystem.

So now I'm really confused. And I'm not about to mess with the ConfigBackend script (by clicking "Save").

This does not seem to be the advertised way to do things, as I haven't truncated any tables, run the ConfigBackend script, updated the menus or anything. But it's also hard to argue with a working setup. What is the wisdom of continuing with the system in example.com, recreating user accounts on the Drupal side, giving them the appropriate permissions for CiviCRM and pretending nothing happened?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: The weirdness continues, but in a good way?
February 10, 2011, 08:34:50 am
Quote from: cyboreal on February 10, 2011, 08:31:00 am
What is the wisdom of continuing with the system in example.com, recreating user accounts on the Drupal side, giving them the appropriate permissions for CiviCRM and pretending nothing happened?

Worse sins have and will be committed so I wouldn't worry too much. :)

Seriously, however, the backend settings do not necessarily preclude basic features from working. Since actually all settings in your backend should be compatible for both sites (directories and URLs exist for both sites) except the base URL, it should be OK to do what you are doing. I think so anyhow.

Perhaps it's wisest to get another opinion. You might want to post another thread to gain fresh attention. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Blank screen, array_key_exists() when moving CiviCRM to new website

This forum was archived on 2017-11-26.