Topic on Extension talk:LDAP Authentication

ldap extension on mediawiki/sqlite: no such table: ldap_domains

11
Marco Ardito (talkcontribs)

Hi, I have a lan wiki with auth on active dir 2003, and everything is fine.

now I am building a "private" wiki on the same server (ubuntu 12.04/apache2), same active directory, wiki version is 1.21 and ldap extension g013532 (from git repo) REL1_21 I got it to work but I fear it is not creating sqlite tables, since

when I enter valid user/pass, I got the error "1: no such table: ldap_domains" and mediawiki page says that query "SELECT domain FROM ldap_domains WHERE user_id = '2' LIMIT 1" was generated by "LdapAuthenticationPlugin::loadDomain" caused that error.

I also applied suggestion reported here http://www.mediawiki.org/wiki/Extension:LDAP_Authentication/Suggestions (page bottom), about "case 'sqlite':". but didn't help

I feel that sqlite tables were (and are) not generated correctly, since if i list tables in sqlite3 (ubuntu cli) i find only the following tables: " archive category categorylinks change_tag external_user externallinks filearchive hitcounter image imagelinks interwiki ipblocks iwlinks job l10n_cache langlinks module_deps msg_resource msg_resource_links objectcache oldimage page page_props page_restrictions pagelinks protected_titles querycache querycache_info querycachetwo recentchanges redirect searchindex_segdir searchindex_segments site_identifiers site_stats sites tag_summary templatelinks text transcache updatelog uploadstash user user_former_groups user_groups user_newtalk "

I don't know how to debug what's not working

Any hints? Thanks, Marco

166.64.3.2 (talkcontribs)

I am having the same problem. Have your problem been fixed? If so, how was it resolved?

This post was posted by 166.64.3.2, but signed as DZ.

Marco Ardito (talkcontribs)

nope, sorry. nobody ever answered, and I'm using basic accounts, in my case this could be managed... and I had much better work to do :D a bit sad, but...

Marco

199.89.206.130 (talkcontribs)

The problem is that this extension does not create the ldap_domains table if you are using sqlite (and does not throw an error either) - it should do one or the other...

The fix is:

cd to [MediaWikiInstallLocation]/extensions/LdapAuthentication/schema

create the file ldap-sqlite.sql

add the lines:

CREATE TABLE ldap_domains (

Domain_id INTEGER PRIMARY KEY AUTOINCREMENT,

Domain TEXT,

User_id TEXT

) /$wgDBTableOptions*/;

CREATE INDEX user_id on ldap_domains (user_id);

cd ..

edit LdapAuthentication.php

In the function efLdapAuthenticationSchemaUpdates

add the lines:

       case 'sqlite':
               $updater->addExtensionTable( 'ldap_domains', "$base/schema/ldap-sqlite.sql" );
               break;

cd to [MediaWikiInstallLocation]

now run php maintenance/update.php

If you look at the output you should see an entry for creating table ldap_domains

This post was posted by 199.89.206.130, but signed as Tim Bernhardson.

82.112.219.246 (talkcontribs)

many thanks for the reply and the suggested fix. I will try (not soon, though) and report here :)

Marco

139.2.4.140 (talkcontribs)

Thanks a lot, this works fine for sqlite

202.96.41.4 (talkcontribs)

Thanks a lot!! It woks!!

PeterS3 (talkcontribs)

This fix also worked for me, on v1.30; it was missing the SQLite handling of a new user (via LDAP.)

Sbonds (talkcontribs)

Marco:

I opened a bug against the extension to apply the fix suggested by the anonymous user in this thread: https://phabricator.wikimedia.org/T108355

I also updated the extension's requirements page with "The MediaWiki database must be MySQL or PostgreSQL. SQLite is not currently supported."

Hopefully that will help keep more people from wasting time trying to make this work before finally finding this thread.

Sbonds (talkcontribs)

Also, as Google-bait, the error that was shown before I enabled lots of debugging was not so helpful: "a database query error has occurred"

Saper (talkcontribs)
Reply to "ldap extension on mediawiki/sqlite: no such table: ldap_domains"