5.0.0.2 Can not make DB if use Estonia in installation time

Bug #327294 reported by Tanel Kurvits
8
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

So i think that bug may be affect more languages so its critical i think.

1. removed all old installations in /usr/lib/python2.5/site-packages/open*

2. Installed server and client v 5.0.0.2

3. runned server in console:
openerp-server -r openterp -w openterp --db_host 127.0.0.1

4. Connected old trunk database (EE-lang) - OK no problemos amigos

5. Made new database and choosed in installation time Estonia.
In client crash popup :
#Error during database creation !
#The server crashed during installation.
#We suggest you to drop this database.

Server console:
...
[2009-02-09 19:40:31,439] INFO:init:module base_setup: loading base_setup_wizard.xml
[2009-02-09 19:40:31,497] INFO:init:[01]: Assertions report:
[2009-02-09 19:40:31,497] INFO:init:[02]: Level success failed
[2009-02-09 19:40:31,497] INFO:init:[03]: error 1 0
[2009-02-09 19:40:31,497] INFO:init:[04]: total 1 0
[2009-02-09 19:40:31,497] INFO:init:[05]: end of report (1 assertion(s) checked)
[2009-02-09 19:40:31,511] INFO:i18n:module base: loading translation file for language et_EE
[2009-02-09 19:40:31,548] ERROR:web-services:[01]: CREATE DATABASE
[2009-02-09 19:40:31,548] ERROR:web-services:[02]: Traceback (most recent call last):
[2009-02-09 19:40:31,548] ERROR:web-services:[03]: File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 97, in __call__
[2009-02-09 19:40:31,548] ERROR:web-services:[04]: modobj.update_translations(cr, 1, mids, lang)
[2009-02-09 19:40:31,548] ERROR:web-services:[05]: File "/usr/lib/python2.5/site-packages/openerp-server/addons/base/module/module.py", line 473, in update_translations
[2009-02-09 19:40:31,548] ERROR:web-services:[06]: tools.trans_load(cr.dbname, f, lang, verbose=False)
[2009-02-09 19:40:31,548] ERROR:web-services:[07]: File "/usr/lib/python2.5/site-packages/openerp-server/tools/translate.py", line 504, in trans_load
[2009-02-09 19:40:31,549] ERROR:web-services:[08]: r = trans_load_data(db_name, fileobj, fileformat, lang, strict=strict, verbose=verbose)
[2009-02-09 19:40:31,549] ERROR:web-services:[09]: File "/usr/lib/python2.5/site-packages/openerp-server/tools/translate.py", line 554, in trans_load_data
[2009-02-09 19:40:31,549] ERROR:web-services:[10]: lang_obj.create(cr, uid, lang_info)
[2009-02-09 19:40:31,549] ERROR:web-services:[11]: File "/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py", line 2421, in create
[2009-02-09 19:40:31,549] ERROR:web-services:[12]: upd2.append(self._columns[field]._symbol_set[1](vals[field]))
[2009-02-09 19:40:31,549] ERROR:web-services:[13]: File "/usr/lib/python2.5/site-packages/openerp-server/osv/fields.py", line 159, in _symbol_set_char
[2009-02-09 19:40:31,549] ERROR:web-services:[14]: u_symb = unicode(symb, 'utf8')
[2009-02-09 19:40:31,549] ERROR:web-services:[15]: File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
[2009-02-09 19:40:31,549] ERROR:web-services:[16]: return codecs.utf_8_decode(input, errors, True)
[2009-02-09 19:40:31,549] ERROR:web-services:[17]: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: invalid data

6. Booted my another testserver and made there also same test and result is equal

7. Made again new database but this time choosed English in installation time.
result: all ok no errors

If needed debug mode run server and output please let me know.

Regards,
Tanel

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :

Can you give more details ? locale, etc.. because I created a database with the estonian language, and it works fine for me. Sorry

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

WOW i fixed that bug myself :). Its so hard to me if i do not know at python nothing! Whole night not steeped but now its fixed :)- I so happy.

Ok i give info how fix it. Programmers please correct me if needed.

My linux is 3x Kubuntu 8.10 (3 because i have 3 testservers :P)

Bug is in /openerp-server-5.0.0-2/bin/tools/translate.py file

search:

#-----------------------------------------------------------------------------------
        ids = lang_obj.search(cr, uid, [('code','=', lang)])

        if not ids:
            # lets create the language with locale information
            fail = True
            for ln in get_locales(lang):
                try:
                    locale.setlocale(locale.LC_ALL, ln)
                    fail = False
                    break
                except locale.Error:
                    continue
            if fail:
                lc = locale.getdefaultlocale()[0]
                msg = 'Unable to get information for locale %s. Information from the default locale (%s) have been used.'
                logger.notifyChannel('i18n', netsvc.LOG_WARNING, msg % (lang, lc))

            if not lang_name:
                lang_name = tools.get_languages().get(lang, lang)
#---------------------------------------------------------------------------------------------------------

and replace that:

#--------------------------------------------------------------------------------------------------------
        ids = lang_obj.search(cr, uid, [('code','=',lang)])
        lc, encoding = locale.getdefaultlocale()
        if not encoding:
            encoding = 'UTF-8'
        if encoding == 'utf':
            encoding = 'UTF-8'
        if encoding == 'cp1252':
            encoding= '1252'
        if encoding == 'iso-8859-1':
            encoding= 'iso-8859-15'
        if encoding == 'latin1':
            encoding= 'latin9'

        try:
            if os.name == 'nt':
                locale.setlocale(locale.LC_ALL, str(_LOCALE2WIN32.get(lang, lang) + '.' + encoding))
            else:
                locale.setlocale(locale.LC_ALL, str(lang + '.' + encoding))
        except Exception:
            netsvc.Logger().notifyChannel(' ', netsvc.LOG_WARNING,
                    'unable to set locale "%s"' % (lang))
#------------------------------------------------------------------------------------------------------------------

restart server and bug gone :)

I add in attachment my file then devs can compare and Stephane can test its really working ;)

Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote :

you just use old code which have bugs with some locales

what are your current locale ?

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

Yes i use old code because i have two installs in one PC and old working but new total crash when i make database.
One testserver locale is
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

and two another testservers is et_EE.UTF-8

but thats no mater 5.0.0.2 crashing everywhere!

Not good way fix yes and i not programmer at all! Seed python now max 1month with Openerp. Good if i can copy code and good if its gives positive result. Please not shoot me!

In that file needed more old code i already founded resolution another bug 327531

i cloned more old code there and that bug also gone from me. I add that changed file also. I houpe its helps real developers. For give me please.

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

Yes i use old code because i have two installs in one PC and old working but new total crash when i make database.
One testserver locale is
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

and two another testservers is et_EE.UTF-8

but thats no mater 5.0.0.2 crashing everywhere!

Not good way fix yes and i not programmer at all! Seed python now max 1month with Openerp. Good if i can copy code and good if its gives positive result. Please not shoot me!

In that file needed more old code i already founded resolution another bug 327531

i cloned more old code there and that bug also gone from me. I add that changed file also. I hope its helps real developers. For give me please.

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

Sorry i not understand how posted 2 times row!
I have one stupid idea and no think its possible but if one code working good with some locales and another some another locales, is then possible make code what switches code depends locale? Only idea and very bad idea.

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :
Download full text (5.8 KiB)

Additional test result, maby that helps locate problem.

#locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
#Notice no EE nowhere

# Making FR DB
...
[2009-02-11 09:55:14,888] INFO:init:[03]: error 1 0
[2009-02-11 09:55:14,888] INFO:init:[04]: total 1 0
[2009-02-11 09:55:14,888] INFO:init:[05]: end of report (1 assertion(s) checked)
[2009-02-11 09:55:14,931] INFO:i18n:module base: loading translation file for language fr_FR
[2009-02-11 09:55:14,990] WARNING:i18n:Unable to get information for locale fr_FR. Information from the default locale (en_US) have been used.
[2009-02-11 09:55:34,623] INFO:i18n:module base_setup: loading translation file for language fr_FR
...
# No crash

# Making IT db
[2009-02-11 09:44:51,802] INFO:init:[03]: error 1 0
[2009-02-11 09:44:51,802] INFO:init:[04]: total 1 0
[2009-02-11 09:44:51,803] INFO:init:[05]: end of report (1 assertion(s) checked)
[2009-02-11 09:44:51,856] INFO:i18n:module base: loading translation file for language it_IT
[2009-02-11 09:44:51,918] WARNING:i18n:Unable to get information for locale it_IT. Information from the default locale (en_US) have been used.
[2009-02-11 09:45:07,250] INFO:i18n:module base_setup: loading translation file for language it_IT
...
# No crash

# Making EE DB
[2009-02-11 09:52:05,248] INFO:init:[03]: error 1 0
[2009-02-11 09:52:05,248] INFO:init:[04]: total 1 0
[2009-02-11 09:52:05,248] INFO:init:[05]: end of report (1 assertion(s) checked)
[2009-02-11 09:52:05,326] INFO:i18n:module base: loading translation file for language et_EE
[2009-02-11 09:52:05,389] ERROR:web-services:[01]: CREATE DATABASE
[2009-02-11 09:52:05,389] ERROR:web-services:[02]: Traceback (most recent call last):
[2009-02-11 09:52:05,389] ERROR:web-services:[03]: File "/root/openerp/unstable/5.0/server/bin/service/web_services.py", line 97, in __call__
[2009-02-11 09:52:05,389] ERROR:web-services:[04]: modobj.update_translations(cr, 1, mids, lang)
[2009-02-11 09:52:05,390] ERROR:...

Read more...

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

___Is that means openerp now gets somewhere locale EE in my system and and problems staring point is here?__

Yes true! Made in virtualbox clean pure UK install and now Openerp not founded et_EE locale and database created successful without corrupt database.

INFO:init:[03]: error 1 0
INFO:init:[04]: total 1 0
INFO:init:[05]: end of report (1 assertion(s) checked)
INFO:i18n:module base: loading translation file for language et_EE
WARNING:i18n:Unable to get information for locale et_EE. Information from the default locale (en_GB) have been used.
INFO:i18n:module base_setup: loading translation file for language et_EE

Revision history for this message
Amit Mendapara (cristatus) wrote :

Hello Tanel,

Can you check with latest revision 1718 from Launchpad? I think this problem is related to https://bugs.launchpad.net/openobject-server/+bug/326138

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :
Download full text (3.6 KiB)

Thank you ame

I see there 1 row changed to:
locale.setlocale(locale.LC_ALL, str(ln))
compared original server 5.0.0.2

But bad thing that not resolved problem.

In client
#Viga andmebaasi loomisel !
#
#Server krahhis paigaldamise ajal.Me soovitame sul see andmebaas kukutada.
Means corrupt database...

In server like always
[2009-02-12 09:33:55,207] INFO:init:[02]: Level success failed
[2009-02-12 09:33:55,207] INFO:init:[03]: error 1 0
[2009-02-12 09:33:55,207] INFO:init:[04]: total 1 0
[2009-02-12 09:33:55,207] INFO:init:[05]: end of report (1 assertion(s) checked)
[2009-02-12 09:33:55,271] INFO:i18n:module base: loading translation file for language et_EE
[2009-02-12 09:33:55,350] ERROR:web-services:[01]: CREATE DATABASE
[2009-02-12 09:33:55,350] ERROR:web-services:[02]: Traceback (most recent call last):
[2009-02-12 09:33:55,350] ERROR:web-services:[03]: File "/root/openerp/unstable/5.0/server/bin/service/web_services.py", line 97, in __call__
[2009-02-12 09:33:55,350] ERROR:web-services:[04]: modobj.update_translations(cr, 1, mids, lang)
[2009-02-12 09:33:55,350] ERROR:web-services:[05]: File "/opt/openerp/unstable/5.0/openerp-server/bin/addons/base/module/module.py", line 473, in update_translations
[2009-02-12 09:33:55,350] ERROR:web-services:[06]: tools.trans_load(cr.dbname, f, lang, verbose=False)
[2009-02-12 09:33:55,350] ERROR:web-services:[07]: File "/opt/openerp/unstable/5.0/openerp-server/bin/tools/translate.py", line 504, in trans_load
[2009-02-12 09:33:55,350] ERROR:web-services:[08]: r = trans_load_data(db_name, fileobj, fileformat, lang, strict=strict, verbose=verbose)
[2009-02-12 09:33:55,351] ERROR:web-services:[09]: File "/opt/openerp/unstable/5.0/openerp-server/bin/tools/translate.py", line 554, in trans_load_data
[2009-02-12 09:33:55,351] ERROR:web-services:[10]: lang_obj.create(cr, uid, lang_info)
[2009-02-12 09:33:55,351] ERROR:web-services:[11]: File "/root/openerp/unstable/5.0/server/bin/osv/orm.py", line 2421, in create
[2009-02-12 09:33:55,351] ERROR:web-services:[12]: upd2.append(self._columns[field]._symbol_set[1](vals[field]))
[2009-02-12 09:33:55,351] ERROR:web-services:[13]: File "/root/openerp/unstable/5.0/server/bin/osv/fields.py", line 159, in _symbol_set_char
[2009-02-12 09:33:55,351] ERROR:web-services:[14]: u_symb = unicode(symb, 'utf8')
[2009-02-12 09:33:55,351] ERROR:web-services:[15]: File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
[2009-02-12 09:33:55,351] ERROR:web-services:[16]: return codecs.utf_8_decode(input, errors, True)
[2009-02-12 09:33:55,351] ERROR:web-services:[17]: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1: invalid data

My locale is:

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

And also i have locale et_EE in server and that openerp-server founds.
I can install all language databases but not EE. Its little funny. I can ...

Read more...

Revision history for this message
Ahti Hinnov (sipelgas) wrote :

I have exactly the same problem and error message.

Running addons rev 2215, server rev 1722, gtk client rev 937 on Gentoo

LANG="et_EE.UTF-8"
LC_ALL="et_EE.UTF-8"

Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

And Ahti using Gentoo as i know www.gentoo.org not like i using Kubuntu www.kubuntu.org.

Revision history for this message
Amit Mendapara (cristatus) wrote :

After generating `et_EE.UTF-8` locale on my Ubuntu system, I managed to reproduce the same error. Here is a patch that fixed the problem...

Changed in openobject-addons:
status: Incomplete → Confirmed
Changed in openobject-server:
status: Confirmed → Fix Released
Revision history for this message
Tanel Kurvits (tanel-kurvits) wrote :

Yes i confirm now its working but i make additional test in another PC.

Thank You

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.