Last Comment Bug 502597 - thunderbird autoconfig, prefcalls.js Ldap queries broken
: thunderbird autoconfig, prefcalls.js Ldap queries broken
Status: RESOLVED FIXED
: regression
Product: Thunderbird
Classification: Client Software
Component: Address Book (show other bugs)
: Trunk
: All All
: -- major (vote)
: Thunderbird 3.0b4
Assigned To: Mark Banner (:standard8, limited time in Dec)
:
:
Mentors:
https://developer.mozilla.org/index.p...
Depends on: 512690
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-06 06:05 PDT by Jehan Procaccia
Modified: 2011-07-27 08:26 PDT (History)
14 users (show)
standard8: blocking‑thunderbird3+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Patch for mozilla-central (1.08 KB, patch)
2009-07-22 06:09 PDT, Mark Banner (:standard8, limited time in Dec)
no flags Details | Diff | Splinter Review
Patch for comm-central (22.46 KB, patch)
2009-08-24 07:40 PDT, Mark Banner (:standard8, limited time in Dec)
no flags Details | Diff | Splinter Review
[checked in] Patch for comm-central v2 (22.66 KB, patch)
2009-08-26 07:16 PDT, Mark Banner (:standard8, limited time in Dec)
mozilla: review+
mozilla: superreview+
Details | Diff | Splinter Review

Description Jehan Procaccia 2009-07-06 06:05:13 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.1pre) Gecko/20090702 Shredder/3.0b3pre

We use autoconfig for large scale deployement to pre-set users preferences on multiuser shared machines. details are presented here:
https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig

For exemple, we pre-set mail preferences , retreiving users mail address from ldap server with Ldap functions defined in defaults/autoconfig/prefcalls.js using lockpref this way:

var env_user    = getenv("USER");
var mail = getLDAPValue ( values ,"mail" );
 getLDAPAttributes("ldap2.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,labeledURI");
lockPref("mail.identity.id1.useremail", mail);

unfortunaltly, prefcalls.js Ldap function seems to be broken.
Indeed, I get an error while calling prefcall.js getLDAPAttributes function, at startup:

Netscape.cfg/AutoConfig failed. Please contact your system administrator.
 Error: getLDAPAttibutes failed: [Exception... "Component returned failure
code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsILDAPURL.spec]"  nsresult:
"0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame ::
file:////usr/local/thunderbirdDebugLibs/thunderbird-3.0b3pre/defaults/autoconfig/prefcalls.js
:: getLDAPAttributes :: line 174"  data: no]



From mozilla-dev I've been told:
"I suspect this is related to both the change from CVS to Mercurial <http://groups.google.com/group/mozilla.dev.planning/browse_thread/thread/b4a925620be88c62/d1f0192938f0e312?q=ldap+autoconfig+mercurial#d1f0192938f0e312>, as well as to some more recent changes to the nsLDAPURL code. "
full discussion at
http://groups.google.com/group/mozilla.dev.apps.thunderbird/browse_thread/thread/9b1962efdeb92f4e/5fb58808bf0e5954?lnk=gst&q=autoconfig#5fb58808bf0e5954



Reproducible: Always

Steps to Reproduce:
1. set up autoconfig as define in https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig, to be short => greprefs/all.js: pref("general.config.filename", "thunderbird.cfg"); thunderbird.cfg containing lockprefs bases on js varaibles fetch from ldap .
2. start thunderbird, you get the "...getLDAPAttributes :: line 174"  data: no.." error and hence no mail config pre-set .
3.
Actual Results:  
error massage at startup of thunderbird binary 

"...getLDAPAttributes :: line 174"  data: no.."

