[horde] Horde Groupware Webmail Edition 4.0.5, PostgreSQL 9.0.6, horde_prefs bytea value not correct

Alex Meier alex at ksz.ch
Thu Jan 12 11:37:11 UTC 2012



Am 11.01.2012 22:01, schrieb Jan Schneider:
>
> Zitat von Alex Meier <alex at ksz.ch>:
>
>> I'm not shure I'm writing to the correct mailing list, but I thought I
>> first ask here before writing to the developer list.
>>
>> With the last update of the horde groupware webmail edition the
>> horde_prefs table somehow got wrong entries.
>> The pref_value field in horde_prefs was altered from text to bytea.
>> All values now look like this:
>>
>> "\x613a313a7b693a303b613a31373a7b733a31363a2264656661756c745f6964656e74697479223b693a303b733a393a2266726f6d5f61646472223b733a32333a22626172626172612e6772756574746572406b737a2e6368223b733a38
>>
>> 3a2266756c6c6e616d65223b733a303a22223b733a323a226964223b733a31383a225374616e646172646964656e746974c3a474223b733a31303a226964656e746974696573223b733a3436323733353a227836313361333133613762363933613330336236313361333733613762373333613331333
>>
>> 633613232363436353636363137353663373435663639363436353665373436393734373932323362363933613330336237333361333933613232363637323666366435663631363436343732323233623733336133323333336132323632363137323632363137323631326536373732373536353734
>>
>> 373436353732343036623733376132653633363832323362373333613338336132323636373536633663366536313664363532323362373333613330336132323232336237333361333233613232363936343232336237333361333133383361323235333734363136653634363137323634363936343
>>
>> 635366537343639373463336134373432323362373333613331333033613232363936343635366537343639373436393635373332323362373333613332333333313331333433373361323237383336333133333631333333313333363133373632333633393333363133333330333336323336333133
>>
>> 333631333333373333363133373632333733333333363133333331333333363333363133323332333633343336333533363336333633313337333533363633333733343335363633363339333633343336333533363635333733343336333933373334333733393332333233333632333633393333363
>>
>> 133333330333336323337333333333631333333393333363133323332333633363337333233363636333636343335363633363331333633343336333433373332333233323333363233373333333336313333333233333333333336313332333233363332333633313337333233363332333633313337
>>
>> 3332333633313332363533363337333733323337333533363335333733343337333433363335333733323334333033363632333733333337363133323635333"
>>
>>
>> This is the beginning of an identity entry in the horde_prefs table.
>> The complete field contains 926'416 signs, mostly the number 3. The
>> field grows every time a user logs in and alters his identity. The
>> values can't be read correctly. Before conversion from text to bytea,
>> the values were much, much smaller (and plain text). I don't know
>> what's going wrong. I found the following messages in the Horde Debug
>> Log:
>>
>> 2011-11-10T17:43:33+01:00 DEBUG: HORDE [mnemo] Horde_Prefs: Storing
>> preference value (display_notepads) [pid 4340 on line 200 of
>> "/usr/share/pear/Horde/Prefs.php"]
>> 2011-11-10T17:43:35+01:00 NOTICE: HORDE [imp] PHP ERROR: Array to
>> string conversion [pid 4340 on line 156 of
>> "/usr/share/pear/Horde/Mail/Rfc822.php"]
>> 2011-11-10T17:43:35+01:00 DEBUG: HORDE 1.
>> IMP_Views_ShowMessage->showMessage()
>> /data/www/html/imp/message-dimp.php:52
>>
>> There are other log entries to, but I can't really figure out which
>> are related to the problem. This is the only logmessage during login
>> which I think could be related to the problem.
>>
>> It's ok for me to completely reset all horde_prefs (actually I've
>> allready done this, but it fills up with the same values). Does anyone
>> has a suggestion whats going wrong?
>>
>> With tcpdump I can see, that horde sends the values allready in this
>> form. So I assume it's not going wrong on the database side.
>> The database is in UTF8, localization is de.CH, the charset setting in
>> Horde is also set to UTF8.
>>
>> Horde Groupware Webmail Version 4.0.5
>> PostgresSQL Version 9.0.6
>> PHP Version 5.3.3
>> Apache Version 2.2.15
>> RHEL Version 2.6.32-220.el6.x86_64
>>
>> I know I don't have much useful information, I would simply be happy
>> about an idea what to look for. I assume I made a pretty bad
>> configuration mistake I just can't see.
>
> See http://bugs.horde.org/ticket/9153 and
> http://bugs.horde.org/ticket/10803 for some background why and how this
> happened. And please make sure that you're not affected by
> http://bugs.horde.org/ticket/10881.
>
> Bottom line: this generally looks fine, as it's encoded binary content.
> Whether the *actual* content is correct, I can't tell though.
>
> Jan.
>

You write in one of the tickets, that there are unit tests for the 
database. Where do I find them?

Where can I find the function in the code to decode the binary content? 
So I could write a little test script to see what is actually stored in 
the field.

I also think it's writing correct encoded binary content. my guess is, 
that something goes wrong when reading the content. All the identity 
settings are empty on the webinterface after every login alltough 
there's binary data stored in the identity field in horde_prefs. 
Everytime you enter new values in the webmail interface, the value in 
the horde_prefs table grows. But the then stored data isn't all correct 
information. At the beginning and the end of the bytea field, the binary 
values look pretty good, but the middle part just looks like this:

