-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import any other than en-US fails #10
Comments
Hello, The log : (from freshly up docker)
Thanks in advance for your help |
Same Issue here, A small Red Error Notice shows in Frontend exclaiming "Failure: There was an error creating a resource!" Install is also relatively fresh and apart from this import it works flawlessly so far. |
also i think this is the main open issue for the problem described here: TandoorRecipes/recipes#2514 |
When trying to do an open-data import and selecting "nl" or even "de" it fails. This happens both on existing and clean new space.
en-US imports fine
Errors in log show.
172.30.32.1 - - [16/Aug/2023:19:52:09 +0200] "GET /api/group/ HTTP/1.1" 200 72 "https://[mydomain]space-manage/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" {'selected_version': 'nl', 'selected_datatypes': ['food', 'unit', 'category', 'property', 'store', 'conversion'], 'update_existing': True, 'use_metric': True} Internal Server Error: /api-import-open-data/ Traceback (most recent call last): File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute return Database.Cursor.execute(self, query, params) sqlite3.IntegrityError: UNIQUE constraint failed: cookbook_unit.space_id, cookbook_unit.open_data_slug The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/recipes/venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 56, in inner response = get_response(request) File "/opt/recipes/venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/recipes/venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 55, in wrapped_view return view_func(*args, **kwargs) File "/opt/recipes/venv/lib/python3.10/site-packages/django/views/generic/base.py", line 103, in view return self.dispatch(request, *args, **kwargs) File "/opt/recipes/venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch response = self.handle_exception(exc) File "/opt/recipes/venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception self.raise_uncaught_exception(exc) File "/opt/recipes/venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception raise exc File "/opt/recipes/venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) File "/opt/recipes/cookbook/views/api.py", line 1479, in post response_obj['unit'] = len(data_importer.import_units()) File "/opt/recipes/cookbook/helper/open_data_importer.py", line 36, in import_units return Unit.objects.bulk_create(insert_list, update_conflicts=True, update_fields=('name', 'plural_name', 'base_unit', 'open_data_slug'), unique_fields=('space', 'name',)) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/models/query.py", line 816, in bulk_create returned_columns = self._batched_insert( File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/models/query.py", line 1825, in _batched_insert self._insert( File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/models/query.py", line 1791, in _insert return query.get_compiler(using=using).execute_sql(returning_fields) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/models/sql/compiler.py", line 1660, in execute_sql cursor.execute(sql, params) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute return self._execute_with_wrappers( File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers return executor(sql, params, many, context) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute with self.db.wrap_database_errors: File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in __exit__ raise dj_exc_value.with_traceback(traceback) from exc_value File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute return self.cursor.execute(sql, params) File "/opt/recipes/venv/lib/python3.10/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute return Database.Cursor.execute(self, query, params) django.db.utils.IntegrityError: UNIQUE constraint failed: cookbook_unit.space_id, cookbook_unit.open_data_slug 172.30.32.1 - - [16/Aug/2023:19:52:18 +0200] "POST /api-import-open-data/ HTTP/1.1" 500 145 "https://[mydomain]space-manage/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
The text was updated successfully, but these errors were encountered: