AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Bug #1043234 reported by Simon Vass on 2012-08-29

This bug report was converted into a question: question #210496: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'.

8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenUpgrade Server
Invalid
Undecided
Unassigned

Bug Description

When I run the migration script on my 6.0.4 db to update to 6.1 I get.

Traceback (most recent call last):
  File "/opt/openerp/server/openerp-server", line 95, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
  File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
    update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
    modobj.update_list(cr, 1)
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
    self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
    current_category_path.insert(0, current_category.name)
  File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Hi Simon,

thank you for reporting this. We need more information to understand why this is happening. Could you post the command line that you run the server with, and the server log with log level 'debug' from a run in which this error occurs? You can send me the log personally through Launchpad if you do not want to run the risk of disclosing sensitive information.

Best regards,
Stefan.

Sent on LP

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Wednesday, 29 August, 2012 2:21:51 PM
Subject: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Hi Simon,

thank you for reporting this. We need more information to understand why
this is happening. Could you post the command line that you run the
server with, and the server log with log level 'debug' from a run in
which this error occurs? You can send me the log personally through
Launchpad if you do not want to run the risk of disclosing sensitive
information.

Best regards,
Stefan.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  New

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-server/+bug/1043234/+subscriptions

Hi Simon,

thank you for sending me the logs. As I wrote to you already, having 'debug = True' in the config file is not enough. Please regenerate the logs with 'log_level = debug' and send me command line that you run the server with.

Setting the bug status to 'Incomplete' while awaiting your input.

Best regards,
Stefan.

Changed in openupgrade-server:
status: New → Incomplete
Simon Vass (svass) wrote :
Download full text (20.2 KiB)

2012-09-28 07:40:48,524 2367 DEBUG ? openerp.netsvc: logger level set: "openerp.netsvc.rpc.request:INFO"
2012-09-28 07:40:48,524 2367 DEBUG ? openerp.netsvc: logger level set: "openerp.netsvc.rpc.response:INFO"
2012-09-28 07:40:48,525 2367 DEBUG ? openerp.netsvc: logger level set: "openerp.addons.web.common.http:INFO"
2012-09-28 07:40:48,525 2367 DEBUG ? openerp.netsvc: logger level set: "openerp.addons.web.common.openerplib:INFO"
2012-09-28 07:40:48,526 2367 DEBUG ? openerp.netsvc: logger level set: "openerp.sql_db:INFO"
2012-09-28 07:40:48,527 2367 DEBUG ? openerp.netsvc: logger level set: ":INFO"
2012-09-28 07:40:48,527 2367 DEBUG ? openerp.netsvc: logger level set: "openerp:DEBUG"
2012-09-28 07:40:48,528 2367 DEBUG ? openerp.netsvc: logger level set: ":INFO"
2012-09-28 07:40:48,528 2367 INFO ? openerp: OpenERP version 6.1
2012-09-28 07:40:48,529 2367 INFO ? openerp: addons paths: /opt/openerp/openupgrade-addons
2012-09-28 07:40:48,529 2367 INFO ? openerp: database hostname: localhost
2012-09-28 07:40:48,530 2367 INFO ? openerp: database port: 5432
2012-09-28 07:40:48,530 2367 INFO ? openerp: database user: openerp
2012-09-28 07:40:48,531 2367 DEBUG ? openerp.netsvc: Registered an exported service: db
2012-09-28 07:40:48,531 2367 DEBUG ? openerp.netsvc: Registered an exported service: common
2012-09-28 07:40:48,532 2367 DEBUG ? openerp.netsvc: Registered an exported service: object
2012-09-28 07:40:48,532 2367 DEBUG ? openerp.netsvc: Registered an exported service: wizard
2012-09-28 07:40:48,533 2367 DEBUG ? openerp.netsvc: Registered an exported service: report
2012-09-28 07:40:48,533 2367 INFO ? openerp.service.netrpc_server: starting NET-RPC service on 0.0.0.0:8070
2012-09-28 07:40:48,534 2367 DEBUG ? openerp.cron: Master cron daemon started!
2012-09-28 07:40:48,535 2367 INFO ? openerp.netsvc: Starting 1 services
2012-09-28 07:40:48,536 2367 DEBUG ? openerp.cron: Going to sleep for 60s
2012-09-28 07:40:48,537 2367 WARNING ? openerp.modules.module: module web: module not found
2012-09-28 07:40:48,538 2367 CRITICAL ? openerp.modules.module: Couldn't load module web
2012-09-28 07:40:48,538 2367 CRITICAL ? openerp.modules.module: unsupported operand type(s) for +: 'bool' and 'str'
2012-09-28 07:40:48,539 2367 ERROR ? openerp: Failed to load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
  File "/opt/openerp/openupgrade-server/openerp-server", line 252, in <module>
    openerp.modules.module.load_openerp_module(m)
  File "/opt/openerp/openupgrade-server/openerp/modules/module.py", line 407, in load_openerp_module
    zip_mod_path = mod_path + '.zip'
