The reason why I could not login to trytond 3.2.2 was because the clients 
session was always expired. 

The sessions db entry in ir_session is created with a "create_date" in UTC 
once I enter the password.

But the trytond server which should (since series 3.2 I think) be in UTC is 
not, since time.tzset() is not implemented on Windows!!

See:

trytond/__init__.py

os.environ['TZ'] = 'UTC'
if hasattr(time, 'tzset'):
    time.tzset()


So datetime.datetime.now() returns the local time on my machine which is 
not in UTC but +2 hours ;)

And thats why the session timeout check Session.check(user, key) always 
fails, with a default session timeout of 10min.

Found a good link on the topic with a possible solution

http://www.pceworld.com/view/4360981

Havent tried it yet, would need to compile python myself enabling enable 
HAVE_WORKING_TZSET.

But since my production server is linux I am not going to continue 
developing on windows for now. At least I hope I could save someone some 
time :)


Am Montag, 15. September 2014 10:09:41 UTC+2 schrieb Ivo Ulrich:
>
> Sorry did a fresh install of python and forgot to install a few packages 
> (vobject, pytz, pywebdav), so this is my package list now:
>
> pip list
> Genshi (0.7)
> lxml (3.4.0)
> pip (1.5.6)
> polib (1.0.5)
> psycopg2 (2.5.4)
> python-dateutil (2.2)
> python-sql (0.4)
> pytz (2014.7)
> pywebdav (0.9.8)
> relatorio (0.6.1)
> setuptools (5.7)
> six (1.8.0)
> vobject (0.6.6)
>
> with which I am able to run trytond 3.0.0, but I still get the behavior as 
> described below with trytond 3.2.0
>
> Am Sonntag, 14. September 2014 16:56:48 UTC+2 schrieb Ivo Ulrich:
>>
>> Dear all,
>>
>> I downloaded the tryton server 3.2.2. I am able to run it, connect with 
>> the tryton client (3.2.2) and successfully create a database. But after I 
>> create the database from the client, connect to it via the login form I get 
>> asked a second time for my password and after I enter it I get following 
>> error message:
>>
>>   File "tryton\common\common.pyc", line 1327, in process
>>
>>   File "tryton\common\common.pyc", line 1146, in process_exception
>>
>>   File "tryton\common\common.pyc", line 1325, in rpc_execute
>>
>>   File "tryton\common\common.pyc", line 1316, in run
>>
>>   File "tryton\common\common.pyc", line 1343, in process
>>
>>   File "tryton\common\common.pyc", line 1336, in return_
>>
>> The trytond log messages do not contain any errors:
>>
>> [Sun Sep 14 16:37:45 2014] INFO:server:using 
>> C:\Users\UIB\hg\tryton\3.2.2\trytond-3.2.2\etc\trytond.conf as 
>> configuration file
>> [Sun Sep 14 16:37:45 2014] INFO:server:initialising distributed objects 
>> services
>> [Sun Sep 14 16:37:45 2014] INFO:server:starting JSON-RPC protocol on 
>> localhost:8000
>> [Sun Sep 14 16:38:03 2014] INFO:database:connect to "test2"
>> [Sun Sep 14 16:38:03 2014] INFO:database:connect to "template1"
>> [Sun Sep 14 16:38:05 2014] INFO:database:connect to "test2"
>> [Sun Sep 14 16:38:06 2014] INFO:modules:ir:registering classes
>> [Sun Sep 14 16:38:06 2014] INFO:modules:res:registering classes
>> [Sun Sep 14 16:38:06 2014] INFO:modules:tests:registering classes
>> [Sun Sep 14 16:38:06 2014] INFO:modules:webdav:registering classes
>> [Sun Sep 14 16:38:06 2014] INFO:pool:init pool for "test2"
>> [Sun Sep 14 16:38:06 2014] INFO:modules:ir
>> [Sun Sep 14 16:38:06 2014] INFO:modules:ir:register ir.model.graph
>> ...
>> ...
>> [Sun Sep 14 16:38:35 2014] INFO:modules:res:loading user.xml
>> [Sun Sep 14 16:38:36 2014] INFO:modules:res:loading ir.xml
>> [Sun Sep 14 16:38:40 2014] INFO:database:CREATE DB: test2
>> [Sun Sep 14 16:38:45 2014] INFO:dispatcher:successful login 'admin' from 
>> 127.0.0.1:3446 using JSON-RPC on database 'test2'
>> [Sun Sep 14 16:38:47 2014] INFO:dispatcher:successful login 'admin' from 
>> 127.0.0.1:3447 using JSON-RPC on database 'test2'
>>
>>
>> My machine: Windows 7 64bit,
>> Installed:
>> - PostgreSQL 9.3 (32bit)
>> - Python  2.7.8 (32bit)
>>
>> > pip list
>> Genshi (0.7)
>> lxml (3.4.0)
>> pip (1.5.6)
>> polib (1.0.5)
>> psycopg2 (2.5.4)
>> python-dateutil (2.2)
>> python-sql (0.4)
>> relatorio (0.6.1)
>> setuptools (5.7)
>> six (1.8.0)
>>
>> The same setup worked for trytond 3.0.0, am I missing some package? Or 
>> are any versions not right?
>>
>> Thank you very much!
>> Ivo
>>
>>
>>

Reply via email to