Last modified: 2014-11-12 18:04:51 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T74434, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 72434 - Can not delete tagged cohorts
Can not delete tagged cohorts
Status: RESOLVED FIXED
Product: Analytics
Classification: Unclassified
Wikimetrics (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Bahodir Mansurov
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-23 17:06 UTC by Marcel Ruiz Forns
Modified: 2014-11-12 18:04 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Marcel Ruiz Forns 2014-10-23 17:06:40 UTC
When a cohort is tagged and I try to delete it, the following flash message appears:

"Error! Wikimetrics is experiencing problems. Visit the Support page for help if this persists. You can also check the console for details."

Here is the server error:

IntegrityError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`wikimetrics`.`cohort_tag`, CONSTRAINT `cohort_tag_ibfk_1` FOREIGN KEY (`cohort_id`) REFERENCES `cohort` (`id`))') 'DELETE FROM cohort WHERE cohort.id = %s' (21,)


And here is the full stack trace:

10.0.2.2 - - [23/Oct/2014 17:04:46] "POST /cohorts/delete/21 HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/vagrant/wikimetrics/wikimetrics/controllers/cohorts.py", line 348, in delete_cohort
    delete_owner_cohort(session, cohort_id)
  File "/vagrant/wikimetrics/wikimetrics/controllers/cohorts.py", line 324, in delete_owner_cohort
    .filter(CohortStore.id == cohort_id) \
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/query.py", line 2670, in delete
    delete_op.exec_()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 897, in exec_
    self._do_exec()
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/persistence.py", line 1023, in _do_exec
    params=self.query._params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 991, in execute
    bind, close_with_result=True).execute(clause, params or {})
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/sql/elements.py", line 321, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 826, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1160, in _handle_dbapi_exception
    exc_info
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
    context)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/usr/local/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
IntegrityError: (IntegrityError) (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`wikimetrics`.`cohort_tag`, CONSTRAINT `cohort_tag_ibfk_1` FOREIGN KEY (`cohort_id`) REFERENCES `cohort` (`id`))') 'DELETE FROM cohort WHERE cohort.id = %s' (21,)
Comment 1 Gerrit Notification Bot 2014-11-06 21:36:31 UTC
Change 171726 had a related patch set uploaded by Bmansurov:
Delete cohort tags when a cohort is deleted

https://gerrit.wikimedia.org/r/171726
Comment 2 Gerrit Notification Bot 2014-11-12 15:42:22 UTC
Change 171726 merged by Nuria:
Delete cohort tags when a cohort is deleted

https://gerrit.wikimedia.org/r/171726

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links