Import module menu is missing

Bug #506662 reported by Geoff Gardiner
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Two menu items under Administration > Modules Management:are missing using python2.5 under Ubuntu Hardy and Debian Lenny and _stable_ versions around 2010-01-12 (and I tested using version 1868 - also the same problem).

   1. Import module <MISSING>
   2. Update Modules List
   3. Apply Scheduled Upgrades
   4. Categories of Modules
   5. Modules
   6. Repository list <MISSING>

See http://www.openobject.com/forum/topic14574.html for more information.

Revision history for this message
Don Kirkby (donkirkby) wrote :

This isn't a real fix, but maybe it will help someone find the actual problem.

When make the following changes, the missing menu items appear in new databases:

Go to /server/bin/addons/base/module folder.
Edit module_view.xml
Change the id of the last menuitem to menu_module_repository_treex (just add an x)
Edit module_wizard.xml
Change the id of the first menuitem to menu_wizard_module_importx (just add an x)

I couldn't see how these changes would affect anything, but they work for me.

Revision history for this message
Don Kirkby (donkirkby) wrote :

OK, turns out that "fix" just makes the menu item appear. When you click on it, it fails with a stack trace that looks like this:

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 639, in execute
    return self._execute(db, uid, wiz_id, datas, action, context)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 618, in _execute
    wiz = netsvc.LocalService('wizard.'+self.wiz_name[wiz_id])
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 66, in __init__
    self._service = SERVICES[name]
KeyError: u'wizard.base.module.import'

Revision history for this message
Don Kirkby (donkirkby) wrote :

Looks like this is related to the use_control module.

My production server has all the extra-addons, and it has this bug. My development server didn't have the extra-addons, and it didn't have this bug. I downloaded the extra-addons and added a link to just the use_control module; now the development server has this bug.

When I look in the list of modules for a new database, use_control is installed.

Any idea why use_control installs automatically?

The description says, "This module provides reports to control your on demand subscription. You can not uninstall or delete it."

I tried setting the active property to False, but that caused an error: relation "use_control_db_block" does not exist\nLINE 1: SELECT name FROM use_control_db_block

For now, I think I'll just delete the use_control module from extra-addons, since I wasn't planning to use it anyway.

Revision history for this message
Don Kirkby (donkirkby) wrote :

Looks like this behaviour is by design, and it was added in revision <email address hidden> on 17 Apr 2009. In the file extra-addons/use_control/module.py, it removes the module import wizard from the list of services, and it neuters the repository class. In the file extra-addons/use_control/module.xml, it deletes the two records that we found missing.

My big question is why this module is automatically installed. It makes installing extra-addons a bad idea. (Maybe it always was.) Here are two suggestions:

1. Improve the description of this module so that users don't have to poke around in the debugger for days to figure out what this module is trying to do. Preferably include "menu_wizard_module_import" and "menu_module_repository_tree" in the description so that Google might find the relation to the missing records.
2. If possible, make it so that this module has to be activated before it starts mysteriously disabling things. I'm guessing that it is automatically enabled to prevent users from creating new databases for themselves without the quota restrictions. Perhaps you could add some kind of trigger file that a sysadmin touches to activate the module. Maybe an entry in the main /etc/openerp-server.conf file.

Revision history for this message
Don Kirkby (donkirkby) wrote :

A couple more notes for those trying to work around this.

To get rid of the use_control module, delete it from the addons directory. For me, that's in /usr/local/lib/python2.6/dist-packages/openerp-server/addons.
Don't forget to restart the server, or it will still have the use_control module in memory.
If you're using the openerp-allinone script from Open-Source Consulting, you'll also need to delete the module where it gets downloaded from launchpad. Otherwise, it will get reinstalled next time you do an update. The code is downloaded to /opt/extra-addons. The openerp-allinone script is available here:
http://opensourceconsulting.wordpress.com/2009/09/15/openerp-all-in-one-installer-update-for-dummies/

Revision history for this message
Julian Robbins (joolsr) wrote :

Yes, this is a real pain. Apart from not letting me login to the system due to the latter bug mentioned ie related to use_control, I am also suffering from losing the menu related to adding Modules via zip files

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Subscribers,

The module 'use_control' has been designed for On Demand Developments.
You may go to the terp file of the module and set active to be False.

You cannot remove the module as its written on the description.

Thanks.

Changed in openobject-server:
status: New → Invalid
Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Hi Jay,

Following your tip I modified this file:

/usr/lib/python2.5/site-packages/openerp-server/addons/use_control/__terp__.py

"active" is set to False but I still can't see the missing stuff... Here's is the content:

{
    "name" : "On Demand Open Object - Subscription Control",
    "version" : "1.1",
    "author" : "Tiny",
    "category" : "Tools",
    "description": """
This module provides reports to control your on demand subscription.
You can not uninstall or delete it.
""",
    "website": "http://www.openerp.com",
    "depends" : ["base"],
    "init_xml" : [],
    "update_xml" : [
        "use_control_view.xml",
        "module.xml",
        "security/ir.model.access.csv",
    ],
    "demo_xml" : [],
    "installable": True,
    "active" : False,
}

Revision history for this message
Don Kirkby (donkirkby) wrote :

Did you create a new database? I'm not sure, but I think those changes will only take effect during database creation.

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Good point, thx! Result: python errors once the database is created and while it's being configured. And if I get no python errors, the config process ends up with the message "Currently, this database is not fully loaded and can not be used."

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Finally I managed to configure the new database through the web client... Actually the missing fields are now available. A few tries were necessary due to different errors, restarting openerp when needed.

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

This is the first error I get while configuring the new database. A restart of openerp-server/web is needed to get rid of it.

Unrecoverable error in the server.
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cprequest.py", line 541, in run
    self.respond(pi)
  File "/usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cprequest.py", line 624, in respond
    self.handle_error()
  File "/usr/lib/python2.5/site-packages/CherryPy-3.1.2-py2.5.egg/cherrypy/_cprequest.py", line 746, in handle_error
    self.error_response()
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/controllers/root.py", line 52, in _cp_on_error
    message = errorpage.render()
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/controllers/error_page.py", line 61, in render
    return self.__render(value)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/tools/expose.py", line 204, in func_wrapper
    res = func(*args, **kw)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/controllers/error_page.py", line 81, in __render
    maintenance = proxy.status()
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/rpc.py", line 390, in <lambda>
    return lambda *args: self._session.execute("object", "execute", self._resource, name, *args)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/rpc.py", line 351, in execute
    return self.gateway.execute(obj, method, *args)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/rpc.py", line 153, in execute
    return self.__execute(obj, method, args)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/rpc.py", line 139, in __execute
    raise common.error(_('Application Error!'), err.backtrace)
  File "/usr/lib/python2.5/site-packages/openerp_web-5.0.7-py2.5.egg/openerp/common.py", line 72, in error
    raise TinyError(message=msg, title=title or _("Error"))
TinyError: Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 244, in dispatch
    result = LocalService(service_name)(method, *params)
  File "/usr/lib/python2.5/site-packages/openerp-server/netsvc.py", line 73, in __call__
    return getattr(self, method)(*params)
  File "/usr/lib/python2.5/site-packages/openerp-server/service/web_services.py", line 574, in execute
    security.check(db, uid, passwd)
  File "/usr/lib/python2.5/site-packages/openerp-server/addons/use_control/services.py", line 43, in check_one
    cr.execute('SELECT name FROM use_control_db_block')
  File "/usr/lib/python2.5/site-packages/openerp-server/sql_db.py", line 77, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/openerp-server/sql_db.py", line 122, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "use_control_db_block" does not exist

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello I. Fernandez ,

I agree that this module once installed, cannot be uninstalled.

But, with a new database after setting active=False in its terp, no problem should have been encountered.

Let us know more if any such problems occur with fresh database.

Many thanks.

Revision history for this message
Inaki Fernandez - OpenERPappliance.com (inaki.fernandez) wrote :

Hi Jay,

I've completed a new test after reinstalling openerp from scratch with my allinone script for ubuntu.

Results when trying to configure a new database with active=False in mentioned terp file:

1) No errors like those shown in comment #12.
2) Same error as in comment #10:
     "Connection refused!" -> click on OK -> "Currently, this database is not fully loaded and can not be used."
3) After step 2), I can see new logs in openerp-server logs, appearing many new lines like:
     "INFO:init:module xxx loading xxxx"
     "WARNING:init: Not all modules have loaded"
     ...
4) Once no new logs appear as shown in previous step, I'm allowed to continue configuring the new database (by refreshing firefox).
5) Missing fields are now available

Seems like this issue only happens with active=False.

BTW, some users would like to have active=False as default config. Could this be changed, please? Another solution is to set it up in the allinone installer for ubuntu.

Thanks for your help.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello I. Fernandez,

Looking at the logs provided by you, it looks like some modules are not getting loaded and they are the modules on which the to-be-installed modules depend.

active=False cannot be chnaged, as its only for ODOO.

We accept the request of allinone installer. We will check it if its feasible. Please create a blueprint of your suggestion.

Thanks.

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.