6.0.0-git
2019-03-23

[#10003] unknown address book "localsql"
Summary unknown address book "localsql"
Queue Turba
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester vilius (at) lnk (dot) lt
Created 2011-04-28 (2886 days ago)
Due
Updated 2011-08-02 (2790 days ago)
Assigned 2011-05-18 (2866 days ago)
Resolved 2011-05-18 (2866 days ago)
Milestone
Patch No

History
2011-08-02 14:20:28 vilius (at) lnk (dot) lt Comment #18 Reply to this comment
Maybe a wording can be adjusted then. Something like "Available 
address books:" instead of "Address books that won't be displayed:".
2011-08-02 14:11:25 Michael Rubinsky Comment #17 Reply to this comment
This is by design.  If there are no address books at all selected (the 
default), then ALL address books are displayed. Otherwise, there would 
be nothing in the Turba UI to see at all.
2011-08-02 09:08:00 vilius (at) lnk (dot) lt Comment #16 Reply to this comment
available address books by default. The list on the left says "These 
address books will display in this order:". It is empty. However all
I ment "on the right" here.
2011-08-02 09:06:41 vilius (at) lnk (dot) lt Comment #15 Reply to this comment
Sadly I don't have old data anymore. But these integer values are from 
turba_shares/turba_sharesng table column share_id. So maybe there is 
something wrong in _updateShareName ? As far as I can tell it is the 
only place where these values can be returned.

Anyway, I have purged all 'addressbooks' preferences to see if the 
problem would appear again.

By the way, there is an inconsistency in Turba GUI. Under Address 
Books preferences addressbook list on the left says "Address books 
that will not be displayed:" and this list is populated with all 
available address books by default. The list on the left says "These 
address books will display in this order:". It is empty. However all 
available address books are displayed by default. Even if the user 
re-saves with all addressbooks on the left, they all are displayed 
everywhere.
2011-08-02 06:34:52 Michael Rubinsky Comment #14 Reply to this comment
When looking into database I see that this user somehow got new line 
into his preference:
When did this entry get added? I have no idea where that numeric value 
would have come from. It's not a valid horde 3 value, nor a valid 
horde 4 value for the addressbooks pref.

[Show Quoted Text - 30 lines]
Well, the upgrade task wouldn't produce those values. So if it ran, 
something went *really* wrong. If it didn't run, those values are 
corrupt anyway. You will have to track this down in 
Turba_LoginTasks_SystemTask_Upgrade#_upgradeAbookPrefs() with a fresh 
set of unupdated data and see what the values are at different points 
along the process.

2011-08-02 06:14:30 vilius (at) lnk (dot) lt Comment #13 Reply to this comment
OK, I found out that this is not related to add_source preference. I 
deleted all add_sources which point to 'localsql'. I have also 
configured a hook to choose default address book in imp for adding 
addresses automatically.

I have added:
Horde::logMessage(var_export($lines, true) . " user: ". 
$GLOBALS['registry']->getAuth(), 'ERR');

under if (!empty($lines)) on line 67 in Turba.php and got the 
following output on failling users:

2011-08-02T01:26:06+03:00 ERR: HORDE [turba] 345 user: martas@lnk.lt 
[pid 15040 on line 68 of "/var/www/html/horde/turba/lib/Turba.php"]
2011-08-02T01:26:06+03:00 WARN: HORDE [turba] PHP ERROR: Invalid 
argument supplied for foreach() [pid 15040 on line 70 of 
"/var/www/html/horde/turba/lib/Turba.php"]

When looking into database I see that this user somehow got new line 
into his preference:
mysql> select * from horde_prefs where pref_uid = 'martas@lnk.lt' and 
pref_name = 'addressbooks';
+---------------+------------+--------------+------------+
| pref_uid      | pref_scope | pref_name    | pref_value |
+---------------+------------+--------------+------------+
| martas@lnk.lt | turba      | addressbooks |
345       |
+---------------+------------+--------------+------------+
1 row in set (0.00 sec)

Also I'm not sure, but there are other users who have 'addressbooks' 
set to simple numbers from ~250 to ~400.

mysql> select * from horde_prefs where pref_name = 'addressbooks' and 
pref_value LIKE '____';
+--------------------------+------------+--------------+------------+
| pref_uid                 | pref_scope | pref_name    | pref_value |
+--------------------------+------------+--------------+------------+
| kitokie@lnk.lt           | turba      | addressbooks |
388       |
| raimonda@lnk.lt          | turba      | addressbooks |
350       |
| simkus@lnk.lt            | turba      | addressbooks |
330       |
| daugirdaite@lnk.lt       | turba      | addressbooks |
332       |

..........

Seems like upgrade task problem to me. No?
2011-05-19 18:39:22 vilius (at) lnk (dot) lt Comment #12 Reply to this comment
Yes, I know that, I was reffering to the same error messages in 
posters log file as mine.
2011-05-19 15:54:44 Michael Rubinsky Comment #11 Reply to this comment
This isn't related to IMP's pref at all...and that pref did not need 
any conversion going from recent H3 to H4 at all.
2011-05-19 15:29:13 vilius (at) lnk (dot) lt Comment #10 Reply to this comment
There is at least one more user on the list with the same errors: 
http://lists.horde.org/archives/horde/Week-of-Mon-20110516/040864.html

(message is not exactlty about my problem, but you can see the same 
errors in the log)
2011-05-19 07:00:04 vilius (at) lnk (dot) lt Comment #9 Reply to this comment
... More over, old address books are
accessable through Turba, it's just IMP which doesn't save addresses
to it on send.
Yes, because it's IMP's preference that did not contain the correct value.
OK. Is there a way to set this preference for all users? Or should I 
just delete it completely and IMP will recreate it automatically? 
Also, what it should be set in imp/config/prefs.local.php ? I want 
user's address book to be the default to add addresses to.
2011-05-19 06:18:04 Michael Rubinsky Comment #8 Reply to this comment
Then I don't understand why re-saving preferences works
Because it saves the new, correct identifiers for the address book(s).

and keeps all
old addresses and address books. More over, old address books are 
accessable through Turba, it's just IMP which doesn't save addresses 
to it on send.
Yes, because it's IMP's preference that did not contain the correct value.
If preferences are corrupt, shouldn't Horde just create completely 
new address book?
Why? It's the preference telling IMP which address book to use to add 
email addresses to. Why should Turba create a new address book if that 
preference isn't set correctly?

2011-05-19 06:12:15 vilius (at) lnk (dot) lt Comment #7 Reply to this comment
Then I don't understand why re-saving preferences works and keeps all 
old addresses and address books. More over, old address books are 
accessable through Turba, it's just IMP which doesn't save addresses 
to it on send.

If preferences are corrupt, shouldn't Horde just create completely new 
address book?
2011-05-18 22:17:31 Michael Rubinsky Comment #6
State ⇒ Not A Bug
Reply to this comment
Before the upgrade:
imp add_source localsql
turba addressbooks user@example.com
These are not valid values for this preference from any recent Horde 3 
version. Closing ticket as this was probably just stale or corrupt 
values going into the upgrade.
2011-05-18 15:47:51 Jan Schneider Assigned to Michael Rubinsky
State ⇒ Assigned
 
2011-05-06 05:53:37 vilius (at) lnk (dot) lt Comment #5 Reply to this comment
Yes I were using shares.

BTW, this is an upgrade from Horde 3 CVS which always was kept up to 
date with HEAD until ~2008 06 and worked fine.
2011-05-06 00:32:02 Michael Rubinsky Comment #4 Reply to this comment
Were you using shares before the upgrade as well? Or did you switch 
this after moving to Horde 4? The 'localsql' value in the prefs looks 
like it wasn't using shares, or was using a very early implementation 
of them...
2011-05-04 11:13:22 vilius (at) lnk (dot) lt Comment #3 Reply to this comment
Before the upgrade:

imp search_sources is empty
imp add_source localsql
turba addressbooks user@example.com

And after I upgrade and re-save:

imp search_sources ["295f46b5435cad5c0dad66a9dc763a71"]
imp add_source 295f46b5435cad5c0dad66a9dc763a71
turba addressbooks ["","295f46b5435cad5c0dad66a9dc763a71"]


2011-05-03 22:10:08 Michael Rubinsky Comment #2
State ⇒ Feedback
Priority ⇒ 1. Low
Reply to this comment
Not seeing this.

Can you provide the pre-upgrade value of the pref in question, and the 
post-upgrade value?
2011-04-28 11:40:22 vilius (at) lnk (dot) lt Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ unknown address book "localsql"
Queue ⇒ Turba
Milestone ⇒
Patch ⇒ No
Reply to this comment
H3 -> H4 upgrade seem doesn't migrate prefered address book for adding 
addresses in IMP. After the upgrade every time when a user sends a 
message I get:

2011-04-28T14:30:41+03:00 WARN: HORDE [turba] PHP ERROR: Invalid 
argument supplied for foreach() [pid 13925 on line 149 of 
"/var/www/html/horde/turba/lib/Turba.php"]

Also IMP interface shows "Could not find address book "localsql"" 
notifications when sending a message.

Going into IMP preferences and readjusting address books solves the problem.

I'm using localsql source with shares enabled. Also there are some 
other globally shared address books from one user.

Saved Queries