{ "extra": { "sys.argv": ["'./manage.py'", "'test'", "'news'", "'--settings=rhmais.settings.local_mysql'"], "argv": ["'./manage.py'", "'test'", "'news'", "'--settings=rhmais.settings.local_mysql'"] }, "timestamp": "2015-07-18T01:00:15Z", "time_spent": null, "message": "IntegrityError: (1215, 'Cannot add foreign key constraint')", "exception": { "values": [{ "stacktrace": { "frames": [{ "function": "new_execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/raven/contrib/django/management/__init__.py", "vars": { "kwargs": { "'list'": false, "'interactive'": false, "'database'": "'default'", "u'skip_checks'": true, "'no_color'": false, "'app_label'": null, "'fake'": false, "'migration_name'": null, "'traceback'": false, "'test_flush'": true, "'verbosity'": 0, "'settings'": null, "'fake_initial'": false, "'pythonpath'": null, "'load_initial_data'": true }, "self": "", "args": [], "original_func": "", "client": "" }, "pre_context": [" return False", "", " @wraps(original_func)", " def new_execute(self, *args, **kwargs):", " try:"], "lineno": 41, "module": "raven.contrib.django.management", "post_context": [" except Exception:", " from raven.contrib.django.models import client", "", " client.captureException(extra={", " 'argv': sys.argv"], "context_line": " return original_func(self, *args, **kwargs)", "filename": "raven/contrib/django/management/__init__.py" }, { "function": "execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/base.py", "vars": { "self": "", "args": [], "translation": "", "options": { "'list'": false, "'interactive'": false, "'database'": "'default'", "u'skip_checks'": true, "'no_color'": false, "'app_label'": null, "'fake'": false, "'migration_name'": null, "'traceback'": false, "'test_flush'": true, "'verbosity'": 0, "'settings'": null, "'fake_initial'": false, "'pythonpath'": null, "'load_initial_data'": true }, "saved_locale": "'pt-br'" }, "pre_context": [" try:", " if (self.requires_system_checks and", " not options.get('skip_validation') and # Remove at the end of deprecation for `skip_validation`.", " not options.get('skip_checks')):", " self.check()"], "lineno": 444, "module": "django.core.management.base", "post_context": [" if output:", " if self.output_transaction:", " # This needs to be imported here, because it relies on", " # settings.", " from django.db import connections, DEFAULT_DB_ALIAS"], "in_app": false, "context_line": " output = self.handle(*args, **options)", "filename": "django/core/management/base.py" }, { "function": "handle", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/commands/migrate.py", "vars": { "run_syncdb": true, "args": [], "db": "'default'", "app_config": "", "plan": [ ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false], ["", false] ], "conflicts": {}, "targets": [ ["'accounts'", "u'0007_auto_20150715_2000'"], ["'admin'", "u'0001_initial'"], ["'auth'", "u'0006_require_contenttypes_0002'"], ["'bulletins'", "u'0002_auto_20150527_1738'"], ["'contenttypes'", "u'0002_remove_content_type_name'"], ["'messaging'", "u'0013_remove_conversation_isenabled'"], ["'news'", "u'0004_auto_20150504_1849'"], ["'sessions'", "u'0001_initial'"], ["'surveys'", "u'0003_surveytodelete'"] ], "self": "", "connection": "", "executor": "", "options": { "'list'": false, "'interactive'": false, "'database'": "'default'", "u'skip_checks'": true, "'no_color'": false, "'app_label'": null, "'fake'": false, "'migration_name'": null, "'traceback'": false, "'test_flush'": true, "'verbosity'": 0, "'settings'": null, "'fake_initial'": false, "'pythonpath'": null, "'load_initial_data'": true }, "target_app_labels_only": true }, "pre_context": [" # Note that pre_migrate is called from inside here, as it needs", " # the list of models about to be installed.", " if run_syncdb and executor.loader.unmigrated_apps:", " if self.verbosity >= 1:", " self.stdout.write(self.style.MIGRATE_HEADING(\"Synchronizing apps without migrations:\"))"], "lineno": 179, "module": "django.core.management.commands.migrate", "post_context": [" else:", " created_models = []", " emit_pre_migrate_signal([], self.verbosity, self.interactive, connection.alias)", "", " # The test runner requires us to flush after a syncdb but before migrations,"], "in_app": false, "context_line": " created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)", "filename": "django/core/management/commands/migrate.py" }, { "function": "sync_apps", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/core/management/commands/migrate.py", "vars": { "tables": ["u'django_migrations'"], "app_labels": ["'e89_push_messaging'", "'raven_contrib_django'", "'staticfiles'", "'e89_tools'", "'messages'", "'e89_syncing'", "'widget_tweaks'", "'e89_beta_testing'", "'rest_framework'"], "app_name": "'raven_contrib_django'", "all_models": [ ["'rest_framework'", []], ["'e89_syncing'", [""]], ["'e89_tools'", [""]], ["'e89_push_messaging'", [""]], ["'e89_beta_testing'", ["", ""]], ["'widget_tweaks'", []], ["'raven_contrib_django'", []] ], "self": "", "created_models": ["", "", "", "", ""], "cursor": "", "connection": "", "model_installed": "", "app_config": "", "editor": "", "statement": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'", "create_models": ["", "", "", "", ""], "deferred_sql": ["u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'", "u'ALTER TABLE `e89_push_messaging_device` ADD CONSTRAINT `e89_push_m_owner_id_796e11e4eeab95dc_fk_accounts_useremployee_id` FOREIGN KEY (`owner_id`) REFERENCES `accounts_useremployee` (`id`)'"], "model": "", "manifest": { "'e89_tools'": [""], "'e89_beta_testing'": ["", ""], "'raven_contrib_django'": [], "'rest_framework'": [], "'e89_syncing'": [""], "'e89_push_messaging'": [""], "'widget_tweaks'": [] }, "model_list": [] }, "pre_context": [" created_models.add(model)", "", " if self.verbosity >= 1:", " self.stdout.write(\" Running deferred SQL...\\n\")", " for statement in deferred_sql:"], "lineno": 317, "module": "django.core.management.commands.migrate", "post_context": [" finally:", " cursor.close()", "", " # The connection may have been closed by a syncdb handler.", " cursor = connection.cursor()"], "in_app": false, "context_line": " cursor.execute(statement)", "filename": "django/core/management/commands/migrate.py" }, { "function": "execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/utils.py", "vars": { "self": "", "params": null, "sql": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'" }, "pre_context": [" self.db.validate_no_broken_transaction()", " with self.db.wrap_database_errors:", " if params is None:", " return self.cursor.execute(sql)", " else:"], "lineno": 64, "module": "django.db.backends.utils", "post_context": ["", " def executemany(self, sql, param_list):", " self.db.validate_no_broken_transaction()", " with self.db.wrap_database_errors:", " return self.cursor.executemany(sql, param_list)"], "in_app": false, "context_line": " return self.cursor.execute(sql, params)", "filename": "django/db/backends/utils.py" }, { "function": "__exit__", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/utils.py", "vars": { "self": "", "traceback": "", "exc_value": "IntegrityError(1215, 'Cannot add foreign key constraint')", "dj_exc_type": "", "dj_exc_value": "IntegrityError(1215, 'Cannot add foreign key constraint')", "exc_type": "", "db_exc_type": "" }, "pre_context": [" dj_exc_value.__cause__ = exc_value", " # Only set the 'errors_occurred' flag for errors that may make", " # the connection unusable.", " if dj_exc_type not in (DataError, IntegrityError):", " self.wrapper.errors_occurred = True"], "lineno": 97, "module": "django.db.utils", "post_context": ["", " def __call__(self, func):", " # Note that we are intentionally not using @wraps here for performance", " # reasons. Refs #21109.", " def inner(*args, **kwargs):"], "in_app": false, "context_line": " six.reraise(dj_exc_type, dj_exc_value, traceback)", "filename": "django/db/utils.py" }, { "function": "execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/utils.py", "vars": { "self": "", "params": null, "sql": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'" }, "pre_context": ["", " def execute(self, sql, params=None):", " self.db.validate_no_broken_transaction()", " with self.db.wrap_database_errors:", " if params is None:"], "lineno": 62, "module": "django.db.backends.utils", "post_context": [" else:", " return self.cursor.execute(sql, params)", "", " def executemany(self, sql, param_list):", " self.db.validate_no_broken_transaction()"], "in_app": false, "context_line": " return self.cursor.execute(sql)", "filename": "django/db/backends/utils.py" }, { "function": "execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/django/db/backends/mysql/base.py", "vars": { "query": "u'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'", "self": "", "args": null }, "pre_context": [" self.cursor = cursor", "", " def execute(self, query, args=None):", " try:", " # args is None means no string interpolation"], "lineno": 124, "module": "django.db.backends.mysql.base", "post_context": [" except Database.OperationalError as e:", " # Map some error codes to IntegrityError, since they seem to be", " # misclassified and Django would prefer the more logical place.", " if e.args[0] in self.codes_for_integrityerror:", " six.reraise(utils.IntegrityError, utils.IntegrityError(*tuple(e.args)), sys.exc_info()[2])"], "in_app": false, "context_line": " return self.cursor.execute(query, args)", "filename": "django/db/backends/mysql/base.py" }, { "function": "execute", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/MySQLdb/cursors.py", "vars": { "exc": "", "self": "", "args": null, "db": "", "value": "IntegrityError(1215, 'Cannot add foreign key constraint')", "r": null, "query": "'ALTER TABLE `e89_syncing_synclog` ADD CONSTRAINT `e89_syncing_user_id_670069ad1cf9eaae_fk_accounts_useremployee_id` FOREIGN KEY (`user_id`) REFERENCES `accounts_useremployee` (`id`)'" }, "pre_context": [" raise", " except:", " exc, value, tb = sys.exc_info()", " del tb", " self.messages.append((exc, value))"], "lineno": 205, "module": "MySQLdb.cursors", "post_context": [" self._executed = query", " if not self._defer_warnings: self._warning_check()", " return r", "", " def executemany(self, query, args):"], "context_line": " self.errorhandler(self, exc, value)", "filename": "MySQLdb/cursors.py" }, { "function": "defaulterrorhandler", "abs_path": "/Users/luccascorrea/Desenvolvimento/virt_env/env_rh/lib/python2.7/site-packages/MySQLdb/connections.py", "vars": { "errorclass": "", "errorvalue": "IntegrityError(1215, 'Cannot add foreign key constraint')", "error": ["", "IntegrityError(1215, 'Cannot add foreign key constraint')"] }, "pre_context": [" cursor.messages.append(error)", " else:", " connection.messages.append(error)", " del cursor", " del connection"], "lineno": 36, "module": "MySQLdb.connections", "post_context": ["", "re_numeric_part = re.compile(r\"^(\\d+)\")", "", "def numeric_part(s):", " \"\"\"Returns the leading numeric part of a string."], "context_line": " raise errorclass, errorvalue", "filename": "MySQLdb/connections.py" }] }, "type": "IntegrityError", "value": "(1215, 'Cannot add foreign key constraint')", "module": "django.db.utils" }] }, "culprit": "MySQLdb.connections in defaulterrorhandler", "server_name": "Luccass-Mac-mini.local", "level": 40, "event_id": "8dc16194c04140f685352eeb941fb94f", "tags": {}, "modules": { "python": "2.7.5", "e89_push_messaging": "1.0.5", "rest_framework": "3.1.0", "e89_beta_testing": "1.0.0", "e89_tools": "1.0.0", "raven": "5.3.1", "e89_syncing": "1.0.3", "django": "1.8.3" }, "project": "25072", "platform": "python" }