Register Service Error Internal Server Error: /shard/1/new Traceback (most recent call last): File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 464, in get_or_create return self.get(**lookup), False File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 380, in get self.model._meta.object_name promgen.models.DoesNotExist: Service matching query does not exist. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 101, in execute return self.cursor.execute(query, args) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 250, in execute self.errorhandler(self, exc, value) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler raise errorvalue File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 247, in execute res = self._query(query) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 411, in _query rowcount = self._do_query(q) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 374, in _do_query db.query(q) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/connections.py", line 277, in query _mysql.connection.query(self, query) _mysql_exceptions.IntegrityError: (1062, "Duplicate entry 'Default Service' for key 'name'") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/core/handlers/exception.py", line 41, in inner response = get_response(request) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/contrib/auth/mixins.py", line 56, in dispatch return super(LoginRequiredMixin, self).dispatch(request, *args, **kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/views/generic/base.py", line 88, in dispatch return handler(request, *args, **kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/views/generic/edit.py", line 183, in post return self.form_valid(form) File "/home/paul/tmp/prometheus/code/promgen/promgen/views.py", line 715, in form_valid service, _ = models.Service.objects.get_or_create(shard=shard, **form.clean()) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 466, in get_or_create return self._create_object_from_params(lookup, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 506, in _create_object_from_params six.reraise(*exc_info) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/utils/six.py", line 686, in reraise raise value File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 498, in _create_object_from_params obj = self.create(**params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 394, in create obj.save(force_insert=True, using=self.db) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/base.py", line 808, in save force_update=force_update, update_fields=update_fields) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/base.py", line 838, in save_base updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/base.py", line 924, in _save_table result = self._do_insert(cls._base_manager, using, fields, update_pk, raw) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/base.py", line 963, in _do_insert using=using, raw=raw) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/query.py", line 1076, in _insert return query.get_compiler(using=using).execute_sql(return_id) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1112, in execute_sql cursor.execute(sql, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/utils.py", line 64, in execute return self.cursor.execute(sql, params) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 101, in execute return self.cursor.execute(query, args) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 250, in execute self.errorhandler(self, exc, value) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler raise errorvalue File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 247, in execute res = self._query(query) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 411, in _query rowcount = self._do_query(q) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/cursors.py", line 374, in _do_query db.query(q) File "/home/paul/tmp/prometheus/env/lib/python3.5/site-packages/MySQLdb/connections.py", line 277, in query _mysql.connection.query(self, query) django.db.utils.IntegrityError: (1062, "Duplicate entry 'Default Service' for key 'name'")