Expected Results:  
no error message, and set preferences as instructed in thunderbird.cfg (series of locakpref) .
Comment 1 Jehan Procaccia 2009-07-22 02:58:36 PDT
Tested this morning with Thunderbird 3 Beta 3, problem still there :-( .

Netscape.cfg/AutoConfig failed. Please contact your system administrator. 
 Error: getLDAPAttibutes failed: [Exception... "Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsILDAPURL.spec]"  nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)"  location: "JS frame :: file:////usr/local/TB/thunderbird3b3/defaults/autoconfig/prefcalls.js :: getLDAPAttributes :: line 174"  data: no]

Any help greatly appreciated .
regards .
Comment 2 Nikolay Shopik 2009-07-22 05:46:15 PDT
How this bug is related to bug 295329 - this seems more like core issue not FF/TB.
Comment 3 Mark Banner (:standard8, limited time in Dec) 2009-07-22 06:09:58 PDT
Created attachment 389929 [details] [diff] [review]
Patch for mozilla-central

This patch should fix the initial error in prefcalls.js. Apply it to the source code in the mozilla directory with patch -p1.

In mail/app-config.mk try adding:

MOZ_LDAP_XPCOM=1

Then rebuild with those two changes. I've not tested these, but hopefully they will work correctly. Can you give them a try?
Comment 4 Mark Banner (:standard8, limited time in Dec) 2009-07-22 06:11:03 PDT
Confirming in that we need to a) get autoconfig working, b) work out where it should be taken next.
Comment 5 Nikolay Shopik 2009-07-22 06:12:28 PDT
Does this broken _only_ on Linux? I've not yet tried on Windows autoconfig.
Comment 6 Mark Banner (:standard8, limited time in Dec) 2009-07-22 06:26:40 PDT
(In reply to comment #5)
> Does this broken _only_ on Linux? I've not yet tried on Windows autoconfig.

This would be broken on all platforms and I don't think it is releated to bug 295329 as that goes back too far.
Comment 7 Jehan Procaccia 2009-07-22 11:18:23 PDT
Ok I try  as Mark Banner suggested

[root@b008-02 commsrc]# tail -3 mail/app-config.mk
MOZ_THUNDERBIRD = 1
DEFINES += -DMOZ_THUNDERBIRD=1
MOZ_LDAP_XPCOM=1

patch prefcalls.js:

[root@b008-02 mozilla]# patch -p1 < /root/prefcallsJsPatch.patch                                                        patching file extensions/pref/autoconfig/src/prefcalls.js

I also added options needed to build from comm central in static mode

[root@b008-02 commsrc]# cat .mozconfig
# This file specifies the build flags for Firefox.  You can use it by adding:
#  . $topsrcdir/browser/config/mozconfig
# to the top of your mozconfig file.
mk_add_options AUTOCONF=autoconf-2.13
ac_add_options --enable-application=browser
ac_add_options --enable-application=mail
ac_add_options --prefix="/usr/local/thunderbirdDebug2"
ac_add_options --libdir="/usr/local/thunderbirdDebug2Libs"
ac_add_options --enable-extensions=pref
ac_add_options --enable-static
ac_add_options --disable-shared

Then I Issued the build process ...
unfortunatly it crash on building :-( ... where could I made had a mistake !?

I followed the same procedure I did 2 weeks ago with success though !
https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig#Thunderbird.c2.a0Comm-central_source_code_%28Mercurial%29

[root@b008-02 commsrc]# time make -f client.mk build
....ZZZZZZZZZZZZZZ....
gmake[7]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/toolkit/crashreporter/google-breakpad/src/common'
gmake[7]: Entering directory `/usr/local/Moz2/commsrc/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux'
dump_symbols.cc
c++ -o host_dump_symbols.o -c  -I./../.. -I. -I.  -I../../../../../../dist/include   -I../../../../../../dist/include/breakpad_linux_common -I/usr/local/Moz2/commsrc/mozilla/dist/include/nspr    -I/usr/local/Moz2/commsrc/mozilla/dist/sdk/include -I/usr/local/Moz2/commsrc/mozilla/dist/include/nspr dump_symbols.cc
dump_symbols.cc: In function 'bool<unnamed>::WriteFormat(int, const char*, ...)':
dump_symbols.cc:176: error: 'vsnprintf' was not declared in this scope
dump_symbols.cc: In function 'bool<unnamed>::ComputeSizeAndRVA(Elf32_Addr, <unnamed>::SymbolInfo*)':
dump_symbols.cc:487: error: 'stderr' was not declared in this scope
dump_symbols.cc:488: error: 'fprintf' was not declared in this scope
dump_symbols.cc: In function 'bool<unnamed>::LoadSymbols(Elf32_Ehdr*, <unnamed>::SymbolInfo*)':
dump_symbols.cc:586: error: 'stderr' was not declared in this scope
dump_symbols.cc:586: error: 'fprintf' was not declared in this scope
gmake[7]: *** [host_dump_symbols.o] Error 1
gmake[7]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux'
gmake[6]: *** [libs] Error 2
gmake[6]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/toolkit/crashreporter'
gmake[5]: *** [libs] Error 2
gmake[5]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/toolkit'
gmake[4]: *** [libs_tier_toolkit] Error 2
gmake[4]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
gmake[3]: *** [tier_toolkit] Error 2
gmake[3]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
gmake[2]: *** [default] Error 2
gmake[2]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/local/Moz2/commsrc'
make: *** [build] Error 2

real    0m29.744s
user    0m22.649s
sys     0m6.406s

Thanks for your help.
Comment 8 Mark Banner (:standard8, limited time in Dec) 2009-07-22 13:51:22 PDT
Try adding:

ac_add_options --disable-crashreporter

to your .mozconfig. You don't need it anyway for self-builds.
Comment 9 Jehan Procaccia 2009-07-23 01:20:19 PDT
indeed, stupid of me ! I already had that problem at last build ...
OK now it goes steps further, but still fails :-( . I noticed that as soon as I add in mail/app-config.mk "MOZ_LDAP_XPCOM=1" then the build fails.
perhaps there's a remaining pb in nsConfigFactory !?
here's the error now:

nsConfigFactory.cpp
c++ -o nsConfigFactory.o -c -I../../../../dist/include/system_wrappers -include ../../../../config/gcc_hidden.h -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -DMOZ_THUNDERBIRD=1 -DOSTYPE=\"Linux2.6.29.5-191.fc11.i686\" -DOSARCH=Linux -DMOZ_LDAP_XPCOM  -I. -I. -I../../../../dist/include/xpcom -I../../../../dist/include/string -I../../../../dist/include/intl -I../../../../dist/include/js -I../../../../dist/include/xpconnect -I../../../../dist/include/necko -I../../../../dist/include/profile -I../../../../dist/include/pref -I../../../../dist/include/appcomps -I../../../../dist/include/embedcomponents -I../../../../dist/include/windowwatcher -I../../../../dist/include/mozldap -I../../../../dist/include   -I../../../../dist/include/autoconfig -I/usr/local/Moz2/commsrc/mozilla/dist/include/nspr    -I/usr/local/Moz2/commsrc/mozilla/dist/sdk/include       -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions    -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsConfigFactory.pp nsConfigFactory.cpp
In file included from nsConfigFactory.cpp:45:
nsLDAPSyncQuery.h:41:31: error: nsILDAPConnection.h: No such file or directory
nsLDAPSyncQuery.h:42:30: error: nsILDAPOperation.h: No such file or directory
nsLDAPSyncQuery.h:43:36: error: nsILDAPMessageListener.h: No such file or directory
nsLDAPSyncQuery.h:44:24: error: nsILDAPURL.h: No such file or directory
nsLDAPSyncQuery.h:46:30: error: nsILDAPSyncQuery.h: No such file or directory
In file included from nsConfigFactory.cpp:45:
nsLDAPSyncQuery.h:54: error: expected class-name before ',' token
nsLDAPSyncQuery.h:57: error: expected class-name before '{' token
nsLDAPSyncQuery.h:61: error: 'NS_DECL_NSILDAPMESSAGELISTENER' does not name a type
nsLDAPSyncQuery.h:69: error: 'nsILDAPConnection' was not declared in this scope
nsLDAPSyncQuery.h:69: error: template argument 1 is invalid
nsLDAPSyncQuery.h:70: error: 'nsILDAPOperation' was not declared in this scope
nsLDAPSyncQuery.h:70: error: template argument 1 is invalid
nsLDAPSyncQuery.h:71: error: 'nsILDAPURL' was not declared in this scope
nsLDAPSyncQuery.h:71: error: template argument 1 is invalid
nsLDAPSyncQuery.h:80: error: 'nsILDAPMessage' has not been declared
nsLDAPSyncQuery.h:83: error: 'nsILDAPMessage' has not been declared
nsLDAPSyncQuery.h:86: error: 'nsILDAPMessage' has not been declared
gmake[7]: *** [nsConfigFactory.o] Error 1
gmake[7]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/extensions/pref/autoconfig/src'
gmake[6]: *** [libs] Error 2
gmake[6]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/extensions/pref/autoconfig'
gmake[5]: *** [libs] Error 2
gmake[5]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/extensions/pref'
gmake[4]: *** [libs_tier_toolkit] Error 2
gmake[4]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
gmake[3]: *** [tier_toolkit] Error 2
gmake[3]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
gmake[2]: *** [default] Error 2
gmake[2]: Leaving directory `/usr/local/Moz2/commsrc/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/usr/local/Moz2/commsrc'
make: *** [build] Error 2

real	9m34.755s
user	8m52.849s
sys	0m39.970s


Thanks
Comment 10 Mark Banner (:standard8, limited time in Dec) 2009-07-23 02:03:31 PDT
Ok, so here's the problem. The autoconfig code is now being built before the LDAP code - therefore the ldap headers aren't being generated.

As a workaround, with the build in that failing state you could cd into

/usr/local/Moz2/commsrc/directory/xpcom/base/public

and type "make". Then go back and start the build again as you would do normally (make -f client.mk build).

This really is a workaround (if it works). I think now I realise the issues, we're at the stage where we probably need to take a look at making the autoconfig code a stand-alone extension (I'm assuming that is possible) to get LDAP to build properly.

Anyway, try the work around and we'll take it from there.
Comment 11 Jehan Procaccia 2009-07-23 02:41:16 PDT
Ok I tried the workaround by building LDAP code before as proposed:

[root@b008-02 public]# ls
Makefile               nsILDAPBERValue.idl    nsILDAPErrors.idl           nsILDAPModification.idl  nsILDAPService.idl
Makefile.in            nsILDAPConnection.idl  nsILDAPMessage.idl          nsILDAPOperation.idl     nsILDAPURL.idl
nsILDAPBERElement.idl  nsILDAPControl.idl     nsILDAPMessageListener.idl  nsILDAPServer.idl

[root@b008-02 public]# make
...
[root@b008-02 public]# ls _xpidlgen/
mozldap.xpt            nsILDAPConnection.h    nsILDAPErrors.xpt           nsILDAPModification.h    nsILDAPServer.xpt
nsILDAPBERElement.h    nsILDAPConnection.xpt  nsILDAPMessage.h            nsILDAPModification.xpt  nsILDAPService.h
nsILDAPBERElement.xpt  nsILDAPControl.h       nsILDAPMessageListener.h    nsILDAPOperation.h       nsILDAPService.xpt
nsILDAPBERValue.h      nsILDAPControl.xpt     nsILDAPMessageListener.xpt  nsILDAPOperation.xpt     nsILDAPURL.h
nsILDAPBERValue.xpt    nsILDAPErrors.h        nsILDAPMessage.xpt          nsILDAPServer.h          nsILDAPURL.xpt

Then back to root build, I get the same error:

[root@b008-02 commsrc]# time make -f client.mk build

nsConfigFactory.cpp
c++ -o nsConfigFactory.o -c -I../../../../dist/include/system_wrappers -include ../../../../config/gcc_hidden.h -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -DMOZ_THUNDERBIRD=1 -DOSTYPE=\"Linux2.6.29.5-191.fc11.i686\" -DOSARCH=Linux -DMOZ_LDAP_XPCOM  -I. -I. -I../../../../dist/include/xpcom -I../../../../dist/include/string -I../../../../dist/include/intl -I../../../../dist/include/js -I../../../../dist/include/xpconnect -I../../../../dist/include/necko -I../../../../dist/include/profile -I../../../../dist/include/pref -I../../../../dist/include/appcomps -I../../../../dist/include/embedcomponents -I../../../../dist/include/windowwatcher -I../../../../dist/include/mozldap -I../../../../dist/include   -I../../../../dist/include/autoconfig -I/usr/local/Moz2/commsrc/mozilla/dist/include/nspr    -I/usr/local/Moz2/commsrc/mozilla/dist/sdk/include       -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions    -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsConfigFactory.pp nsConfigFactory.cpp
In file included from nsConfigFactory.cpp:45:
nsLDAPSyncQuery.h:41:31: error: nsILDAPConnection.h: No such file or directory
nsLDAPSyncQuery.h:42:30: error: nsILDAPOperation.h: No such file or directory
nsLDAPSyncQuery.h:43:36: error: nsILDAPMessageListener.h: No such file or directory
nsLDAPSyncQuery.h:44:24: error: nsILDAPURL.h: No such file or directory
nsLDAPSyncQuery.h:46:30: error: nsILDAPSyncQuery.h: No such file or directory
In file included from nsConfigFactory.cpp:45:
nsLDAPSyncQuery.h:54: error: expected class-name before ',' token
nsLDAPSyncQuery.h:57: error: expected class-name before '{' token
nsLDAPSyncQuery.h:61: error: 'NS_DECL_NSILDAPMESSAGELISTENER' does not name a type
nsLDAPSyncQuery.h:69: error: 'nsILDAPConnection' was not declared in this scope
nsLDAPSyncQuery.h:69: error: template argument 1 is invalid
nsLDAPSyncQuery.h:70: error: 'nsILDAPOperation' was not declared in this scope
nsLDAPSyncQuery.h:70: error: template argument 1 is invalid
nsLDAPSyncQuery.h:71: error: 'nsILDAPURL' was not declared in this scope
nsLDAPSyncQuery.h:71: error: template argument 1 is invalid
nsLDAPSyncQuery.h:80: error: 'nsILDAPMessage' has not been declared
nsLDAPSyncQuery.h:83: error: 'nsILDAPMessage' has not been declared
nsLDAPSyncQuery.h:86: error: 'nsILDAPMessage' has not been declared
gmake[7]: *** [nsConfigFactory.o] Error 1
gmake[7]: Leaving directory `/usr/local/Moz2/commsrc/mozilla/extensions/pref/autoconfig/src'
gmake[6]: *** [libs] Error 2

did I missed something ?
thanks.
Comment 12 Jehan Procaccia 2009-07-27 22:51:53 PDT
I gave it a new try with latest comm central code (July 27),but I get the same error (after issuing a make in /usr/local/Moz3/commsrc/directory/xpcom/base/public before as suggested by Mark)
:

root@b008-02 /usr/local/Moz3/commsrc]
$ time make -f client.mk build
...zzzzzzzzzzz....
gmake[5]: Entering directory `/usr/local/Moz3/commsrc/mozilla/extensions/pref'
gmake[6]: Entering directory `/usr/local/Moz3/commsrc/mozilla/extensions/pref/autoconfig'
gmake[7]: Entering directory `/usr/local/Moz3/commsrc/mozilla/extensions/pref/autoconfig/public'
/usr/local/Moz3/commsrc/mozilla/config/nsinstall -R -m 644 _xpidlgen/autoconfig.xpt ../../../../dist/bin/components
gmake[7]: Leaving directory `/usr/local/Moz3/commsrc/mozilla/extensions/pref/autoconfig/public'
gmake[7]: Entering directory `/usr/local/Moz3/commsrc/mozilla/extensions/pref/autoconfig/src'
nsConfigFactory.cpp
c++ -o nsConfigFactory.o -c -I../../../../dist/include/system_wrappers -include ../../../../config/gcc_hidden.h -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -DMOZ_THUNDERBIRD=1 -DOSTYPE=\"Linux2.6.29.5-191.fc11.i686\" -DOSARCH=Linux -DMOZ_LDAP_XPCOM  -I. -I. -I../../../../dist/include/xpcom -I../../../../dist/include/string -I../../../../dist/include/intl -I../../../../dist/include/js -I../../../../dist/include/xpconnect -I../../../../dist/include/necko -I../../../../dist/include/profile -I../../../../dist/include/pref -I../../../../dist/include/appcomps -I../../../../dist/include/embedcomponents -I../../../../dist/include/windowwatcher -I../../../../dist/include/mozldap -I../../../../dist/include   -I../../../../dist/include/autoconfig -I/usr/local/Moz3/commsrc/mozilla/dist/include/nspr    -I/usr/local/Moz3/commsrc/mozilla/dist/sdk/include       -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions    -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsConfigFactory.pp nsConfigFactory.cpp
In file included from nsConfigFactory.cpp:45:
nsLDAPSyncQuery.h:41:31: error: nsILDAPConnection.h: No such file or directory
nsLDAPSyncQuery.h:42:30: error: nsILDAPOperation.h: No such file or directory

I tried to have a look further, suposing that the pb of not finding " nsILDAPConnection.h" comes from this include:
-I../../../../dist/include/xpcom

and indeed the file is not there 

[root@b008-02 /usr/local/Moz3/commsrc/mozilla/dist/include/xpcom]
$ ls -l nsILDAPConnection.h
ls: cannot access nsILDAPConnection.h: No such file or directory

there do have lots of headers (links) files there but not the ones from autoconfig

[root@b008-02 /usr/local/Moz3/commsrc/mozilla/dist/include/xpcom]
$ ls -l
total 20
lrwxrwxrwx 1 root root 27 2009-07-28 07:29 nsAgg.h -> ../../../xpcom/base/nsAgg.h
lrwxrwxrwx 1 root root 45 2009-07-28 07:29 nsAppDirectoryServiceDefs.h -> ../../../xpcom/io/nsAppDirectoryServiceDefs.h
...

nsILDAPConnection.h is neither in the parent directory where all include files are
[root@b008-02 /usr/local/Moz3/commsrc/mozilla/dist/include]
$ find ./ -name nsILDAPConnection.h

back to the root of the build process, I do find it in the directory where Mark suggested to issue the make

[root@b008-02 /usr/local/Moz3/commsrc]
$ find ./ -name nsILDAPConnection.h
./directory/xpcom/base/public/_xpidlgen/nsILDAPConnection.h

[root@b008-02 /usr/local/Moz3/commsrc/directory/xpcom/base/public/_xpidlgen]
$ ls
mozldap.xpt            nsILDAPErrors.h             nsILDAPOperation.xpt
nsILDAPBERElement.h    nsILDAPErrors.xpt           nsILDAPServer.h
nsILDAPBERElement.xpt  nsILDAPMessage.h            nsILDAPServer.xpt
nsILDAPBERValue.h      nsILDAPMessageListener.h    nsILDAPService.h
nsILDAPBERValue.xpt    nsILDAPMessageListener.xpt  nsILDAPService.xpt
nsILDAPConnection.h    nsILDAPMessage.xpt          nsILDAPURL.h
nsILDAPConnection.xpt  nsILDAPModification.h       nsILDAPURL.xpt
nsILDAPControl.h       nsILDAPModification.xpt
nsILDAPControl.xpt     nsILDAPOperation.h

Then I blindly copied those *.h file to mozilla/dist/include/xpcom

[root@b008-02 /usr/local/Moz3/commsrc/directory/xpcom/base/public/_xpidlgen]
$ cp *.h /usr/local/Moz3/commsrc/mozilla/dist/include/xpcom

 but even after that it still fails :-( , 

[root@b008-02 /usr/local/Moz3/commsrc]
$ time make -f client.mk build
...
nsLDAPSyncQuery.h:41:31: error: nsILDAPConnection.h: No such file or directory
...

it seems that my manual copy is deleted by the build process as it is not present anymore :-( 
[root@b008-02 /usr/local/Moz3/commsrc/]
$ ls -al /usr/local/Moz3/commsrc/mozilla/dist/include/xpcom/nsILDAPConnection.h
ls: cannot access /usr/local/Moz3/commsrc/mozilla/dist/include/xpcom/nsILDAPConnection.h: No such file or directory

Any help greatly appreciated 

Thanks .
Comment 13 Mark Banner (:standard8, limited time in Dec) 2009-07-28 14:35:06 PDT
As I suspected this didn't quite work. I think the best way to fix it would be to turn autoconfig into a proper standalone extension which can then be modified/updated as required.
Comment 14 Jehan Procaccia 2009-07-29 06:12:04 PDT
Well, 
I understand that an extension could be a futur place for autoconfig.
But I must admit that  I am not able to write it, I'am a sysadmin, not a developper. Do you have an Idea of who could turn it to an extension and how long will it takes ?
What scares me about an extension, is that the project might not be followed by core mozilla developpers and that in the long run it finaly get lost , 
perhaps I'am too pesimist ... ?
An other thing that scares me, is that while autoconfig is in the core, user's can't de-activate prefs like "lockpref" API calls. Then, as an extension, I 'am not sure users won't be able to run around our lockprefs ?

Anyway, please consider that autoconfig (+ldap calls) feature as a major one and let me know if I can expect it to work by late August 2009 ?

Thanks .
Comment 15 Nikolay Shopik 2009-07-29 06:26:00 PDT
Mark, probably it's time to start some discussion on news group about that, Jehan made good point.
Comment 16 Laurent Bauvens 2009-08-03 05:51:46 PDT
(In reply to comment #15)
> Mark, probably it's time to start some discussion on news group about that,
> Jehan made good point.

We have planned to use LDAP queries in autoconfig(mcd) by using ldap groups in order to distinguish between the configuration of IMAP and POP accounts. We have today 80.000 thunderbirds in use in our organization which are managed via autoconfig(mcd). So it's important for us to have this ldap function back before the official release of TB 3.0 and moreover autoconfig(mcd) must remained as a core function maintained by core developers. If autoconfig(mcd) is transformed in an extension without particular attention, I think that this could trigger off massive migration to Outlook or a webmail amongst enterprise users. This is less a question of software than a question of software management.

Like Jehan and Nicolay, I think the topics "Using Mozilla software in enterprise" and "How enterprises can contribute to Mozilla software." would need to be seriously discuss in a near future.

Regards.
Comment 17 Mark Banner (:standard8, limited time in Dec) 2009-08-24 07:40:42 PDT
Created attachment 396208 [details] [diff] [review]
Patch for comm-central

Jehan, this is a possible approach to fix comm-central for TB 3 at least. It copies the required ldap files to somewhere we can build them.

To test this you'll need to apply this patch to the comm-central part of the build AND apply the previously attached mozilla-central patch to the mozilla/ directory.

From what I can tell without setting things up - the required component is registered with this patch and so you should at least get further, but I suspect you should be able to go all the way and get it working. If not, please post the errors as usual.
Comment 18 Jehan Procaccia 2009-08-24 10:32:02 PDT
OK, here's what I did after downloading latest (today) comm-central

[root@b008-02 /usr/local/Moz5/commsrc]
$ wget https://bugzilla.mozilla.org/attachment.cgi?id=396208
$ mv attachment.cgi?id=396208 comm-central-tb3-ldap-precalls.patch
[root@b008-02 /usr/local/Moz5/commsrc]
$ patch -p1 < comm-central-tb3-ldap-precalls.patch 
patching file directory/xpcom/base/public/Makefile.in
patching file directory/xpcom/base/public/nsILDAPSyncQuery.idl
patching file directory/xpcom/base/src/Makefile.in
patching file directory/xpcom/base/src/nsLDAPProtocolModule.cpp
patching file directory/xpcom/base/src/nsLDAPSyncQuery.cpp
patching file directory/xpcom/base/src/nsLDAPSyncQuery.h


Then it builds fine:

[root@b008-02 /usr/local/Moz5/commsrc]
$ time make -f client.mk build
...
real	22m19.838s
user	20m18.452s
sys	1m55.056s

But when I add MOZ_LDAP_XPCOM=1 to mail/app-config.mk

[root@b008-02 /usr/local/Moz5/commsrc]
$ tail -3  mail/app-config.mk
DEFINES += -DMOZ_THUNDERBIRD=1
MOZ_LDAP_XPCOM=1

then it fails the same way as before

c++ -o nsLDAPSyncQuery.o -c -I../../../../dist/include/system_wrappers -include ../../../../config/gcc_hidden.h -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -DMOZ_THUNDERBIRD=1 -DOSTYPE=\"Linux2.6.29.6-217.2.3.fc11.i686\" -DOSARCH=Linux -DMOZ_LDAP_XPCOM  -I. -I. -I../../../../dist/include/xpcom -I../../../../dist/include/string -I../../../../dist/include/intl -I../../../../dist/include/js -I../../../../dist/include/xpconnect -I../../../../dist/include/necko -I../../../../dist/include/profile -I../../../../dist/include/pref -I../../../../dist/include/appcomps -I../../../../dist/include/embedcomponents -I../../../../dist/include/windowwatcher -I../../../../dist/include/mozldap -I../../../../dist/include   -I../../../../dist/include/autoconfig -I/usr/local/Moz5/commsrc/mozilla/dist/include/nspr    -I/usr/local/Moz5/commsrc/mozilla/dist/sdk/include       -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions    -DMOZILLA_CLIENT -include ../../../../mozilla-config.h -Wp,-MD,.deps/nsLDAPSyncQuery.pp nsLDAPSyncQuery.cpp
In file included from nsLDAPSyncQuery.cpp:42:
nsLDAPSyncQuery.h:41:31: error: nsILDAPConnection.h: No such file or directory
nsLDAPSyncQuery.h:42:30: error: nsILDAPOperation.h: No such file or directory
nsLDAPSyncQuery.h:43:36: error: nsILDAPMessageListener.h: No such file or directory
nsLDAPSyncQuery.h:44:24: error: nsILDAPURL.h: No such file or directory
nsLDAPSyncQuery.h:46:30: error: nsILDAPSyncQuery.h: No such file or directory
nsLDAPSyncQuery.cpp:46:27: error: nsILDAPErrors.h: No such file or directory
nsLDAPSyncQuery.cpp:49:28: error: nsILDAPMessage.h: No such file or directory
In file included from nsLDAPSyncQuery.cpp:42:
nsLDAPSyncQuery.h:54: error: expected class-name before ',' token
...

perhaps the way I applied your patch is not correct ?

Or I should rebuild to whole thing from scratch after adding MOZ_LDAP_XPCOM=1, Or I shouldn't add it !?

Any advice ?

Regards .
Comment 19 Mark Banner (:standard8, limited time in Dec) 2009-08-24 10:52:03 PDT
You shouldn't need to explicitly specify MOZ_LDAP_XPCOM now, just make sure you have the two patches applied.
Comment 20 Jehan Procaccia 2009-08-25 05:36:50 PDT
OK, since I don't set MOZ_LDAP_XPCOM=1 in mail/app-config.mk it now compiles fine, and fortunaltly that works :-) .

After applying your latest patchs + https://bug502597.bugzilla.mozilla.org/attachment.cgi?id=389929 to prefcalls.js (which I forgot to apply in the first place ...) it finally works fine as it used to.

Here's what I tested:
cleared any thunderbird user settings:

$ rm -rf /root/.thunderbird/

Set environement variables to tell my autoconfig thunderbird.cfg JS script who I want to test autoconfig with (ME in that case):

[root@b008-06 /usr/local/thunderbirdDebugLibs6/thunderbird-3.0b4pre]
$ export USER=procacci; export MOZILLA_DEBUG=1

I also set MOZILLA_DEBUG=1 because I use the displayError() JS function to "debug" my JS script, because alert() function  doesn't work (I've been told that it's a question of scope ... !?)

if (env_mozdebug) {
        displayError("NO ERROR -> S2IA (jehan.procaccia@int-evry.fr)" + "\nthis message is displayed with displayError() ! \ndebug 1 thunderbird.cfg v1.8 , NO FAILED,  S2IA again !", "\nmail:" + mail + "\nuid:" +uid + "\ncn:" +cn + "\nuser:" + env_user + "\nGivenName:" + givenN );
        }

then thunderbird.cfg which is call thanks to greprefs/all.js:

[root@b008-06 /usr/local/thunderbirdDebugLibs6/thunderbird-3.0b4pre]
$ tail -3 greprefs/all.js
pref("general.config.obscure_value", 0); // for MCD .cfg files
pref('general.config.filename', 'thunderbird.cfg'); // for MCD .cfg files

is executed at thunderbird start, and get correctly information from ldap server for the currently logged in user (USER env variable), 
here's a simplified thunderbird.cfg file:

var env_user    = getenv("USER");
function processLDAPValues (values) {
if(values) {
ldap_values = values;
    var uid = getLDAPValue ( values ,"uid" );
    var cn = getLDAPValue ( values ,"cn" );
    var mail = getLDAPValue ( values ,"mail" );
    var givenN = getLDAPValue ( values ,"givenName" );
lockPref("mail.identity.id1.useremail", mail);
lockPref("mail.server.server2.name", mail );
lockPref("mail.identity.id1.fullName", cn );
lockPref("mail.server.server2.type", "imap");
lockPref("mail.server.server2.userName", env_user );
etc ...
getLDAPAttributes("ldapserver.int-evry.fr","ou=people,dc=int-evry,dc=fr","uid=" + env_user,"uid,cn,mail,givenName");

(all these is detailed at https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig )

then I start the freshly compliled comm-central TB3.0b4:
[root@b008-06 /usr/local/thunderbirdDebugLibs6/thunderbird-3.0b4pre]
$ /usr/local/thunderbirdDebug6/bin/thunderbird

The displayError (my "poor" debug function ...) does show me in a popup the ldap retreived values:

Netscape.cfg/AutoConfig failed. Please contact your system administrator. 
 Error: NO ERROR -> S2IA (jehan.procaccia@int-evry.fr)
this message is displayed with displayError() ! 
debug 1 thunderbird.cfg v1.8 , NO FAILED,  S2IA again ! failed: 
mail:Jehan.Procaccia@it-sudparis.eu
uid:procacci
cn:Jehan PROCACCIA
user:procacci
GivenName:Jehan

and thunderbird is correcly autoconfigure , the user has nothing to do ! Great .

Now, will you include these 2 patchs in mainstream distribution and when ?
I need a source tar.gz to prepare a RPM to distribute it to my hundreds of linux fedora 11 workstations .
what about the Windows version also ? 

Thanks a lot, 
regards .
Comment 21 Mark Banner (:standard8, limited time in Dec) 2009-08-25 05:55:40 PDT
Thanks for testing that Jehan it is good to know that works.

It should work on any platform assuming that there haven't been platform specific issues since the last version.

I need to have a discussion or two about how to land the patches, but I'll get them done as soon as I can - hopefully before beta 4.
Comment 22 Ludovic Hirlimann [:Usul] 2009-08-25 09:07:36 PDT
(In reply to comment #20)

> Now, will you include these 2 patchs in mainstream distribution and when ?
> I need a source tar.gz to prepare a RPM to distribute it to my hundreds of
> linux fedora 11 workstations .

Once it lands - people from redhat will be able to package it for you. If it lands for B4 then the B4 rpms will probably contain it.
Comment 23 Mark Banner (:standard8, limited time in Dec) 2009-08-26 07:16:34 PDT
Created attachment 396714 [details] [diff] [review]
[checked in] Patch for comm-central v2

I spoke to dmose about this yesterday. We agreed that the approach of copying the LDAP component into comm-central and putting it alongside the LDAP files was acceptable - certainly for TB 3; for later versions we may want to revisit the decision/make it clearer what is going on, but for now this is just a straight copy and will get us working for TB 3.

Hence this is just a straight copy of the existing LDAP files from mozilla/extensions/pref/autoconfig with some appropriate build foo to get it integrated.

I'll also file a core bug to get the mozilla-central patch in as well.
Comment 24 Mark Banner (:standard8, limited time in Dec) 2009-08-26 07:39:50 PDT
Comment on attachment 389929 [details] [diff] [review]
Patch for mozilla-central

mozilla-central patch is now in bug 512690.
Comment 25 David :Bienvenu 2009-08-26 07:49:32 PDT
Comment on attachment 396714 [details] [diff] [review]
[checked in] Patch for comm-central v2

r/sr=me on the move/copy, not so much the contents of what's moved :-) it could definitely use some cleaning up, especially the comments and formatting, but I guess we should wait until we're sure where this is going to live.

Thx for fixing this!
Comment 26 Mark Banner (:standard8, limited time in Dec) 2009-08-26 08:06:46 PDT
Comment on attachment 396714 [details] [diff] [review]
[checked in] Patch for comm-central v2

Checked in: http://hg.mozilla.org/comm-central/rev/581cb4a62c6b
Comment 27 Mark Banner (:standard8, limited time in Dec) 2009-08-26 08:18:18 PDT
Status update:

- nsILDAPSyncQuery is now included in comm-central builds.
- The fix to prefcalls.js has been landed on mozilla-central (the "trunk"). I'll give it a day or so, then request approval to land on the 1.9.1 branch which is what Thunderbird 3.0 will ship from.

I've filed bug 512695 for considering how to tidy up the LDAP autoconfig pref components later.
Comment 28 Mark Banner (:standard8, limited time in Dec) 2009-09-01 01:28:45 PDT
Second Status update:

- The fix to prefcalls.js has now landed on the 1.9.1 branch and will be in today's nightly builds once they are generated.

Hence this should all now be fixed for Thunderbird 3.
Comment 29 Jehan Procaccia 2009-09-01 01:37:52 PDT
good news,
is there an official date schedule for TB3 ?
here we have our academic year stating September 7th ... I'am afraid I'll have to deploy on my 300 Linux labs workstations something else than the actual TB3b4 on my fedora11 systems .
I noticed that  seamonkey fedora11 pakage (seamonkey-i586-1.1.17-1.fc11) does contains autoconfig (MCD) fully fonctionnal (prefcall.js with ldap calls OK).

Then I'll probably deploy seamonkey until TB3 release , unless it comes very soon ?

Regards.
Comment 30 Mark Banner (:standard8, limited time in Dec) 2009-09-01 02:04:49 PDT
Thunderbird 3 is likely to be released sometime in November/December. If you're going to deploy something else you may as well deploy thunderbird 2 which should also contain a fully functional prefcall.js and would avoid the need to migrate profiles later.
Comment 31 Magnus Melin 2009-09-05 04:08:27 PDT
Though if you're asking about the next tb3 beta, it's not that far out - https://wiki.mozilla.org/Thunderbird:Thunderbird3:Schedule
Comment 32 Al Billings [:abillings] 2009-10-02 15:35:27 PDT
Can the reporter verify that this is fixed in 1.9.1 with a nightly Thunderbird 3 build?
Comment 33 Jehan Procaccia 2009-10-12 01:22:20 PDT
yes, it does work fine with recent package fedora 11 beta4 :-) :
thunderbird-3.0-2.7.b4.fc11

Indeed prefcall.js had been modified, that's what I noticed :

[jehan@calaz ~]$ diff /usr/lib/thunderbird-3.0b3/defaults/autoconfig/prefcalls.js /tmp/prefcalls-3.0-2.7.b4.fc11.js
172,175c172,179
<         var url = Components.classes[LDAPURLContractID].createInstance(nsILDAPURL);
<     
<         url.spec = "ldap://" + host + "/" + base + "?" + attribs 
<                    + "?sub?" +  filter;
---
>         var urlSpec = "ldap://" + host + "/" + base + "?" + attribs + "?sub?" +
>                       filter;
> 
>         var url = Components.classes["@mozilla.org/network/io-service;1"]
>                             .getService(Components.interfaces.nsIIOService)
>                             .newURI(urlSpec, null, null)
>                             .QueryInterface(Components.interfaces.nsILDAPURL);

However fedora changelog package doesn't mention it , moving from beta3 to beta4 did it anyway .

%changelog
* Thu Sep 17 2009 Jan Horak <jhorak@redhat.com> - 3.0-2.7
- Update to 3.0 beta4

Thanks a lot, now I can move my hundred of linux workstation back to thunderbird autoconfig + ldap calls :-) .

regards .
Comment 34 Jehan Procaccia 2010-04-12 08:22:38 PDT
My hundred of stations recently upgraded to 
thunderbird-3.0.3-1.fc11.i586 and firefox-3.5.8-1.fc11.i586

Autoconfig (lockpref) seems to work fine, but the "hack" I used to debug it (in order to show ldap values retreived from ldapserver by the javascript statup code) :

https://developer.mozilla.org/en/MCD,_Mission_Control_Desktop_AKA_AutoConfig#Debug_with_displayError%28%29

doesn't show anything now :-(

does something bad happened to the displayError() function ? Far away back in time (2003 !)  I also lost the alert() fonction:
https://bugzilla.mozilla.org/show_bug.cgi?id=206294#c14

displaying autoconf ldap values at startup of TB or FF is very useful when settings things up or debuging.
Any other way to display those variables in popups ? what happend to displayError() function ?

Thanks .
Comment 35 Anthony Milan 2010-08-20 02:20:23 PDT
(In reply to comment #34)
> does something bad happened to the displayError() function ? Far away back in
> time (2003 !)  I also lost the alert() fonction:
> https://bugzilla.mozilla.org/show_bug.cgi?id=206294#c14

Hi Jehan,

I modified the $thunderbird/defaults/autoconfig/prefcall.js file where the displayError() function is defined. This function catchs  exceptions so if they are thrown:

JS error in js from MCD server: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPromptService.alert]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///C:\Program Files\Mozilla Thunderbird\defaults\autoconfig\prefcalls.js :: displayError :: line 228"  data: no]

I understood that alerts should be now managed with Activity Manager:
https://developer.mozilla.org/en/Thunderbird_3.1_for_developers#Alerts
Comment 36 Jason Oster (:Parasyte) 2010-11-29 12:33:36 PST
(In reply to comment #35)
> I modified the $thunderbird/defaults/autoconfig/prefcall.js file where the
> displayError() function is defined. This function catchs  exceptions so if they
> are thrown:
> 
> JS error in js from MCD server: uncaught exception: [Exception... "Component
> returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIPromptService.alert]" 
> nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame ::
> file:///C:\Program Files\Mozilla Thunderbird\defaults\autoconfig\prefcalls.js
> :: displayError :: line 228"  data: no]
> 
> I understood that alerts should be now managed with Activity Manager:
> https://developer.mozilla.org/en/Thunderbird_3.1_for_developers#Alerts

Is there a bug on this?  I couldn't find one.  As a workaround, I dropped the following code into my autoconfig script:

> // Enable logging.
> pref("MCD.logging.console", "All");
> pref("MCD.logging.dump", "All");
> Components.utils.import("resource:///modules/gloda/log4moz.js");
> var log = Log4Moz.getConfiguredLogger("MCD");
> 
> // Enable alerts.
> var alerts = alertService = Components.classes["@mozilla.org/alerts-service;1"]
>              .getService(Components.interfaces.nsIAlertsService);
> 
> // displayError() is broken. Let's override it.
> function displayError(title, msg) {
>     log.debug(title + ": " + msg);
>     alerts.showAlertNotification("chrome://branding/content/icon48.png", title, msg);
> }

It makes calls to displayError() asynchronous, which is probably OK.  But at least I can see my errors, again!
Comment 37 Jason Oster (:Parasyte) 2010-12-14 11:26:47 PST
The above workaround does not work on Windows, where there is no system-wide service to capture (more importantly, display) notifications.  It works great on Linux (libnotify) and presumably also on OS X when Growl is installed.
Comment 38 Raphaël Ouazana 2011-04-11 09:28:34 PDT
For your information, I opened #649023 witch seems to be the root cause of displayError not working.
Comment 39 Jehan Procaccia 2011-07-25 11:17:28 PDT
Unfortunalty latest thunderbird packages broke again the autoconfig feature .

in my case thunderbird-5.0-1.fc15.i686 on fedora 15 doesn't include prefcalls.js
in "comment 27" of this bugzilla, it's told that the feature was included in mozilla-central for TB3, now that we jumped to TB5 what can we expect ?
I notice the same pb on windows 7 , TB5 doesn't include $MOZILLA_HOME/defaults/autoconfig/prefcalls.js
is it again a question of enabling "MOZ_LDAP_XPCOM=1" at compile time as proposed in "comment 3", or the whole thing changed / diseapeared  ?

Thanks for preserving autoconfig + ldap calls  available in mozilla products .
Regards
Comment 40 Mark Banner (:standard8, limited time in Dec) 2011-07-25 13:17:00 PDT
prefcalls.js is now included in omni.jar, and the code has been updated to get prefcalls.js from that jar. So this should all still work, the file just isn't directly usable at the moment.
Comment 41 Jehan Procaccia 2011-07-25 14:35:55 PDT
OK, I confirm that prefcalls.js in in the a jar now:

# jar -tvf /usr/lib/thunderbird-5.0/omni.jar  | grep prefcalls.js
  7499 Fri Jun 24 20:23:08 CEST 2011 defaults/autoconfig/prefcalls.js

So I tried to used autoconfig as usual:

call to thunderbird.cfg

[root@calaz pref]# pwd
/usr/lib/thunderbird-5.0/defaults/pref
[root@calaz pref]# cat tb-autoconf.js 
// SYNTAX HINTS:  dashes are delimiters.  Use underscores instead.
//  The first character after a period must be alphabetic.

// Jehan
pref("general.config.obscure_value", 0); // for MCD .cfg files
pref('general.config.filename', 'thunderbird.cfg'); // for MCD .cfg files

the lockPref/defaultPref file thunderbird.cfg

[root@calaz thunderbird-5.0]# pwd
/usr/lib/thunderbird-5.0
[root@calaz thunderbird-5.0]# ls -l thunderbird.cfg 
-rwxr-xr-x. 1 root root 6931 Jul 25 23:27 thunderbird.cfg


Try to debug as much as possible

[testloc@calaz ~]$ export MOZILLA_DEBUG=1
[testloc@calaz ~]$ export NSPR_LOG_MODULES=MCD:5
[testloc@calaz ~]$ export NSPR_LOG_FILE=/tmp/thunderbird-log.txt

Start thunderbird

[testloc@calaz ~]$ rm -rf .thunderbird/
[testloc@calaz ~]$ thunderbird 
-- Exception object --
+ QueryInterface (function) 3 lines
+ message (string) 'Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getCharPref]'
+ result (number) 2147549183
+ name (string) 'NS_ERROR_UNEXPECTED'
+ filename (string) 'resource:///modules/mailnewsMigrator.js'
+ lineNumber (number) 80
+ columnNumber (number) 0
+ location (object) JS frame :: resource:///modules/mailnewsMigrator.js :: MigrateServerAuthPref :: line 80
+ inner (object) null
+ data (object) null
+ initialize (function) 3 lines

no way to know what went wrong, i don't even know if autoconfig is to blame as I don't have debug information
/tmp/thunderbird-log.txt is empty .

However I supect that autoconfig is responsible, because if I remove the call to thunderbid.cfg by removing file /usr/lib/thunderbird-5.0/defaults/pref/tb-autoconf.js then thunderbird starts without error. So at least autoconfig is probably still alive ... but How can I check what went wrong, how can I trace it's execution ?

Thanks .
Comment 42 Mark Banner (:standard8, limited time in Dec) 2011-07-25 15:07:09 PDT
Please ask in the newsgroups or file a new bug - continuing here on a closed bug isn't the right way to move this forward.
Comment 43 Jehan Procaccia 2011-07-26 10:15:29 PDT
Ok I filled a new bug:

https://bugzilla.mozilla.org/show_bug.cgi?id=674261

PS: regarding that feature and more globaly about large enterprise deployement, I met this morning JB Piacentino and Tristan Nitot who conforts me to keep arguing for preserving that feature in the core and suggested me also to take part in http://blog.mozilla.com/blog/2011/07/19/announing-mozilla-enterprise-user-working-group/
I hope we'll preserve that feature in the future

Regards .
Comment 44 Jehan Procaccia 2011-07-26 14:15:53 PDT
Good news, that finally works fine
I can't remember for sure why it fails in the 1st place with TB5, I propably mixed up location of autoconfig.js file from greprefs to default/pref and wrongly ordered my tests ... now I restarted the precedure from scratch and it works like a charm ;-) either on linux or windows (7) with TB5, I still have to check firefox5 though ... 

I've updated the MCD aka autoconfig doc acordingly
https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig 

Many thanks to the mozilla developpers who maintained that feature in the core of the public packages .

Sorry for the buzz .
Comment 45 Mark Banner (:standard8, limited time in Dec) 2011-07-27 01:16:55 PDT
No problem, glad you got it working.
Comment 46 Jehan Procaccia 2011-07-27 05:38:57 PDT
yesterday i mentioned that I had to test with firefox5 ...
I had difficulties because the defaults/pref directory doesn't exist in FF5 :-(
To make it run  I had to manually create it, but it wasn't sufficient, looking at omni.jar in FF5 I noticed that it's not defaults/pref but rather defaults/preferences !
moving the call to firefox.cfg in there made it work though ;-) 

Unfortunatly ldap calls still don't work in FF5, although they do in TB5, is it because default/autoconfig/prefcalls.js doesn't seem to be there in FF5 ?
then how comes defaultpref and lockpref do work in FF5 ?
I'am confuse again now for FF5 and autoconfig + ldap calls
Mark, does you remark on https://bugzilla.mozilla.org/show_bug.cgi?id=295329#c16 
is always true ?

PS: shoudl I open a new bug specific to FF5 ? or continue on id=295329 ?
Comment 47 Jehan Procaccia 2011-07-27 05:49:42 PDT
I forgot to mention the error message when ldap calls are enabled in FF5 firefox.cfg file:

Netscape.cfg/AutoConfig failed. Please contact your system administrator.
 Error: getLDAPAttibutes failed: [Exception... "Could not convert JavaScript argument arg 0 [nsISupports.QueryInterface]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: prefcalls.js :: getLDAPAttributes :: line 177"  data: no]

I detailed my experience in 
https://developer.mozilla.org/index.php?title=en/MCD%2C_Mission_Control_Desktop_AKA_AutoConfig#Firefox5
Comment 48 Mark Banner (:standard8, limited time in Dec) 2011-07-27 08:26:44 PDT
FF is highly unlikely to do LDAP without an extension - there is no LDAP in FF at all now. Bug 295329 would be a more appropriate place for discussion on that topic.

Note You need to log in before you can comment on or make changes to this bug.