Failed to load an Arkindex export due to an sqlite constraint

Bastien Abadie
2022-08-25T19:21:17Z

I tried to load an export of [Bozen](https://arkindex.teklia.com/browse/07471beb-47da-463e-8270-a3fee98ac450?top_level=true&folder=true&order=name&order_direction=asc) and got the following error: ``` docker exec -it ark-backend arkind...

I tried to load an export of Bozen

and got the following error:

docker exec -it ark-backend arkindex load_export /tmp/bozen.sqlite --email=yschneider@teklia.com
Creating corpus Corpus import 2022-08-25 15:29
Importing element types
Ran on 6 rows: 6 created, 0 errors in 0:00:00.101579
Importing classes
Ran on 4 rows: 4 created, 0 errors in 0:00:00.053910
Importing repositories
Ran on 1 rows: 0 created, 0 errors in 0:00:00.004406
Importing revisions
Ran on 1 rows: 0 created, 0 errors in 0:00:00.005086
Importing worker types
Ran on 1 rows: 0 created, 0 errors in 0:00:00.003966
Importing workers
Ran on 1 rows: 0 created, 0 errors in 0:00:00.004596
Importing worker versions
Ran on 1 rows: 0 created, 0 errors in 0:00:00.010357
Importing image servers
Ran on 2 rows: 1 created, 0 errors in 0:00:00.033206
Creating images
Ran on 450 rows: 450 completed, 0 failed in 0:00:00.968419
Traceback (most recent call last):
  File "/usr/share/arkindex/manage.py", line 22, in <module>
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.8/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 414, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.8/site-packages/django/core/management/base.py", line 460, in execute
    output = self.handle(*args, **options)
  File "/usr/share/arkindex/documents/management/commands/load_export.py", line 489, in handle
  File "/usr/share/arkindex/documents/management/commands/load_export.py", line 404, in create_elements
sqlite3.IntegrityError: UNIQUE constraint failed: image_map.url