Skip to content
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

Cannot import countries with island(s) #4

Open
JesusEkie opened this issue Jan 30, 2020 · 0 comments
Open

Cannot import countries with island(s) #4

JesusEkie opened this issue Jan 30, 2020 · 0 comments

Comments

@JesusEkie
Copy link

Hello,

I don't know if some of you have made the same remark but when you try to import some islands or countries with islands like india I always get that error:

Traceback (most recent call last):
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
psycopg2.IntegrityError: insert or update on table "locations_adminboundary" violates foreign key constraint "locations_adminbound_parent_id_03a6640e_fk_locations"
DETAIL: Key (parent_id)=(16047) is not present in table "locations_adminboundary".

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 9, in
execute_from_command_line(sys.argv)
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/core/management/init.py", line 381, in execute_from_command_line
utility.execute()
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/core/management/init.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
output = self.handle(*args, **options)
File "/mnt/rapidpro/temba/locations/management/commands/import_geojson.py", line 222, in handle
self.stdout.write(self.style.SUCCESS(f"Other unseen boundaries removed: {cursor.rowcount}"))
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/transaction.py", line 240, in exit
connection.commit()
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/backends/base/base.py", line 262, in commit
self._commit()
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/utils.py", line 89, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/mnt/rapidpro/env/lib/python3.7/site-packages/django/db/backends/base/base.py", line 240, in _commit
return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table "locations_adminboundary" violates foreign key constraint "locations_adminbound_parent_id_03a6640e_fk_locations"
DETAIL: Key (parent_id)=(16047) is not present in table "locations_adminboundary".

Any idea?

The executed command: _python manage.py import_geojson R304716*simplified.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant