Openupgrade Comparions Config: problem with connection
Connection failed.
<Fault 'LocalService' object has no attribute 'execute_kw': 'Traceback (most recent call last):\n File "/home/
I get this error, when I start a 6.0 Openupgrade server, and try to make connection with a (normal) 5.0 server.
5.0 server is running on port 8069, 6.0 server on different port
what could be wrong?
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Revision history for this message
|
#1 |
In /openupgrade/
The code is:
def test_connection
try:
print 'connection: ', connection
print 'user_model: ', user_model
ids = user_model.
print 'ids: ', ids
print 'user_info: ', user_info
except Exception, e:
raise osv.except_osv(
raise osv.except_osv(
_("%s is connected.") % user_info["name"]
)
the result is:
connection: <openerplib.
user_model: <openerplib.
for 'ids' there is no value printed, so something goes wrong with user_model.
If i analyse the openerplib module in the ubuntu terminal, I see:
>>> import openerplib as p
>>> dir(p.main.Model)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattr__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'search_read']
>>> p.main.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'Model' has no attribute 'search'
there is a function, called search_read, however when we use this, we also get an error:
>>> p.main.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unbound method search_read() must be called with Model instance as first argument (got list instance instead)
Revision history for this message
|
#2 |
I assume that you are comparing generated 'OpenUpgrade records' that represent the database layout given the installed modules. For that, you will need to be talking to an older release of the OpenUpgrade server that has the same modules installed + openupgrade_
Can't tell from the trace if this is your exact problem but it is a good start. However, please note that you only need to take this step for custom or community modules. The step that I think you are performing creates the analysis files which are pregenerated for the official addons.
Revision history for this message
|
#3 |
Our latest messages crossed. With the new info, it looks like a problem with openerplib.
Revision history for this message
|
#4 |
The test in our code for a user called admin is pretty flakey, because its login could be changed in your database. Is that the case?
Revision history for this message
|
#5 |
>>please note that you only need to take this step for custom or community modules.
Agree. This is just for testing purposes, to better understand the Openupgrade module.
>>because its login could be changed in your database
No, it is admin.
the problem seems to be the search function, that appears not to be available openerplib.
I installed openerplib with:
sudo easy_install openerp-client-lib
Searching for openerp-client-lib
Best match: openerp-client-lib 1.1.1
Processing openerp_
openerp-client-lib 1.1.1 is already the active version in easy-install.pth
Using /usr/local/
Processing dependencies for openerp-client-lib
Finished processing dependencies for openerp-client-lib
Do you think there might be a problem with this version of openerplib?
Is there a search function available in other versions of openerplib?
Revision history for this message
|
#6 |
For the record, if our own environment has not been rebuilt then we used openerplib 1.0.3 to compare records with version 5. Note that openerplip.
Revision history for this message
|
#7 |
This is the code, where the connection is tested:
[comparison_
def get_connection(
if not ids:
raise osv.except_osv(
conf = self.read(cr, uid, ids[0], context=None)
print "dir(openerplib): ", dir(openerplib)
# ['Authenticatio
# 'XmlRPCConnector', 'XmlRPCSConnector', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__',
# 'get_connection', 'get_connector', 'json', 'json_rpc', 'logging', 'main', 'random', 'urllib2', 'xmlrpclib']
return openerplib.
login =conf['username'],
port =conf['port'],
)
def test_connection
try:
print 'connection', connection
print 'dir(connection): ', dir(connection)
so you are trying to say that it goes wrong on this line:
connection = self.get_
?
if we analyse 'connection':
we see it does not contain the standard openerp class function, like create, write, search etc.
This is not good?
Apparently, something goes wrong here:
return openerplib.
login =conf['username'],
port =conf['port'],
)
I now want to look up the function 'get_connection' in openerplib:
jeroen@
total 424
drwxr-sr-x 4 root staff 4096 2011-12-02 13:41 aeroolib-
drwxr-sr-x 2 root staff 4096 2013-03-28 13:44 Asterisk
-rw-r--r-- 1 root staff 3687 2012-10-29 11:59 bzr-2.5.1.egg-info
drwxr-sr-x 17 root staff 16384 2012-10-29 11:59 bzrlib
drwxr-sr-x 17 root staff 4096 2012-04-05 16:39 django
-rw-r--r-- 1 root staff 1179 2012-04-05 16:39 Django-1.4.egg-info
-rw-r--r-- 1 root staff 393 2013-04-15 12:30 easy-install.pth
drwxr-sr-x 4 root staff 4096 2013-01-04 15:52 Jinja2-
drwxr-sr-x 5 root staff 4096 2011-11-30 13:55 openerp_
-rw-r--r-- 1 root root 14983 2013-04-15 12:30 openerp_
drwxr-sr-x 4 root staff 4096 2013-03-28 13:29 phonenumbers
drwxr-sr-x 2 root staff 4096 2013-03-28 13:29 phonenumbers-
-rw-r--r-- 1 root staff 256 2013-03-28 13:44 py_Asterisk-
drwxr-sr-x 2 root staff 4096 2013-03-28 13:29 py_Asterisk-
-rw-rw-r-- 1 root staff 332005 2011-11-30 13:45 setuptools-
-rw-r--r-- 1 root staff 30 2011-11-30 13:51 setuptools.pth
drwxr-sr-x 4 root staff 4096 2013-01-04 15:52 Sphinx-
drwxr-sr-x 5 root staff 4096 2012-03-28 11:54 werkzeug
drwxr-sr-x 2 root staff 4096 2012-03-28 11:54 Werkzeug-
I try to read the file: openerp_
jeroen@
"openerp_
openerp_
like django has:
drwxr-sr-x 17 root staff 4096 2012-04-05 16:39 django
-rw-r--r-- 1 root staff 1179 2012-04-05 16:39 Django-1.4.egg-info
Is openerplib not correctly installed?
Revision history for this message
|
#8 |
>
> we see it does not contain the standard openerp class function, like create, write, search etc.
> This is not good?
>
It is the model class that provides them, not the connection. However, like I said earlier on, the classes in this library proxy unknown methods over XMLRPC.
>
> Is openerplib not correctly installed?
In an interactive python session, see if what results you get> Here is a sample session.
>>> import openerplib
>>> connection = openerplib.
>>> user_model = connection.
>>> user_model.
[1]
>>> user_model.
[{'groups_id': [1, 2, 3, 5, 6, 7, 8, 9, 13, 14, 15, 16], 'sel_groups_1_2': 2, 'active': True, 'in_group_16': True, 'in_group_10': False, 'in_group_11': False, 'in_group_12': False, 'id': 1, 'in_group_9': True, 'in_group_6': True, 'sel_groups_3': 3, 'new_password': '', 'in_group_5': True, 'company_id': [1, 'Your Company'], 'action_id': [106, 'Home Page'], 'menu_id': [1, 'Menu'], 'sel_groups_7_8': 8, 'company_ids': [1], 'menu_tips': False, 'date': '2013-04-23 11:10:33.514874', 'context_lang': 'en_US', 'password': 'mypw', 'context_tz': False, 'name': 'Administrator', 'sel_groups_
Revision history for this message
|
#9 |
This question was expired because it remained in the 'Open' state without activity for the last 15 days.