TypeError: unsupported operand type(s) for +: 'bool' and 'str'
2012-09-28 07:40:48,591 2367 INFO ? openerp.wsgi.core: HTTP service (werkzeug) running on 0.0.0.0:8069
2012-09-28 07:40:48,605 2367 DEBUG etech openerp.modules.loading: loading 1 packages...
2012-09-28 07:40:48,607 2367 INFO etech openerp.modules.loading: module base: loading objects
2012-09-28 07:40:48,611 2367 DEBUG etech openerp.osv.fields: required=True is deprecated: ...

Simon Vass (svass) wrote :

 /opt/openerp/openupgrade-server/openerp-server --config="/etopenerp-server.conf" --addons-path="/opt/openerp/openupgrade-addons" -d etech -u all --log-level=debug

Simon Vass (svass) wrote :

Sorry that should be

/opt/openerp/openupgrade-server/openerp-server --config="/etc/openerp-server.conf" --addons-path="/opt/openerp/openupgrade-addons" -d etech -u all --log-level=debug

Simon Vass (svass) wrote :

Hi Simon,

thank you for the additional information. The error is fired when an OpenERP model (the module category) fails to instanciate (it has no fields). This is probably caused by a failure of the base module to load, for which I do not see any other cause or hint in the logs.

What I do see is that the migration scripts from the base module are not being run. You should see something like the following line in your logs before any xml file is loaded:

openerp.modules.migration: module base: Running migration [>6.x.x.x] pre-migration

This means that either

- the base module that you are loading does not contain the OpenUpgrade migrations directory with the migration scripts. Does the file /opt/openerp/openupgrade-server/openerp/addons/base/migrations/6.1.1.3/pre-migration.py exist on your system?

- you are running the migration script on a database that has half-survived a previous upgrade attempt. Did you rerun the migration procedure on a fresh copy of your 6.0 database?

Cheers,
Stefan.

Simon Vass (svass) wrote :
Download full text (3.9 KiB)

Stephan,

Yes I have the pre-migration.py

-rw-rw-r-- 1 openerp openerp 16K Jul 10 10:33 openupgrade_general_log.txt
-rw-rw-r-- 1 openerp openerp 14K Jul 10 10:33 openupgrade_analysis.txt
drwxrwxr-x 4 openerp openerp 4.0K Sep 28 11:10 .
drwxrwxr-x 3 openerp openerp 4.0K Jul 10 10:33 ..
drwxrwxr-x 2 openerp openerp 4.0K Sep 28 11:02 data
drwxrwxr-x 2 openerp openerp 4.0K Jul 10 10:33 doc
-rw-rw-r-- 1 openerp openerp 3.1K Jul 10 10:33 pre-migration.py
-rw-rw-r-- 1 openerp openerp 1.6K Aug 29 12:00 post-migration.py
-rw-rw-r-- 1 openerp openerp 526 Jul 10 10:33 readme.txt

The database is a straight dump and restore from my V6 Live OpenERP instance?

I am going to try with a vanilla test database to be sure.

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 12:06:51 PM
Subject: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Hi Simon,

thank you for the additional information. The error is fired when an
OpenERP model (the module category) fails to instanciate (it has no
fields). This is probably caused by a failure of the base module to
load, for which I do not see any other cause or hint in the logs.

What I do see is that the migration scripts from the base module are not
being run. You should see something like the following line in your logs
before any xml file is loaded:

openerp.modules.migration: module base: Running migration [>6.x.x.x]
pre-migration

This means that either

- the base module that you are loading does not contain the OpenUpgrade
migrations directory with the migration scripts. Does the file
/opt/openerp/openupgrade-server/openerp/addons/base/migrations/6.1.1.3
/pre-migration.py exist on your system?

- you are running the migration script on a database that has half-
survived a previous upgrade attempt. Did you rerun the migration
procedure on a fresh copy of your 6.0 database?

Cheers,
Stefan.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
 ...

Read more...

You do load a configuration file using a command line parameter. Could you post or privately send me this file?

Simon Vass (svass) wrote :
Download full text (3.3 KiB)

Stefan,

Works fine with vanilla db.

Ran again and attached log file.

I see the script being fired;

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 12:06:51 PM
Subject: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Hi Simon,

thank you for the additional information. The error is fired when an
OpenERP model (the module category) fails to instanciate (it has no
fields). This is probably caused by a failure of the base module to
load, for which I do not see any other cause or hint in the logs.

What I do see is that the migration scripts from the base module are not
being run. You should see something like the following line in your logs
before any xml file is loaded:

openerp.modules.migration: module base: Running migration [>6.x.x.x]
pre-migration

This means that either

- the base module that you are loading does not contain the OpenUpgrade
migrations directory with the migration scripts. Does the file
/opt/openerp/openupgrade-server/openerp/addons/base/migrations/6.1.1.3
/pre-migration.py exist on your system?

- you are running the migration script on a database that has half-
survived a previous upgrade attempt. Did you rerun the migration
procedure on a fresh copy of your 6.0 database?

Cheers,
Stefan.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(i...

Read more...

Simon Vass (svass) wrote :
Download full text (3.4 KiB)

2012-09-28 10:08:25,974 4629 INFO etech openerp.modules.migration: module base: Running migration [>6.1.1.3] pre-migration
2012-09-28 10:08:25,974 4629 INFO etech OpenUpgrade: /opt/openerp/base/migrations/6.1.1.3/pre-migration.py called

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 12:06:51 PM
Subject: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Hi Simon,

thank you for the additional information. The error is fired when an
OpenERP model (the module category) fails to instanciate (it has no
fields). This is probably caused by a failure of the base module to
load, for which I do not see any other cause or hint in the logs.

What I do see is that the migration scripts from the base module are not
being run. You should see something like the following line in your logs
before any xml file is loaded:

openerp.modules.migration: module base: Running migration [>6.x.x.x]
pre-migration

This means that either

- the base module that you are loading does not contain the OpenUpgrade
migrations directory with the migration scripts. Does the file
/opt/openerp/openupgrade-server/openerp/addons/base/migrations/6.1.1.3
/pre-migration.py exist on your system?

- you are running the migration script on a database that has half-
survived a previous upgrade attempt. Did you rerun the migration
procedure on a fresh copy of your 6.0 database?

Cheers,
Stefan.

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/op...

Read more...

Simon Vass (svass) wrote :

[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = False
db_port = False
db_user = openerp
db_password = openerp
logfile = /var/log/openerp/openerp-server.log
addons = /opt/openerp/openupgrade-addons/
log-level = debug
debug=True

Stefan,

From scanning the Database in Pgadmin, you are right about the ir_module_category table migration being incomplete. The migrated one only has 24 entries where as the original has 45.

If the migration script hits a category it does not know does it carry on or just stop migrating that table?

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 1:08:51 PM
Subject: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

You do load a configuration file using a command line parameter. Could
you post or privately send me this file?

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-server/+bug/1043234/+subscriptions

never came across this problem so I do not know what happens in that
case. Can you post the output of the following database query?

select ir_module_module.name, ir_module_category.name from
ir_module_module, ir_module_category where category_id = 2 and
category_id = ir_module_category.id;

Stefan,

Nothing comes back because there is not entry for category id 2 in the migrated DB.

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 1:46:12 PM
Subject: Re: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

never came across this problem so I do not know what happens in that
case. Can you post the output of the following database query?

select ir_module_module.name, ir_module_category.name from
ir_module_module, ir_module_category where category_id = 2 and
category_id = ir_module_category.id;

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-server/+bug/1043234/+subscriptions

Simon Vass (svass) wrote :

Sorry just realized you might have meant on the source database.

"account_invoice_number";"Accounting"
"account_analytic_default";"Accounting"
"account_analytic_analysis";"Accounting"
"account_budget";"Accounting"
"account_analytic_plans";"Accounting"
"account_sequence";"Accounting"
"account_payment_extension";"Accounting"
"account_followup";"Accounting"
"account_asset";"Accounting"
"account_cancel";"Accounting"
"account";"Accounting"
"account_voucher";"Accounting"
"account_chart";"Accounting"
"account_accountant";"Accounting"
"hr_timesheet_invoice";"Accounting"

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 1:46:12 PM
Subject: Re: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

never came across this problem so I do not know what happens in that
case. Can you post the output of the following database query?

select ir_module_module.name, ir_module_category.name from
ir_module_module, ir_module_category where category_id = 2 and
category_id = ir_module_category.id;

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-server/+bug/1043234/+subscriptions

Simon Vass (svass) wrote :

Stefan,

From what I can see the ir_module_module table does not appear to be migrating properly? category_id still has the values from the old database not the new one?

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

----- Original Message -----
From: "Stefan Rijnhart (Therp)" <email address hidden>
To: <email address hidden>
Sent: Friday, 28 September, 2012 1:46:12 PM
Subject: Re: [Bug 1043234] Re: AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

never came across this problem so I do not know what happens in that
case. Can you post the output of the following database query?

select ir_module_module.name, ir_module_category.name from
ir_module_module, ir_module_category where category_id = 2 and
category_id = ir_module_category.id;

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1043234

Title:
  AttributeError: 'Field name not found in
  browse_record(ir.module.category, 2)'

Status in OpenUpgrade Server:
  Incomplete

Bug description:
  When I run the migration script on my 6.0.4 db to update to 6.1 I get.

  Traceback (most recent call last):
    File "/opt/openerp/server/openerp-server", line 95, in preload_registry
      db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
    File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
      registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
      update_module, pooljobs)
    File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
      openerp.modules.load_modules(registry.db, force_demo, status, update_module)
    File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
      modobj.update_list(cr, 1)
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
      self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
    File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
      current_category_path.insert(0, current_category.name)
    File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
      raise AttributeError(e)
  AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

To manage notifications about this bug go to:
https://bugs.launchpad.net/openupgrade-server/+bug/1043234/+subscriptions

Just went into the code and we do delete unknown module categories in
the base module's post migration script to prevent the creation of
duplicate categories. However, the following foreign key constraint
takes care of that:

"ir_module_module_category_id_fkey" FOREIGN KEY (category_id) REFERENCES
ir_module_category(id) ON DELETE SET NULL

Is this key present when you inspect ir_module_module on your 6.0
database? (using the query '\d ir_module_module;')

Otherwise, it is a dangling browse record from before the moment that we
wipe the table that we need to refresh().

Simon Vass (svass) wrote :

  Table "public.ir_module_module"
      Column | Type | Modifiers
-------------------+-----------------------------+---------------------------------------------------------------
 id | integer | not null default nextval('ir_module_module_id_seq'::regclass)
 create_uid | integer |
 create_date | timestamp without time zone |
 write_date | timestamp without time zone |
 write_uid | integer |
 website | character varying(256) |
 name | character varying(128) | not null
 author | character varying(128) |
 url | character varying(128) |
 state | character varying(16) |
 latest_version | character varying(64) |
 shortdesc | character varying(256) |
 category_id | integer |
 certificate | character varying(64) |
 description | text |
 demo | boolean | default false
 web | boolean | default false
 license | character varying(32) |
 menus_by_module | text |
 maintainer | character varying(128) |
 contributors | text |
 views_by_module | text |
 published_version | character varying(64) |
 reports_by_module | text |
Indexes:
    "ir_module_module_pkey" PRIMARY KEY, btree (id)
    "ir_module_module_certificate_uniq" UNIQUE, btree (certificate)
    "ir_module_module_name_uniq" UNIQUE, btree (name)
    "name_uniq" UNIQUE, btree (name)
    "ir_module_module_category_id_index" btree (category_id)
    "ir_module_module_name_index" btree (name)
    "ir_module_module_state_index" btree (state)

From the 6.0 Database

Simon Vass (svass) wrote :

Seems they are missing compared to other tables? How should I re-add them?

Simon Vass (svass) wrote :

Fixed, I ran the following against the DB to replace the missing constraints.

ALTER TABLE ir_module_module
  ADD CONSTRAINT ir_module_module_category_id_fkey FOREIGN KEY (category_id)
      REFERENCES ir_module_category (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE SET NULL;

ALTER TABLE ir_module_module
  ADD CONSTRAINT ir_module_module_create_uid_fkey FOREIGN KEY (create_uid)
      REFERENCES res_users (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE SET NULL;

ALTER TABLE ir_module_module
  ADD CONSTRAINT ir_module_module_write_uid_fkey FOREIGN KEY (write_uid)
      REFERENCES res_users (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE SET NULL;

Simon Vass (svass) wrote :

Was caused by missing foreign keys

Changed in openupgrade-server:
status: Incomplete → Invalid
Simon Vass (svass) wrote : Thanks

Stefan,

Thanks for all you help just migrated my second database over.

Simon Vass
Managing Director
E-Tech Uganda Ltd

http://www.etech.ug
Tel: +256 (0) 312260620 or (0) 312260621
email: <email address hidden>
skype: e-techservicedesk

Hi Simon,

my pleasure! Thank you for your reporting back the solution.

Cheers,
Stefan.

Changed in openupgrade-server:
status: Invalid → New

Made a question out of this bug report as other people may encounter the issue too.

Changed in openupgrade-server:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers