Uploaded image for project: 'openATTIC'
  1. openATTIC
  2. OP-2784

Database corruption when running `oaconfig install`: oA User creation will fail once

    XMLWordPrintable

    Details

    • Sprint:
      Sprint 32, Sprint 33
    • External issue ID:
      bsc#1063048

      Description

      Gatling: test_auth_token_self_refresh_wrong_token: INTERNAL SERVER ERROR: Key (id)=(1) already exists

      13:47:21 ERROR [0.358s]: test_auth_token_self_refresh_wrong_token (user.test_user.AuthTokenTestCase)
      13:47:21 Try to refresh the auth token of the testuser by using a not existing auth token and
      13:47:21 ----------------------------------------------------------------------
      13:47:21 Traceback (most recent call last):
      13:47:21   File "/root/openattic/gatling/user/scenarios.py", line 33, in setUp
      13:47:21     cls.testuser = cls._create_test_user()['response']
      13:47:21   File "/root/openattic/gatling/user/scenarios.py", line 57, in _create_test_user
      13:47:21     res = cls.send_request("POST", "users", data=user)
      13:47:21   File "/root/openattic/gatling/testcase.py", line 156, in send_request
      13:47:21     res = cls._do_request(method, url, header, data=data, auth=auth)
      13:47:21   File "/root/openattic/gatling/testcase.py", line 344, in _do_request
      13:47:21     request=e.request)
      13:47:21 requests.exceptions.HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://hostname/openattic/api/users content: {"detail": "duplicate key value violates unique constraint \"auth_user_pkey\"\nDETAIL:  Key (id)=(1) already exists.\n"}
      
      2017-10-11 13:47:00,272 13174 mod_wsgi ERROR exception#custom_handler - Internal Server Error: None
      Traceback (most recent call last):
        File "/usr/lib/python2.7/site-packages/rest_framework/views.py", line 400, in dispatch
          response = handler(request, *args, **kwargs)
        File "/usr/share/openattic/rest/restapi.py", line 134, in create
          user_data["password"])
        File "/usr/lib/python2.7/site-packages/django/contrib/auth/models.py", line 191, in create_user
          **extra_fields)
        File "/usr/lib/python2.7/site-packages/django/contrib/auth/models.py", line 186, in _create_user
          user.save(using=self._db)
        File "/usr/lib/python2.7/site-packages/django/db/models/base.py", line 545, in save
          force_update=force_update, update_fields=update_fields)
        File "/usr/lib/python2.7/site-packages/django/db/models/base.py", line 573, in save_base
          updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
        File "/usr/lib/python2.7/site-packages/django/db/models/base.py", line 654, in _save_table
          result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
        File "/usr/lib/python2.7/site-packages/django/db/models/base.py", line 687, in _do_insert
          using=using, raw=raw)
        File "/usr/lib/python2.7/site-packages/django/db/models/manager.py", line 232, in _insert
          return insert_query(self.model, objs, fields, **kwargs)
        File "/usr/lib/python2.7/site-packages/django/db/models/query.py", line 1514, in insert_query
          return query.get_compiler(using=using).execute_sql(return_id)
        File "/usr/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 903, in execute_sql
          cursor.execute(sql, params)
        File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line 69, in execute
          return super(CursorDebugWrapper, self).execute(sql, params)
        File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
          return self.cursor.execute(sql, params)
        File "/usr/lib/python2.7/site-packages/django/db/utils.py", line 99, in __exit__
          six.reraise(dj_exc_type, dj_exc_value, traceback)
        File "/usr/lib/python2.7/site-packages/django/db/backends/util.py", line 53, in execute
          return self.cursor.execute(sql, params)
      IntegrityError: duplicate key value violates unique constraint "auth_user_pkey"
      DETAIL:  Key (id)=(1) already exists.
       
      2017-10-11 13:47:05,324 13172 mod_wsgi WARNING rest.restapi#gen_new_token - User action canceled: user 'openattic' tried to refresh the authentication token of user 'gatling_testuser'.
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              swagner Sebastian Wagner
              Reporter:
              swagner Sebastian Wagner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: