[traceback][prod] IntegrityError when adding new skill

VERIFIED FIXED

Status

Participation Infrastructure
Phonebook
VERIFIED FIXED
2 years ago
2 years ago

People

(Reporter: nemo, Assigned: tasos)

Tracking

2016-2.2

Details

(Reporter)

Description

2 years ago
Internal Server Error: /en-US/user/edit/
Traceback (most recent call last):
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/newrelic-2.52.0.40/newrelic/hooks/framework_django.py", line 499, in wrapper
    return wrapped(*args, **kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/views.py", line 235, in edit_profile
    forms_valid = all(map(lambda x: x.is_valid(), curr_forms))
  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/views.py", line 235, in <lambda>
    forms_valid = all(map(lambda x: x.is_valid(), curr_forms))
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 162, in is_valid
    return self.is_bound and not bool(self.errors)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 154, in errors
    self.full_clean()
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/forms/forms.py", line 353, in full_clean
    self._clean_fields()
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/happyforms/__init__.py", line 29, in _clean_fields
    value = field.clean(value)
  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/forms.py", line 225, in clean
    new_db_item = self.create_value(new_value)
  File "/data/www/mozillians.org/mozillians/mozillians/phonebook/forms.py", line 199, in create_value
    return Skill.objects.create(name=value).id
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/query.py", line 372, in create
    obj.save(force_insert=True, using=self.db)
  File "/data/www/mozillians.org/mozillians/mozillians/groups/models.py", line 48, in save
    super(GroupBase, self).save()
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/base.py", line 589, in save
    force_update=force_update, update_fields=update_fields)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/base.py", line 617, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/base.py", line 698, in _save_table
    result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/base.py", line 731, in _do_insert
    using=using, raw=raw)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/query.py", line 921, in _insert
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 921, in execute_sql
    cursor.execute(sql, params)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/backends/utils.py", line 65, in execute
    return self.cursor.execute(sql, params)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 129, in execute
    return self.cursor.execute(query, args)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/newrelic-2.52.0.40/newrelic/hooks/database_dbapi2.py", line 22, in execute
    *args, **kwargs)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/data/www/mozillians.org/venv/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
IntegrityError: (1062, "Duplicate entry 'fsa' for key 'name'")
(Assignee)

Comment 1

2 years ago
The PR for fixing this is already merged in dev
https://github.com/mozilla/mozillians/pull/1346
Assignee: nobody → tasos
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
(Reporter)

Comment 2

2 years ago
Verified on stage:

* `emacs` skill exists
* Tried adding a new skill `EMACS`
* Auto-complete drop-down doesn't allow me to create the new `EMACS` skill and prompts to select `emacs` (the already existing one).
Status: RESOLVED → VERIFIED
(Reporter)

Updated

2 years ago
Version: other → next
(Reporter)

Updated

2 years ago
Version: next → 2016-2.2
You need to log in before you can comment on or make changes to this bug.