I just tried installing the .dev version on a test site and I recieved a load of errors:



    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_in_dn` TINYINT NOT NULL DEFAULT '0' in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_dn_attribute` VARCHAR(255) DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_attr` VARCHAR(255) DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_in_attr` TINYINT NOT NULL DEFAULT '0' in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_as_entries` TINYINT NOT NULL DEFAULT '0' in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_entries` TEXT DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_entries_attribute` VARCHAR(255) DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_mappings` TEXT DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_mappings_filter` TINYINT NOT NULL DEFAULT '0' in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_filter_php` TEXT DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.
    * user warning: Table 'drupal-mch.mchldapauth' doesn't exist query: ALTER TABLE mchldapauth ADD `ldapgroups_groups` TEXT DEFAULT NULL in D:\Inetpub\wwroot\drupal_ssw\includes\database.mysql-common.inc on line 306.

Comments

goose2000’s picture

Just a guess but, maybe I should install the release version, and then upgrade to get those missing tables ?

cgmonroe’s picture

Status: Active » Closed (cannot reproduce)

Cleaning up old bug reports... I haven't seen this in multiple installs/re-install of the modules during testing the recent -dev version. So I'm closing as "can not reproduce". Re-open if it's still a problem.

That said:

I am assuming that you have a table prefix of mch defined for your site? Because the base name is ldapauth.

The only way I could see this happening is if the ldapauth module was not enabled or didn't installed properly. The ldapgroups module depends on this module and the table it creates.

barryvdh’s picture

Status: Closed (cannot reproduce) » Active

I get the same error, with the latest dev version (but on line 307 instead of 306)

I have a fresh drupal install (6.26), and just checked all the available LDAP modules, and it gave this error. Also did an uninstall, en reinstall gave the same error.

All modules are installed, but Authentication is not checked (and greyed out, after installing the other modules).

Edit: Installing the beta, and upgrading to the dev version did work!

cgmonroe’s picture

Hmm, I completely uninstalled all the module on my test site. Made sure none of the tables and system vars existed and deleted the module directory.

Then I downloaded the dev version from drupal.org and used the admin/build/modules screen to enable all the modules.

I had no errors with this fresh install. So, something is missing in how to duplicate this.

The error messages above seem to indicate that the ldapauth module was not being enabled prior to the ldapgroups module for some reason.

The ldapgroups, ldapdata, ldapsync, and ldaphelp modules are all dependent on ldapauth being enabled first. This module is the one that creates the ldapauth table that the others "modify". FYI - That is why ldapauth is "greyed out" after the install. You can't disable it until all modules dependent on it are disabled first. AFAIK, the admin UI will handle this if you select modules with dependencies.

Were you using drush or some other module/process to enable the ldap* modules? Perhaps they are not honoring the dependency requirement and enabling ldapauth first?

In addition, I've compared the *.install files for changes between the beta and dev files. Nothing there really stands out except I did find a non-related bug in the ldapauth install script. The new ldapauth_users table was not being installed from scratch. This is fixed now. But that's not related to the alter table errors.

I'm thinking that when you went back to the beta, you did not "uninstall" the dev modules. So the ldapauth table created by the ldapauth was still there. Then the beta installed worked because the table was there to alter. And then the update worked to upgrade to the newest settings.

Are you doing anything like using table prefixes or the PostGres? Just trying to find where the problem is happening.

I would think that another "work around" if you get these errors would be to:

- Disable all the ldap modules.
- Then enable just the ldapauth module without any of the other modules.
- Once this is enabled, enable the other modules.

cgmonroe’s picture

Status: Active » Postponed (maintainer needs more info)
cgmonroe’s picture

Priority: Major » Normal
Status: Postponed (maintainer needs more info) » Closed (fixed)

I think I finally tracked down what is probably happening in these cases:

The LDAP Integration modules require that the PhP LDAP extension be installed. LDAPAuth use hook_requirements() to check if this extension is installed. If this extension is not present, this returns an error and core will not enable the module. So the ldapauth table does not get created.

However, the core dependency checks do not check to see if the required module was actually enabled. So, the dependent modules get enabled even if ldapauth fails because of the requirements. This causes the table not found errors.

The actual "bug" is that the ldapauth's hook_requirements() implementation does not return a "description" entry. This is means that there is no message displayed to indicate the missing requirement. The latest dev will correctly point this out and will help debug this problem.

cgmonroe’s picture

FYI - The latest code "really" fixes this by adding hook_requirement() implementations to ldapdata, ldapgroups, and ldapsync. This means if the PhP ldap extension is not enabled, no ldap integration module can be enabled. In addition, each module will report this error. So there will multiple messages about the extension not enabled.