333336333333343333333333333336333333333333333533333333333333323333333333333332333333333333333333333336333333323333333333333337333333333333333333333333333333333333333633333331333333333333333333333333333333303333333333333333333333363333333
133333333333333323333333333333332333333333333333233333333333333323333333333333333333333363333333233333333333333373333333333333333333333333333333333333336333333313333333333333333333333333333333233333333333333333333333633333331333333333333
333233333333333333323333333333333336333333333333333933333333333333363333333333333334333333333333333233333333333333323333333333333333333333363333333233333333333333373333333333333333333333333333333333333336333333313333333333333333333333333
333333133333333333333333333333333333338333333333333333333333336333333313333333333333332333333333333333233333333333333353333333333333333333333333333333733333333333333343333333333333336333333333333333133333333333333363333333633333335333333
333333333633333333333333343333333333333336333333333333333133333333333333373333333333333332333333333333333633333333333333343333333333333336333333333333333933333333333333363333333333333334333333333333333633333333333333353333333333333336333
333363333333533333333333333373333333333333334333333333333333633333333333333393333333333333337333333333333333433333336333333333333333333333333333333363333333133333333333333343333333333333337333333333333333433333333333333323333333333333332
333333333333333333333336333333323333333333333337333333333333333333333333333333333333333633333331333333333333333333333333333333313333333333333333333333333333333033333333333333333333333633333331333333333333333233333333333333323333333333333
336333333333333333933333333333333363333333333333334333333333333333633333333333333353333333333333336333333363333333533333333333333373333333333333334333333333333333633333333333333393333333333333337333333333333333433333333333333363333333333
333339333333333333333633333333333333353333333333333337333333333333333333333333333333323333333333333332333333333333333333333336333333323333333333333337333333333333333333333333333333333333333633333331333333333333333333333333333333393333333
333333333333333333333333433333333333333333333333333333337333333333333333333333336333333313333333333333332333333333333333233333333333333373333333333333338333333333333333333333333333333363333333333333333333333333333333133333333333333333333
333333333333333333333333333633333333333333313333333333333333333333333333333333333333333333333333333333333331333333333333333333333333333333333333333333333336333333333333333133333333333333333333333333333337333333333333333633333333333333323
333333333333333333333333333333633333333333333333333333333333339333333333333333333333333333333333333333333333336333333333333333133333333333333333333333333333333333333333333333333333333333333303333333333333333333333333333333333333333333333
363333333333333332333333333333333333333333333333363333333333333333333333333333333133333333333333333333333333333333333333333333333633333333333333313333333333333333333333333333333333333333333333333333333333333331333333333333333333333333333
333333333333333333333333333333333333733333333333333333333333333333333333333333333333633333333333333313333333333333333333333333333333733333333333333363333333333333332333333333333333333333333333333373333333333333333333333333333333333333333
333333333333333333333333333333333333333633333333333333313333333333333333333333333333333333333333333333333333333333333331333333333333333333333333333333333333333333333333333333333333333633333333333333333333333333333333333333333333333633333
333333333313333333333333333333333333333333233333333333333333333333333333332333333333333333333333333333333363333333333333333333333333333333433333333333333333333333333333336333333333333333333333333333333353333333333333333333333333333333633
333333333333333333333333333336333333333333333333333333333333363333333333333333333333333333333133333333333333333333333333333337333333333333333333333333333333353333333333333333333333333333333633333333333333363333333333333333333333333333333
333333333333333373333333333333333333333333333333433333333333333333333333333333335333333333333333633333333333333363333333333333333333333333333333633333333333333333333333333333339333333333333333333333333333333363333333333333333333333333333
333433333333333333333333333333333336333333333333333333333333333333353333333333333333333333333333333633333333333333363333333333333335333333333333333333333333333333373333333333333333333333333333333433333333333333333333333333333336333333333
33333333333333333333339333333333333333333333333333333373333333333333333333333333333333433333333333333333333333333333337333333333333333333333333333333393333333333333333333333333333333233333333333333333333333333333332

This can add up to way more than 1'000'000 signs. I only saved the 
e-mail adress and the full name. I guess, either the first or the last 
part of the identity field contains the correct values, but the decoding 
fails cause of the rest of the data. What I don't understand is, that 
even with a completely clean horde_prefs table, I get the same behaviour.
This is the definition of the horde_prefs table, I think this looks 
quite correct:

Table "public.horde_prefs"
    Column   |          Type          |               Modifiers 

------------+------------------------+----------------------------------------
  pref_uid   | character varying(255) | not null
  pref_scope | character varying(16)  | not null default ''::character 
varying
  pref_name  | character varying(32)  | not null
  pref_value | bytea                  |
Indexes:
     "horde_prefs_pkey" PRIMARY KEY, btree (pref_uid, pref_scope, pref_name)
     "index_horde_prefs_on_pref_scope" btree (pref_scope)
     "index_horde_prefs_on_pref_uid" btree (pref_uid)




-- 

Kantonsschule Zug
Alex Meier
Lüssiweg 24, 6302 Zug
Tel: 041 728 13 98
alex.meier at ksz.ch   http://www.ksz.ch/


More information about the horde mailing list