Import Errors with null value in column title
When importing music files in my library I have had a few errors, where the worker log looks like this:
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,796: WARNING/ForkPoolWorker-3] [celery] Error during task f72343f9-f7a5-4af8-9231-e73d19e43a8d: null value in column "title" violates not-null constraint
Sep 28 14:21:50 funkwhale celery[29890]: DETAIL: Failing row contains (870, null, 2018-09-28 12:21:50.628852+00, null, null, album, 493, , null, b8ad191f-3e75-4132-8fb3-b620daf1b063, https://music.imaginair.es/federation/music/albums/b8ad191f-3e75..., null).
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] Traceback (most recent call last):
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
Sep 28 14:21:50 funkwhale celery[29890]: return self.cursor.execute(sql, params)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] psycopg2.IntegrityError: null value in column "title" violates not-null constraint
Sep 28 14:21:50 funkwhale celery[29890]: DETAIL: Failing row contains (870, null, 2018-09-28 12:21:50.628852+00, null, null, album, 493, , null, b8ad191f-3e75-4132-8fb3-b620daf1b063, https://music.imaginair.es/federation/music/albums/b8ad191f-3e75..., null).
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] The above exception was the direct cause of the following exception:
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] Traceback (most recent call last):
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,797: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/celery/app/trace.py", line 375, in trace_task
Sep 28 14:21:50 funkwhale celery[29890]: R = retval = fun(*args, **kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/celery/app/trace.py", line 632, in __protected_call__
Sep 28 14:21:50 funkwhale celery[29890]: return self.run(*args, **kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/api/funkwhale_api/taskapp/celery.py", line 52, in inner
Sep 28 14:21:50 funkwhale celery[29890]: return function(*args, **kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/api/funkwhale_api/music/tasks.py", line 235, in process_upload
Sep 28 14:21:50 funkwhale celery[29890]: track = get_track_from_import_metadata(final_metadata)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/usr/lib/python3.6/contextlib.py", line 52, in inner
Sep 28 14:21:50 funkwhale celery[29890]: return func(*args, **kwds)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/api/funkwhale_api/music/tasks.py", line 516, in get_track_from_import_metadata
Sep 28 14:21:50 funkwhale celery[29890]: models.Album, query, defaults=defaults, sort_fields=["mbid", "fid"]
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/api/funkwhale_api/music/tasks.py", line 372, in get_best_candidate_or_create
Sep 28 14:21:50 funkwhale celery[29890]: return model.objects.create(**defaults), True
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
Sep 28 14:21:50 funkwhale celery[29890]: return getattr(self.get_queryset(), name)(*args, **kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/query.py", line 417, in create
Sep 28 14:21:50 funkwhale celery[29890]: obj.save(force_insert=True, using=self.db)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/api/funkwhale_api/music/models.py", line 113, in save
Sep 28 14:21:50 funkwhale celery[29890]: return super().save(**kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,798: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/base.py", line 729, in save
Sep 28 14:21:50 funkwhale celery[29890]: force_update=force_update, update_fields=update_fields)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/base.py", line 759, in save_base
Sep 28 14:21:50 funkwhale celery[29890]: updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/base.py", line 842, in _save_table
Sep 28 14:21:50 funkwhale celery[29890]: result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/base.py", line 880, in _do_insert
Sep 28 14:21:50 funkwhale celery[29890]: using=using, raw=raw)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
Sep 28 14:21:50 funkwhale celery[29890]: return getattr(self.get_queryset(), name)(*args, **kwargs)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/query.py", line 1125, in _insert
Sep 28 14:21:50 funkwhale celery[29890]: return query.get_compiler(using=using).execute_sql(return_id)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1285, in execute_sql
Sep 28 14:21:50 funkwhale celery[29890]: cursor.execute(sql, params)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 68, in execute
Sep 28 14:21:50 funkwhale celery[29890]: return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
Sep 28 14:21:50 funkwhale celery[29890]: return executor(sql, params, many, context)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
Sep 28 14:21:50 funkwhale celery[29890]: return self.cursor.execute(sql, params)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,799: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
Sep 28 14:21:50 funkwhale celery[29890]: raise dj_exc_value.with_traceback(traceback) from exc_value
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,800: WARNING/ForkPoolWorker-3] File "/srv/funkwhale/.local/lib/python3.6/site-packages/django/db/backends/utils.py", line 85, in _execute
Sep 28 14:21:50 funkwhale celery[29890]: return self.cursor.execute(sql, params)
Sep 28 14:21:50 funkwhale celery[29890]: [2018-09-28 12:21:50,800: WARNING/ForkPoolWorker-3] django.db.utils.IntegrityError: null value in column "title" violates not-null constraint