Hello guys.

We are trying to host Aegir with CiviCRM on every website we created, but we stumbled upon some problems that are hindering us for quite some time when trying to verify them.
Aegir is configured very basic, we have only enabled CiviCRM and its cron queue. For now we have installed 2 instances and hostmaster itself. At the moment all of them are failing as we enabled CiviCRM via hosting and we need it active.
From our perspective, the main problem is that it asks for table that doesn't exist... thing is, we dont need multi-domain instances, at least with current ones that we have.

Any hints are welcome, from configuration insights to drush commands that might turn off this feature if we did set it on globally by mistake.
This is what we get when we have CiviCRM enabled:

exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'example.com_domain' doesn't exist' in /var/aegir/hostmaster-7.x-3.11/includes/database/database.inc:2227 Stack trace: #0 /var/aegir/hostmaster-7.x-3.11/includes/database/database.inc(2227): PDOStatement->execute(Array) #1 /var/aegir/hostmaster-7.x-3.11/includes/database/database.inc(697): DatabaseStatementBase->execute(Array, Array) #2 /var/aegir/hostmaster-7.x-3.11/includes/database/database.inc(2406): DatabaseConnection->query('select version ...', Array, Array) #3 /var/aegir/hostmaster-7.x-3.11/profiles/hostmaster/modules/aegir/hosting_civicrm/drush/provision_civicrm.inc(762): db_query('select version ...', Array) #4 /var/aegir/hostmaster-7.x-3.11/profiles/hostmaster/modules/aegir/hosting_civicrm/drush/provision_civicrm.inc(715): _provision_civicrm_database_version() #5 /var/aegir/hostmaster-7.x-3.11/profiles/hostmaster/modules/aegir/hosting_civicrm/drush/verify.provision.inc(47): _provision_civicrm_check_upgrade_mode() #6 [internal function]: drush_provision_civicrm_provision_verify() #7 phar:///usr/local/bin/drush/includes/command.inc(422): call_user_func_array('drush_provision...', Array) #8 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array) #9 [internal function]: drush_command() #10 phar:///usr/local/bin/drush/includes/command.inc(199): call_user_func_array('drush_command', Array) #11 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array) #12 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch() #13 phar:///usr/local/bin/drush/includes/startup.inc(458): drush_main() #14 phar:///usr/local/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...') #15 phar:///usr/local/bin/drush/drush(114): drush_startup(Array) #16 /usr/local/bin/drush(10): require('phar:///usr/loc...') #17 {main}

After disabling the Aegir CiviCRM, hostmaster is working good, but one of the instances has this error in verify log:

Invalid argument supplied for foreach() SettingsBag.php:311
Invalid argument supplied for foreach() SettingsBag.php:311
Drush command terminated abnormally due to an unrecoverable error.

If you need any other info, please ask so I can provide you asap, mater is bit urgent.

Comments

Shwele created an issue. See original summary.

xurizaemon’s picture

The issue you're running into is starting here in provision_civicrm.inc (note that there was *also* a separate Provision CiviCRM project but it's now deprecated and the code is in this one - make sure you don't have both installed!).

If you're really getting 'example.com_domain' as the table name

(1) that period in .com is going to make MySQL upset (it looks like a database.table separator to the DB), and
(2) if you're getting something more like examplecom_domain that suggests possibly issues with DB aliasing ... you'll see from the linked code that it's {civicrm_domain} so you could end up with a prefix added, but it should not be removing the civicrm component.

That's as helpful as I can be without using Aegir + CiviCRM together recently :D Hope it's some use!

bgm’s picture

Do the sites already have CiviCRM installed? Was it installed by Aegir, or from before the migration?

If the site was migrated, were the databases merged? Aegir only supports having all tables in the Drupal database.

Side note: Aegir (hosting_civicrm) will automatically install CiviCRM when creating a new site (if the civicrm module is in the platform). However, it cannot install CiviCRM after the Drupal site has been installed (i.e. migrate a Drupal site that never had CiviCRM installed, then install CiviCRM onto it). You would have to run the CiviCRM installer manually (and provide it the same database credentials as the Drupal database).

Shwele’s picture

@xurizaemon
I think we don't have both installed... at least I hope we dont. Any good way to check that just in case?

Yea its 2nd option, my bad... database that makes problems goes like this: exampleorg.civicrm_domain
From what we've researched, Aegir has multi domain integration. We are unaware how/if it was turned on and how to turn it off, issue still persists.
Due this error, it also runs over working civiCRM settings with some that isn't working with our configuration (trying to load to drupal one, not civiCRM one). Does aegir has somewhere stored up settings files for every instance, if it reloads from it, like a save point?
Whenever we verify configuration on Aegir, it fails due that error and it creates new civicrm.settings.php file. Problem is, it creates it even on hostmaster instance, where we dont need and don't have civircm installed at all. It just creates settings, nothing in files folder.

@bgm
Yea they do, all but hostmaster, you have those issues explained above.
It was installed via aegir, location of module is /var/aegir/hostmaster-7.x-3.11/sites/all/modules/civicrm/

Ok so if hosting with CiviCRM is active, then by default Aegir should install and set it up. If we use migrated website without CiviCRM that wont work, but will have to install it manually. Correct?

xurizaemon’s picture

I would probably get the two DBs, merge them locally, then overwrite the live data with that new DB.

This should deliver a merged DB hosted on Aegir. You'll need to adjust civicrm.settings.php to suit; I don't know what Aegir variations are required for that part.

xurizaemon’s picture

Title: Aeigr asking for domain table on every drupal instance » Aegir asking for domain table on every drupal instance
bgm’s picture

Status: Active » Closed (works as designed)