iobis / bioeco-etl

ETL scripts for the GOOS BioEco networks portal
0 stars 1 forks source link

Import fails for some layers #1

Open pieterprovoost opened 2 years ago

pieterprovoost commented 2 years ago
root@6bd25a08219c:/usr/src/geonode# python manage.py importlayers import

[failed] Layer for 'import/assessment_and_commercial_forecasting_of_fish_and_other_hydrobionts_resources_of_the_black_sea_coast_and_inland_waters_of_georgia_biological_monitoring_determination_of_the_environmental_status_of_the_reservoirs_code_4/assessment_and_commercial_forecasting_of_fish_and_other_hydrobionts_resources_of_the_black_sea_coast_and_inland_waters_of_georgia_biological_monitoring_determination_of_the_environmental_status_of_the_reservoirs_code_4.shp' (22/625)
[failed] Layer for 'import/chair_of_the_european_north_west_continental_shelf_operational_oceanographic_system_1_out_of_the_5_eurogoos_regional_systems/chair_of_the_european_north_west_continental_shelf_operational_oceanographic_system_1_out_of_the_5_eurogoos_regional_systems.shp' (102/625)
[failed] Layer for 'import/in_alliance_with_orca_uk_on_ferry_monitoring_in_the_former_european_cetacean_monitoring_coalition_and_the_rugvin_harbour_porpoise_photo_id_team_in_the_eastern_scheldt/in_alliance_with_orca_uk_on_ferry_monitoring_in_the_former_european_cetacean_monitoring_coalition_and_the_rugvin_harbour_porpoise_photo_id_team_in_the_eastern_scheldt.shp' (219/625)
[failed] Layer for 'import/long_term_ecological_reseach_peld_at_the_ilter_site_tamandare_spatial_and_temporal_dynamics_of_marine_ecosystems_connectivity_resilience_and_sustainable_use_in_southern_pernambuco/long_term_ecological_reseach_peld_at_the_ilter_site_tamandare_spatial_and_temporal_dynamics_of_marine_ecosystems_connectivity_resilience_and_sustainable_use_in_southern_pernambuco.shp' (277/625)
[failed] Layer for 'import/long_term_monitoring_tagging_and_in_situ_egg_incubation_research_and_conservation_project_for_sea_turtles_at_chagar_hutang_turtle_sanctuary/long_term_monitoring_tagging_and_in_situ_egg_incubation_research_and_conservation_project_for_sea_turtles_at_chagar_hutang_turtle_sanctuary.shp' (288/625)
[failed] Layer for 'import/marine_biodiversity_and_climate_change_assessing_and_predicting_the_influence_of_climatic_change_using_intertidal_rocky_shore_biota/marine_biodiversity_and_climate_change_assessing_and_predicting_the_influence_of_climatic_change_using_intertidal_rocky_shore_biota.shp' (320/625)
[failed] Layer for 'import/modular_observing_solutions_for_earth_systems_moses_and_cosyna_coastal_observing_systems_of_the_north_sea_and_artic_oceans/modular_observing_solutions_for_earth_systems_moses_and_cosyna_coastal_observing_systems_of_the_north_sea_and_artic_oceans.shp' (356/625)
[failed] Layer for 'import/piln;_turtle_monitoring;_mangrove_monitoring;_community_based_integrated_mangroves_and_natural_resources_co_management_with_grassroots_people;_environment_spatial_planning/piln;_turtle_monitoring;_mangrove_monitoring;_community_based_integrated_mangroves_and_natural_resources_co_management_with_grassroots_people;_environment_spatial_planning.shp' (450/625)

Finished processing 625 layers in 2187.18 seconds.

617 Created layers
0 Updated layers
0 Skipped layers
8 Failed layers
3.4994926335999996 seconds per layer
pieterprovoost commented 2 years ago

Import currently fails for all layers on the production machine:

root@d48a96c2f1c7:/usr/src/geonode# python manage.py importlayers -v 2 import
System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace 'rest_framework' isn't unique. You may not be able to reverse all URLs in this namespace
Verifying that GeoNode is running ...

Found 1 potential layers.

[failed] Layer for 'import/acoustic_tracking_array_platform/acoustic_tracking_array_platform.shp' (1/1)

Detailed report of failures:

 import/acoustic_tracking_array_platform/acoustic_tracking_array_platform.shp
================
Traceback (most recent call last):
  File "/usr/src/geonode/geonode/security/utils.py", line 1038, in _update_geofence_rule
    _create_geofence_rule(payload)
  File "/usr/src/geonode/geonode/security/utils.py", line 1012, in _create_geofence_rule
    raise GeofenceRequestError(detail=response.text)
geonode.security.utils.GeofenceRequestError: <!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unauthorized</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.53</h3></body></html>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/geonode/geonode/security/models.py", line 252, in set_default_permissions
    self.set_dirty_state()
  File "/usr/src/geonode/geonode/security/utils.py", line 163, in __exit__
    self._execute_requests()
  File "/usr/src/geonode/geonode/security/utils.py", line 169, in _execute_requests
    self.adapter_requests_map[request["name"]](
  File "/usr/src/geonode/geonode/security/utils.py", line 102, in update_rule
    _update_geofence_rule(*args, **kwargs)
  File "/usr/src/geonode/geonode/security/utils.py", line 1047, in _update_geofence_rule
    raise RuntimeError(msg)
RuntimeError: Could not ADD GeoServer User admin Rule for Layer acoustic_tracking_array_platform: '<!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unauthorized</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.53</h3></body></html>'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/geonode/geonode/layers/utils.py", line 814, in upload
    layer = file_upload(
  File "/usr/local/lib/python3.8/contextlib.py", line 75, in inner
    return func(*args, **kwds)
  File "/usr/src/geonode/geonode/layers/utils.py", line 615, in file_upload
    layer = Layer.objects.create(
  File "/usr/local/lib/python3.8/site-packages/django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/modeltranslation/manager.py", line 375, in create
    return super(MultilingualQuerySet, self).create(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/query.py", line 422, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/src/geonode/geonode/base/models.py", line 1068, in save
    super(ResourceBase, self).save(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/polymorphic/models.py", line 91, in save
    return super(PolymorphicModel, self).save(*args, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 743, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/local/lib/python3.8/site-packages/django/db/models/base.py", line 791, in save_base
    post_save.send(
  File "/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 173, in send
    return [
  File "/usr/local/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 174, in <listcomp>
    (receiver, receiver(signal=self, sender=sender, **named))
  File "/usr/src/geonode/geonode/base/models.py", line 2002, in resourcebase_post_save
    instance.set_missing_info()
  File "/usr/src/geonode/geonode/base/models.py", line 1685, in set_missing_info
    self.set_default_permissions(owner=user)
  File "/usr/src/geonode/geonode/security/models.py", line 255, in set_default_permissions
    raise GeoNodeException(e)
geonode.GeoNodeException: Could not ADD GeoServer User admin Rule for Layer acoustic_tracking_array_platform: '<!doctype html><html lang="en"><head><title>HTTP Status 401 – Unauthorized</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 401 – Unauthorized</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Unauthorized</p><p><b>Description</b> The request has not been applied because it lacks valid authentication credentials for the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.53</h3></body></html>'

Finished processing 1 layers in 29.21 seconds.

0 Created layers
0 Updated layers
0 Skipped layers
1 Failed layers
29.212242 seconds per layer