#685: IntegrityError: duplicate key value violates unique constraint
"permission_pk"DETAIL:  Key (username, action, product)=(authenticated,
PRODUCT_VIEW, domtracDispatcher) already exists.
-----------------------+-----------------------
 Reporter:  ogaerick   |      Owner:  nobody
     Type:  defect     |     Status:  new
 Priority:  blocker    |  Milestone:  Release 8
Component:  dashboard  |    Version:  0.7.0
 Keywords:             |
-----------------------+-----------------------
 ==== How to Reproduce ====

 Although the authorization does not show in the list (see attached screen
 shot), it throws an error that it already exists. Also, the authority is
 not available to users. It seems that there is some strange caching going
 on.

 While doing a POST operation on `/admin/general/perm`, Trac issued an
 internal error.

 ''(please provide additional details here)''

 Request parameters:
 {{{
 {'__FORM_TOKEN': u'b478fd95143a5a24fefc52ec',
  'action': u'PRODUCT_VIEW',
  'add': u'Add',
  'cat_id': u'general',
  'panel_id': u'perm',
  'path_info': None,
  'subject': u'authenticated\t'}
 }}}

 User agent: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4)
 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.76 Safari/537.36`

 ==== System Information ====
 || '''`Trac`''' || `1.0.1` [[br]] `` ||
 || '''`Babel`''' || `0.9.6` ||
 || '''`Bloodhound Trac`''' || `1.0.1` ||
 || '''`Genshi`''' || `0.6.1 (without speedups)` ||
 || '''`mod_wsgi`''' || `3.3 (WSGIProcessGroup bloodhound_tracker
 WSGIApplicationGroup %{GLOBAL})` ||
 || '''`psycopg2`''' || `2.4.5` ||
 || '''`Pygments`''' || `1.6` ||
 || '''`Python`''' || `2.7.3 (default, Apr 10 2013, 06:31:07) ` [[br]]
 `[GCC 4.6.3]` ||
 || '''`pytz`''' || `2013b` ||
 || '''`setuptools`''' || `0.6` ||
 || '''`jQuery`''' || `1.7.2` ||

 ==== Enabled Plugins ====
 || '''`BloodhoundDashboardPlugin`''' || `0.7.0` ||
 || '''`BloodhoundMultiProduct`''' || `0.7.0` ||
 || '''`BloodhoundRelationsPlugin`''' || `0.7.0` ||
 || '''`BloodhoundSearchPlugin`''' || `0.7.0` ||
 || '''`BloodhoundTheme`''' || `0.7.0` ||
 || '''`TicketImport`''' || `0.8.3` ||
 || '''`TracAccountManager`''' || `0.4.3` ||
 || '''`TracPermRedirect`''' || `3.0` ||
 || '''`TracThemeEngine`''' || `2.2.0` ||

 ==== Python Traceback ====
 {{{
 Traceback (most recent call last):
   File "/opt/apache-bloodhound-0.7/trac/trac/web/main.py", line 477, in
 _dispatch_request
     dispatcher.dispatch(req)
   File "/opt/apache-bloodhound-0.7/trac/trac/web/main.py", line 214, in
 dispatch
     resp = chosen_handler.process_request(req)
   File "/opt/apache-bloodhound-0.7/trac/trac/admin/web_ui.py", line 130,
 in process_request
     path_info)
   File "/opt/apache-bloodhound-0.7/trac/trac/admin/web_ui.py", line 394,
 in render_admin_panel
     perm.grant_permission(subject, action)
   File "/opt/apache-bloodhound-0.7/trac/trac/perm.py", line 347, in
 grant_permission
     self.store.grant_permission(username, action)
   File "/opt/apache-bloodhound-0.7/trac/trac/perm.py", line 236, in
 grant_permission
     (username, action))
   File "/opt/apache-
 bloodhound-0.7/bloodhound_multiproduct/multiproduct/dbcursor.py", line
 183, in __call__
     return self.db_context(*args, **kwargs)
   File "/opt/apache-bloodhound-0.7/trac/trac/db/api.py", line 122, in
 execute
     return db.execute(query, params)
   File "/opt/apache-bloodhound-0.7/trac/trac/db/util.py", line 121, in
 execute
     cursor.execute(query, params)
   File "/opt/apache-
 bloodhound-0.7/bloodhound_multiproduct/multiproduct/dbcursor.py", line 83,
 in execute
     return super(BloodhoundIterableCursor,
 self).execute(translate_sql(self.env, sql), args=args)
   File "/opt/apache-bloodhound-0.7/trac/trac/db/util.py", line 65, in
 execute
     return self.cursor.execute(sql_escape_percent(sql), args)
 IntegrityError: duplicate key value violates unique constraint
 "permission_pk"
 DETAIL:  Key (username, action, product)=(authenticated, PRODUCT_VIEW,
 domtracDispatcher) already exists.

 }}}

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/685>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Reply via email to