UHaifa-IS / whgazetteer-mehdie

World Historical Gazetteer - MEHDIE version
http://whgazetteer.org
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

upload failure #113

Closed sinairusinek closed 1 year ago

sinairusinek commented 1 year ago

I managed to upload the file to WHG (as tsv, I just changed this to text because github doesn't let me upload tsv's here): someplaces-csv.txt However uploading to Mehdie fails with this notice:

Environment:

Request Method: POST Request URL: https://tool.mehdie.org/datasets/create/

Django Version: 2.2.28 Python Version: 3.9.2 Installed Applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.gis', 'django.contrib.messages', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.staticfiles', 'allauth', 'allauth.account', 'allauth.socialaccount', 'bootstrap_modal_forms', 'captcha', 'celery_progress', 'django_celery_results', 'django_extensions', 'django_filters', 'django_resized', 'django_tables2', 'djgeojson', 'fontawesome', 'guardian', 'leaflet', 'mathfilters', 'multiselectfield', 'rest_framework', 'rest_framework.authtoken', 'rest_framework_datatables', 'rest_framework_gis', 'tinymce', 'accounts.apps.AccountsConfig', 'api.apps.ApiConfig', 'areas.apps.AreasConfig', 'collection.apps.CollectionConfig', 'datasets.apps.DatasetsConfig', 'elastic.apps.ElasticConfig', 'main.apps.MainConfig', 'places.apps.PlacesConfig', 'remote.apps.RemoteConfig', 'resources.apps.ResourcesConfig', 'search.apps.SearchConfig', 'traces.apps.TracesConfig'] Installed Middleware: ['django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.security.SecurityMiddleware']

Traceback:

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in _execute

  1. return self.cursor.execute(sql, params)

The above exception (duplicate key value violates unique constraint "dataset_file_pkey" DETAIL: Key (id)=(222) already exists. ) was the direct cause of the following exception:

File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/exception.py" in inner

  1. response = get_response(request)

File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/base.py" in _get_response

  1. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/base.py" in _get_response

  1. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.9/dist-packages/sentry_sdk/integrations/django/views.py" in sentry_wrapped_callback

  1. return callback(request, *args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/views/generic/base.py" in view

  1. return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/contrib/auth/mixins.py" in dispatch

  1. return super().dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/views/generic/base.py" in dispatch

  1. return handler(request, *args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/views/generic/edit.py" in post

  1. return super().post(request, *args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/views/generic/edit.py" in post

  1. return self.form_valid(form)

File "/usr/lib/python3.9/contextlib.py" in inner

  1. return func(*args, **kwds)

File "/home/macbookpro/whgazetteer-mehdie/datasets/views.py" in form_valid

  1. DatasetFile.objects.create(

File "/usr/local/lib/python3.9/dist-packages/django/db/models/manager.py" in manager_method

  1. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/db/models/query.py" in create

  1. obj.save(force_insert=True, using=self.db)

File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py" in save

  1. self.save_base(using=using, force_insert=force_insert,

File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py" in save_base

  1. updated = self._save_table(

File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py" in _save_table

  1. result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)

File "/usr/local/lib/python3.9/dist-packages/django/db/models/base.py" in _do_insert

  1. return manager._insert([self], fields=fields, return_id=update_pk,

File "/usr/local/lib/python3.9/dist-packages/django/db/models/manager.py" in manager_method

  1. return getattr(self.get_queryset(), name)(*args, **kwargs)

File "/usr/local/lib/python3.9/dist-packages/django/db/models/query.py" in _insert

  1. return query.get_compiler(using=using).execute_sql(return_id)

File "/usr/local/lib/python3.9/dist-packages/django/db/models/sql/compiler.py" in execute_sql

  1. cursor.execute(sql, params)

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in execute

  1. return super().execute(sql, params)

File "/usr/local/lib/python3.9/dist-packages/sentry_sdk/integrations/django/init.py" in execute

  1. return real_execute(self, sql, params)

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in execute

  1. return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in _execute_with_wrappers

  1. return executor(sql, params, many, context)

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in _execute

  1. return self.cursor.execute(sql, params)

File "/usr/local/lib/python3.9/dist-packages/django/db/utils.py" in exit

  1. raise dj_exc_value.with_traceback(traceback) from exc_value

File "/usr/local/lib/python3.9/dist-packages/django/db/backends/utils.py" in _execute

  1. return self.cursor.execute(sql, params)

Exception Type: IntegrityError at /datasets/create/ Exception Value: duplicate key value violates unique constraint "dataset_file_pkey" DETAIL: Key (id)=(222) already exists.

tomersagi commented 1 year ago

Could not recreate the problem.