Merge lp:~openerp-dev/openobject-server/6.1-opw-578621-rgo into lp:openobject-server/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 4265
Proposed branch: lp:~openerp-dev/openobject-server/6.1-opw-578621-rgo
Merge into: lp:openobject-server/6.1
Diff against target: 12 lines (+1/-1)
1 file modified
openerp/service/netrpc_server.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.1-opw-578621-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+122219@code.launchpad.net

Description of the change

Hello,

If we run server with option --no-database-list and try to connect to server using GTK-Client and using netrpc, client will show message saying 'Could not connect to server !' and won't allow to connect, but we would be able to do so using xmlrpc.

After investingating the issue, I found that, with --no-database-list option, 'AccessDenied' exception is raised from(server/openerp/service/web_services.py, line#319) and with xmlrpc, it is handled at (server/openerp/wsgi/core.py, line#133) by setting faultCode as 'AccessDenied' which is passed to GTK-Client and GTK-Client handles this faultCode(by checking, if e.faultCode == 'AccessDenied') and returns None.

But in case of netrpc, after raising AccessDenied, a string is returned as 'AccessDenied Access denied.' by server(file server/openerp/service/netrpc_server.py, line#99) and this string will be set as faultCode by GTK-Client(file client/bin/tiny_socket.py, line#108), and this fault code isn't handled by GTK-Client and will not return any thing.

So, on the basis of my above investigation, I fixed this issue by passing proper faultCode from server to client.

Kindly review the fix.
Thanks.

To post a comment you must log in.
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

Hello !

What is blocking this fix from being merged in the stable branch ?

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

4265. By Ravi Gohil (OpenERP)

[FIX]: could not connect to server using netrpc from GTK-Client and '--no-database-list' parameter fed to server: (Maintenance Case : 578621)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/service/netrpc_server.py'
2--- openerp/service/netrpc_server.py 2012-01-24 17:30:17 +0000
3+++ openerp/service/netrpc_server.py 2012-08-31 09:40:50 +0000
4@@ -96,7 +96,7 @@
5 if isinstance(e, openerp.exceptions.AccessError):
6 return 'warning -- AccessError\n\n' + str(e)
7 if isinstance(e, openerp.exceptions.AccessDenied):
8- return 'AccessDenied ' + str(e)
9+ return 'AccessDenied'
10 return openerp.tools.exception_to_unicode(e)
11
12 class TinySocketServerThread(threading.Thread,netsvc.Server):