Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:18:52+00:00 2026-05-26T15:18:52+00:00

postgresql python I need some help fixing some issues with a postgresql database I

  • 0

postgresql
python

I need some help fixing some issues with a postgresql database I use for openerp-server. I looked everywhere to find an answer but I couldn’t get any reposes from OpenERP community. Hope some of you postgresql professionals could show me some indications on fixing my broken db.

Here are the errors I encountered starting openerp-server in debug mode:

<P STYLE="margin-bottom: 0in">postgres@nodesoft-dev:~$ cd
/usr/lib/python2.5/site-packages/openerp-server</P>
<P STYLE="margin-bottom: 0in">postgres@nodesoft-dev:/usr/lib/python2.5/site-   packages/openerp-server$ × 79465
[tag:python]/usr/bin/python2.5 ./openerp-server.py -dnodesoft --update=all
--stop-after-init --log-level=debug
--addons-path=/usr/lib/python2.5/site-packages/openerp-server/addons/</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,067]
DEBUGsycopg2:installed. Logging using Python logging module</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,067]
INFO:server:version - 5.0.6</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,067]
INFO:server:addons_path -
/usr/lib/python2.5/site-packages/openerp-server/addons</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,067]
INFO:server:database hostname - localhost</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,067]
INFO:server:database port - 5432</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,071]
INFO:server:database user - postgres</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,071]
INFObjects:initialising distributed objects services</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,239]
INFO:dbpool:Connecting to nodesoft</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,379]
INFO:init:module base: loading objects</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,379]
INFO:init:module base: registering objects</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:01,491]
INFO:init:module base: creating or updating database tables</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251] DEBUG:sql:bad
query: alter table &quot;ir_model_data&quot; add constraint
&quot;ir_model_data_module_name_uniq&quot; unique(name, module)</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251]
DEBUG:sql:[01]: could not create unique index
&quot;ir_model_data_module_name_uniq&quot;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251]
DEBUG:sql:[02]: DETAIL: Table contains duplicated values.</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251]
WARNINGrm:[01]: unable to add 'unique(name, module)' constraint on
table ir_model_data !</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251]
WARNINGrm:[02]: If you want to have it, you should update the records
and execute manually:</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:08,251]
WARNINGrm:[03]: ALTER table ir_model_data ADD CONSTRAINT
ir_model_data_module_name_uniq unique(name, module)</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:02:27,611]
DEBUGrm:creating new column datas of table ir_attachment</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:06,524]
INFO:init:module base: loading base_data.xml</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:07,488]
INFO:init:module base: loading base_menu.xml</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:07,828]
INFO:init:module base: loading security/base_security.xml</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,496] DEBUG:sql:bad
query: update &quot;res_users&quot; set
&quot;menu_id&quot;=1,&quot;address_id&quot;=1,&quot;action_id&quot;=1,&quot;company_
id&quot;=1,&quot;signature&quot;=E'Administrator',write_uid=1,wri
te_date=now() where id in (1)</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,496] × 6848
[tag:postgresql]DEBUG:sql:[01]: insert or update on table &quot;res_users&quot;
violates foreign key constraint &quot;res_users_address_id_fkey&quot;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,496]
DEBUG:sql:[02]: DETAIL: Key (address_id)=(1) is not present in table
&quot;res_partner_address&quot;.</P>
<P STYLE="margin-bottom: 0in">sh: bzr: command not found</P>
<P STYLE="margin-bottom: 0in">sh: lsb_release: command not found</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[01]:</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[02]: Environment Information :</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[03]: System :
Linux-2.6.26-2-xen-amd64-x86_64-with-debian-5.0.4</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[04]: OS Name : posix</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[05]: Operating System Release : 2.6.26-2-xen-amd64</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[06]: Operating System Version : #1 SMP Wed Jan 13
00:12:41 UTC 2010</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620] 
ERROR:init:[07]: Operating System Architecture : 64bit</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[08]: Operating System Locale : en_US.ISO8859-1</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,620]
ERROR:init:[09]: Python Version : 2.5.2</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[10]: OpenERP-Server Version : 5.0.6</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[11]: Last revision No. &amp; ID :</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[12]: &lt;record id=&quot;base.user_root&quot;
model=&quot;res.users&quot;&gt;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[13]: &lt;field name=&quot;signature&quot;&gt;Administrator&lt;/field&gt;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[14]: &lt;field name=&quot;address_id&quot;

ref=&quot;main_address&quot;/&gt;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[15]: &lt;field name=&quot;company_id&quot;
ref=&quot;main_company&quot;/&gt;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[16]: &lt;field name=&quot;action_id&quot;
ref=&quot;action_menu_admin&quot;/&gt;</P>

<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[17]: &lt;field name=&quot;menu_id&quot;
ref=&quot;action_menu_admin&quot;/&gt;</P>
<P STYLE="margin-bottom: 0in">[2011-10-29 18:03:08,624]
ERROR:init:[18]: &lt;/record&gt;</P>
<P STYLE="margin-bottom: 0in">Traceback (most recent call last):</P>
<P STYLE="margin-bottom: 0in">File &quot;./openerp-server.py&quot;,
line 111, in &lt;module&gt;</P>

<P STYLE="margin-bottom: 0in">pooler.get_db_and_pool(db,
update_module=tools.config['init'] or tools.config['update'])</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/pooler.py&quot;,
line 40, in get_db_and_pool</P>
<P STYLE="margin-bottom: 0in">addons.load_modules(db, force_demo,
status, update_module)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/addons/__init__.py&quot;,
line 687, in load_modules</P>
<P STYLE="margin-bottom: 0in">has_updates = load_module_graph(cr,
graph, status, perform_checks=(not update_module), report=report)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/addons/__init__.py&quot;,
line 618, in load_module_graph</P>

<P STYLE="margin-bottom: 0in">tools.convert_xml_import(cr, m, fp,
idref, mode=mode, **kwargs)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/tools/convert.py&quot;,
line 885, in convert_xml_import</P>
<P STYLE="margin-bottom: 0in">obj.parse(xmlstr)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/tools/convert.py&quot;,
line 779, in parse</P>
<P STYLE="margin-bottom: 0in">self._tags[rec.nodeName](self.cr, rec,
n)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/tools/convert.py&quot;,
line 747, in _tag_record</P>

<P STYLE="margin-bottom: 0in">id =
self.pool.get('ir.model.data')._update(cr, self.uid, rec_model,
self.module, res, rec_id or False, not self.isnoupdate(data_node),
noupdate=self.isnoupdate(data_node), mode=self.mode )</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/addons/base/ir/ir_model.py&quot;,
line 474, in _update</P>
<P STYLE="margin-bottom: 0in">model_obj.write(cr, uid, [res_id],
values)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/addons/base/res/res_user.py&quot;,
line 185, in write</P>
<P STYLE="margin-bottom: 0in">res = super(users, self).write(cr, uid,
ids, values, *args, **argv)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/osv/orm.py&quot;,
line 2458, in write</P>

<P STYLE="margin-bottom: 0in">'where id in ('+ids_str+')', upd1)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/sql_db.py&quot;,
line 76, in wrapper</P>
<P STYLE="margin-bottom: 0in">return f(self, *args, **kwargs)</P>
<P STYLE="margin-bottom: 0in">File
&quot;/usr/lib/python2.5/site-packages/openerp-server/sql_db.py&quot;,
line 120, in execute</P>
<P STYLE="margin-bottom: 0in">res = self._obj.execute(query, params)</P>
<P STYLE="margin-bottom: 0in">psycopg2.IntegrityError: insert or
update on table &quot;res_users&quot; violates foreign key constraint

&quot;res_users_address_id_fkey&quot;</P>
<P STYLE="margin-bottom: 0in">DETAIL: Key (address_id)=(1) is not
present in table &quot;res_partner_address&quot; 
</P>]
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:18:52+00:00Added an answer on May 26, 2026 at 3:18 pm

    Openerp is trying to update the ‘Administrator’ address_id and it doesn’t seems to exists.
    You can add it with dummy values with a command like this:

    INSERT INTO res_partner_address VALUES (1, 1, '2011-11-02 14:50:55.607533', '2011-11-03    12:48:03.231399', 1, 5, '', NULL, '', '', true, 1, '', '', '', NULL, NULL, 67, NULL, 2, 'default', '');
    

    You must review this sql to point to the correct registers, for example the 6th field (5), points to the partner_id (it must exists), 18th (67) is the country_id or 20th (2) is the state_id.

    After insert this record, try again to launch the server…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to connect to an old PostGreSQL database (version 7.3), and I am
Currently, I am having Apache running, a PostgreSQL database, and several Python CGI script.
I updated a database table using postgresql from python My code was import psycopg2
I'm using postgresql and python and I need to store data group by week
I've seen a number of postgresql modules for python like pygresql, pypgsql, psyco. Most
A few weeks ago I asked the question Is a PHP, Python, PostgreSQL design
In PostgreSQL 8.3 database I have bookings table referencing booking_transactions table by ID. So
I am learning Python (I have a C/C++ background). I need to write something
Is there any way, in PostgreSQL accessed from Python using SQLObject, to create a
How do you unit test your python DAL that is using postgresql. In sqlite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.