Closed Bug 1729254 Opened 3 years ago Closed 3 years ago

LDAP search shows no result after TB 91 update - for autoconfig

Categories

(Thunderbird :: Address Book, defect)

Thunderbird 91
defect

Tracking

(thunderbird_esr91+ fixed, thunderbird92 wontfix, thunderbird93+ fixed)

RESOLVED FIXED
94 Branch
Tracking Status
thunderbird_esr91 + fixed
thunderbird92 --- wontfix
thunderbird93 + fixed

People

(Reporter: martin.vallanzasca, Assigned: rnons)

References

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0

Steps to reproduce:

Updated Thunderbird from 78 to 91.0.3

Actual results:

LDAP search does not give any result.
Errors in console (not sure if linked, but triggers every time i make a search) :

NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getComplexValue] AddrBookDirectory.jsm:646
getLocalizedStringValue resource:///modules/AddrBookDirectory.jsm:646
get dirName resource:///modules/AddrBookDirectory.jsm:155
getText chrome://messenger/content/addressbook/abTrees.js:34
getCellText chrome://messenger/content/jsTreeView.js:44


Uncaught
Exception { name: "NS_ERROR_UNEXPECTED", message: "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getComplexValue]", result: 2147549183, filename: "resource:///modules/AddrBookDirectory.jsm", lineNumber: 646, columnNumber: 0, data: null, stack: "getLocalizedStringValue@resource:///modules/AddrBookDirectory.jsm:646:29\nget dirName@resource:///modules/AddrBookDirectory.jsm:155:28\ngetText@chrome://messenger/content/addressbook/abTrees.js:34:5\ngetCellText@chrome://messenger/content/jsTreeView.js:44:31\n", location: XPCWrappedNative_NoHelper }

columnNumber: 0

data: null

filename: "resource:///modules/AddrBookDirectory.jsm"

lineNumber: 646

location: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: Getter, name: Getter, … }
​​
QueryInterface: function QueryInterface()
​​
asyncCaller: null
​​
asyncCause: null
​​
caller: XPCWrappedNative_NoHelper { QueryInterface: QueryInterface(), filename: , name: , … }
​​
columnNumber: 29
​​
filename: "resource:///modules/AddrBookDirectory.jsm"
​​
formattedStack: "getLocalizedStringValue@resource:///modules/AddrBookDirectory.jsm:646:29\nget dirName@resource:///modules/AddrBookDirectory.jsm:155:28\ngetText@chrome://messenger/content/addressbook/abTrees.js:34:5\ngetCellText@chrome://messenger/content/jsTreeView.js:44:31\n"
​​
lineNumber: 646
​​
name: "getLocalizedStringValue"
​​
nativeSavedFrame: SavedFrame { source: "resource:///modules/AddrBookDirectory.jsm", sourceId: 53, line: 646, … }
​​
sourceId: 53
​​
sourceLine: ""
​​
toString: function toString()
​​
<get asyncCaller()>: function asyncCaller()
​​
<get asyncCause()>: function asyncCause()
​​
<get caller()>: function caller()
​​
<get columnNumber()>: function columnNumber()
​​
<get filename()>: function filename()
​​
<get formattedStack()>: function formattedStack()
​​
<get lineNumber()>: function lineNumber()
​​
<get name()>: function name()
​​
<get nativeSavedFrame()>: function nativeSavedFrame()
​​
<get sourceId()>: function sourceId()
​​
<get sourceLine()>: function sourceLine()
​​
<prototype>: Object { … }

message: "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.getComplexValue]"

name: "NS_ERROR_UNEXPECTED"

result: 2147549183

stack: "getLocalizedStringValue@resource:///modules/AddrBookDirectory.jsm:646:29\nget dirName@resource:///modules/AddrBookDirectory.jsm:155:28\ngetText@chrome://messenger/content/addressbook/abTrees.js:34:5\ngetCellText@chrome://messenger/content/jsTreeView.js:44:31\n"

<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
​​
columnNumber:
​​
data:
​​
filename:
​​
lineNumber:
​​
location:
​​
message:
​​
name:
​​
result:
​​
stack:
​​
toString: function toString()
​​
Symbol(Symbol.toStringTag): "Exception"
​​
<get columnNumber()>: function columnNumber()
​​
<get data()>: function data()
​​
<get filename()>: function filename()
​​
<get lineNumber()>: function lineNumber()
​​
<get location()>: function location()
​​
<get message()>: function message()
​​
<get name()>: function name()
​​
<get result()>: function result()
​​
<get stack()>: function stack()
​​
<set stack()>: function stack()
​​
<prototype>: Object { … }
AddrBookDirectory.jsm:646
getLocalizedStringValue resource:///modules/AddrBookDirectory.jsm:646
get dirName resource:///modules/AddrBookDirectory.jsm:155
getText chrome://messenger/content/addressbook/abTrees.js:34
getCellText chrome://messenger/content/jsTreeView.js:44

Expected results:

Show results.
Rolling back to old ldap system by setting mailnews.ldap.jsmodule to false makes it work again.

Interesting, do you have any special chars in the address book name?

Why is getComplexValue used to get the description, AString should become normal js string. Geoff do you have some ideas about this?

Flags: needinfo?(geoff)

No special chars in the addressbook name, here is the ldap config in prefs.js :

user_pref("ldap_2.autoComplete.directoryServer", "ldap_2.servers.ACGre");
user_pref("ldap_2.autoComplete.useDirectory", true);
user_pref("ldap_2.servers.ACGre.auth.dn", "");
user_pref("ldap_2.servers.ACGre.auth.saslmech", "");
user_pref("ldap_2.servers.ACGre.description", "AC Gre");
user_pref("ldap_2.servers.ACGre.filename", "ldap.sqlite");
user_pref("ldap_2.servers.ACGre.maxHits", 100);
user_pref("ldap_2.servers.ACGre.uid", "b918d476-ad66-4451-91a0-f99b7f060166");
user_pref("ldap_2.servers.ACGre.uri", "ldap://ldap.REDACTED/ou=ac-grenoble,ou=education,o=gouv,c=fr??sub?(objectclass=*)");

getComplexValue is used because the built-in address books have localised names. See how they're stored in the preferences. It's weird that it's throwing NS_ERROR_UNEXPECTED which typically means the preference is missing, but it's not according to comment 2.

Flags: needinfo?(geoff)

Can you run the following in the DevTools and tell me the result?

Services.prefs.getComplexValue('ldap_2.servers.ACGre.description', Ci.nsIPrefLocalizedString).data
Flags: needinfo?(martin.vallanzasca)

Services.prefs.getComplexValue('ldap_2.servers.ACGre.description', Ci.nsIPrefLocalizedString).data
"AC Gre"

I dont get it, after setting mailnews.ldap.jsmodule to false then back to true it seems to be working...

Kinda weird, but as we have autoconf and some other tweaks it might be related, ill take a look closer into this and if i reproduce ill let you know..

Anyway thank you for your hints, ill close the bug report

Flags: needinfo?(martin.vallanzasca)
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID

Ok, it is linked to autoconf, i am able to reproduce the issue (made a confusion between profiles)

With a new profile, and an autoconf.js file in TBFolder/default/prefs containing this :

pref("ldap_2.autoComplete.useDirectory", true);
pref("ldap_2.servers.AcadmieGrenoble.auth.dn", "");
pref("ldap_2.servers.AcadmieGrenoble.auth.saslmech", "");
pref("ldap_2.servers.AcadmieGrenoble.description", "AC Gre");
pref("ldap_2.servers.AcadmieGrenoble.filename", "ldap.sqlite");
pref("ldap_2.servers.AcadmieGrenoble.maxHits", 100);
pref("ldap_2.servers.AcadmieGrenoble.uri", "ldap://ldap.redacted/ou=ac-grenoble,ou=education,o=gouv,c=fr??sub?(objectclass=*)");
pref("ldap_2.autoComplete.directoryServer", "ldap_2.servers.AcadmieGrenoble");

It shows an empty addressbook, and triggers the errors.

Setting mailnews.ldap.jsmodule to false it works

Flags: needinfo?(remotenonsense)

The problem is getComplexValue doesn't work with autoconfig, don't know why, but I guess it's related to autoconfig runs all prefs in a sandboxed js context.

Assignee: nobody → remotenonsense
Status: RESOLVED → REOPENED
Ever confirmed: true
Flags: needinfo?(remotenonsense)
Resolution: INVALID → ---
Blocks: tb91found
Summary: LDAP search shows no result after TB 91 update → LDAP search shows no result after TB 91 update - for autoconfig
Target Milestone: --- → 94 Branch

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/6313f8d1360d
Fix address book initialized by autoconfig prefs. r=darktrojan

Status: REOPENED → RESOLVED
Closed: 3 years ago3 years ago
Resolution: --- → FIXED

Comment on attachment 9239723 [details]
Bug 1729254 - Fix address book initialized by autoconfig prefs. r=darktrojan

[Approval Request Comment]
Regression caused by (bug #): bug 1696625
User impact if declined: Autoconfiged addressbooks don't work, not only ldap books
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): low

Attachment #9239723 - Flags: approval-comm-esr91?
Attachment #9239723 - Flags: approval-comm-beta?

Comment on attachment 9239723 [details]
Bug 1729254 - Fix address book initialized by autoconfig prefs. r=darktrojan

[Triage Comment]
Approved for beta

Attachment #9239723 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9239723 [details]
Bug 1729254 - Fix address book initialized by autoconfig prefs. r=darktrojan

[Triage Comment]
Approved for esr91

Attachment #9239723 - Flags: approval-comm-esr91? → approval-comm-esr91+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: