archive IntegrityError

Bug #906958 reported by Christian Zagrodnick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Low
Shane Hathaway

Bug Description

Mon Dec 19 14:47:11 2011
Exception when processing https://portal.ariadne-network.eu/communities/against-child-sexual-exploitation/files/add_file.html
Referer: https://portal.ariadne-network.eu/communities/against-child-sexual-exploitation/files/add_file.html
Traceback (most recent call last):
  File "/srv/multikarl/production/7/eggs/karl-3.77-py2.6.egg/karl/errorlog.py", line 18, in middleware
    return app(environ, start_response)
  File "/srv/multikarl/production/7/eggs/repoze.retry-0.9.4-py2.6.egg/repoze/retry/__init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/srv/multikarl/production/7/eggs/repoze.zodbconn-0.11-py2.6.egg/repoze/zodbconn/connector.py", line 21, in __call__
    result = self.next_app(environ, start_response)
  File "/srv/multikarl/production/7/eggs/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 47, in __call__
    self.commit()
  File "/srv/multikarl/production/7/eggs/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 52, in commit
    t.commit()
  File "/srv/multikarl/production/7/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 329, in commit
    self._commitResources()
  File "/srv/multikarl/production/7/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 441, in _commitResources
    rm.tpc_begin(self)
  File "/srv/multikarl/production/7/eggs/zope.sqlalchemy-0.6.1-py2.6.egg/zope/sqlalchemy/datamanager.py", line 87, in tpc_begin
    self.session.flush()
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/session.py", line 1473, in flush
    self._flush(objects)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/session.py", line 1542, in _flush
    flush_context.execute()
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/unitofwork.py", line 327, in execute
    rec.execute(self)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/unitofwork.py", line 471, in execute
    uow
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/mapper.py", line 2136, in _save_obj
    execute(statement, multiparams)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/engine/base.py", line 1358, in execute
    params)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/engine/base.py", line 1491, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/engine/base.py", line 1599, in _execute_context
    context)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/engine/base.py", line 1592, in _execute_context
    context)
  File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/engine/default.py", line 325, in do_execute
    cursor.execute(statement, parameters)
IntegrityError: (IntegrityError) duplicate key value violates unique constraint "archived_item_pkey"
DETAIL: Key (container_id, namespace, name)=(-1436229255, , tackling-child-sexual-exploitation-action-plan.pdf) already exists.
 'INSERT INTO archived_item (container_id, namespace, name, docid) VALUES (%(container_id)s, %(namespace)s, %(name)s, %(docid)s)' {'namespace': u'', 'container_id': -1436229255, 'docid': 433941317, 'name': u'tackling-child-sexual-exploitation-action-plan.pdf'}

Tags: r3.80
Changed in karl3:
importance: Undecided → Low
milestone: none → m87
Changed in karl3:
assignee: nobody → Shane Hathaway (shane-hathawaymix)
Revision history for this message
Shane Hathaway (shane-hathawaymix) wrote :

Looking at the logs, it seems the same file was successfully uploaded 8 seconds earlier. I think the web interface tried to upload the file twice.

The IntegrityError only occurred because the transaction took a while to finish; the file did not exist in the archive when the transaction started, but the file did exist by the time the transaction was trying to commit. This kind of IntegrityError is yet another retryable error (like ZODB's ConflictError), so I think I should add IntegrityError to the list of exception types to retry.

Revision history for this message
Paul Everitt (paul-agendaless) wrote : Re: [Bug 906958] Re: archive IntegrityError
Download full text (4.6 KiB)

Sounds good. If you think this really is an intermittent thing, we could just wait for it to come back, if ever.

--Paul

On Dec 30, 2011, at 3:44 PM, Shane Hathaway wrote:

> Looking at the logs, it seems the same file was successfully uploaded 8
> seconds earlier. I think the web interface tried to upload the file
> twice.
>
> The IntegrityError only occurred because the transaction took a while to
> finish; the file did not exist in the archive when the transaction
> started, but the file did exist by the time the transaction was trying
> to commit. This kind of IntegrityError is yet another retryable error
> (like ZODB's ConflictError), so I think I should add IntegrityError to
> the list of exception types to retry.
>
> --
> You received this bug notification because you are subscribed to KARL3.
> https://bugs.launchpad.net/bugs/906958
>
> Title:
> archive IntegrityError
>
> Status in KARL3:
> New
>
> Bug description:
>
> Mon Dec 19 14:47:11 2011
> Exception when processing https://portal.ariadne-network.eu/communities/against-child-sexual-exploitation/files/add_file.html
> Referer: https://portal.ariadne-network.eu/communities/against-child-sexual-exploitation/files/add_file.html
> Traceback (most recent call last):
> File "/srv/multikarl/production/7/eggs/karl-3.77-py2.6.egg/karl/errorlog.py", line 18, in middleware
> return app(environ, start_response)
> File "/srv/multikarl/production/7/eggs/repoze.retry-0.9.4-py2.6.egg/repoze/retry/__init__.py", line 88, in __call__
> app_iter = self.application(environ, replace_start_response)
> File "/srv/multikarl/production/7/eggs/repoze.zodbconn-0.11-py2.6.egg/repoze/zodbconn/connector.py", line 21, in __call__
> result = self.next_app(environ, start_response)
> File "/srv/multikarl/production/7/eggs/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 47, in __call__
> self.commit()
> File "/srv/multikarl/production/7/eggs/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py", line 52, in commit
> t.commit()
> File "/srv/multikarl/production/7/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 329, in commit
> self._commitResources()
> File "/srv/multikarl/production/7/eggs/transaction-1.1.1-py2.6.egg/transaction/_transaction.py", line 441, in _commitResources
> rm.tpc_begin(self)
> File "/srv/multikarl/production/7/eggs/zope.sqlalchemy-0.6.1-py2.6.egg/zope/sqlalchemy/datamanager.py", line 87, in tpc_begin
> self.session.flush()
> File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/session.py", line 1473, in flush
> self._flush(objects)
> File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/session.py", line 1542, in _flush
> flush_context.execute()
> File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/unitofwork.py", line 327, in execute
> rec.execute(self)
> File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-py2.6-linux-i686.egg/sqlalchemy/orm/unitofwork.py", line 471, in execute
> uow
> File "/srv/multikarl/production/7/eggs/SQLAlchemy-0.7.1-...

Read more...

Revision history for this message
Shane Hathaway (shane-hathawaymix) wrote :
Changed in karl3:
status: New → Fix Committed
Revision history for this message
JimPGlenn (jpglenn09) wrote :

fixed

Changed in karl3:
status: Fix Committed → Fix Released
tags: added: r3.80
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.