bcgov / ckan-ui

CKAN UI - VueJS
GNU Affero General Public License v3.0
14 stars 4 forks source link

Cannot Create/Edit Resources - 409 Error #345

Closed SteveChapmanBCDX closed 3 years ago

SteveChapmanBCDX commented 3 years ago

Testing in Toyger using version #8f55cfa.

I tried to edit a resource's name, but was not able to do so. When I tried to save my changes, the UI indicated that the Resource Type field (a required field) was empty. The UI required me to enter a value in this field before I could save my changes.

I attempted to use each of the available values for the Resource Type field. For each of these values, I received a 409 error when I tried to save the changes.

Later, I tried to create a resource. I ran into the same 409 error.

Error message in console:

Screen Shot 2021-02-25 at 9.09.00 PM.png

Steps to reproduce:

annikaLiving commented 3 years ago

Relates to #340

BrandonSharratt commented 3 years ago

This is likely a duplicate, and also likely due to a schema error, so if (now that the alerts are more visible) this pops up please create an issue with the text of the alert as a 409 is the api telling you you're colliding with something

SteveChapmanBCDX commented 3 years ago

@BrandonSharratt - Here's the response:


  "help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update",
  "success": false,
  "error": {
    "__type": "Validation Error",
    "created": [
      "Date format incorrect"
    ],
    "last_modified": [
      "Date format incorrect"
    ],
    "resource_type": [
      "Missing value"
    ]
  }
annikaLiving commented 3 years ago

FYI, I created this for the missing values for Resource Type (this is new) and Preview Information (happened a couple migrations ago). I am working on full value comparisons but had not gotten to resources yet. https://github.com/bcgov/ckan-ui/issues/357

SteveChapmanBCDX commented 3 years ago

Testing against 409 errors in Toyger version 35570d3.

Tested using datasets from the DataBC group:

Test Case #1 - Creating a new resource

On save, I'm getting a 409 error with this response:


  "help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_create",
  "success": false,
  "error": {
    "__type": "Validation Error"
  }
}
SteveChapmanBCDX commented 3 years ago

Test Case #2 - Editing an existing resource

Tested using datasets from the DataBC group:

On save, I'm getting a 409 error with this response:

{ "help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update", "success": false, "error": { "__type": "Validation Error", "created": [ "Date format incorrect" ], "last_modified": [ "Date format incorrect" ], "resource_type": [ "Missing value" ] } }

Result #2

Tested using datasets from the DataBC group:

Response:

{ "help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update", "success": false, "error": { "__type": "Validation Error", "created": [ "Date format incorrect" ] } }

SteveChapmanBCDX commented 3 years ago

Returning ticket to "Sprint Backlog" for review.

SteveChapmanBCDX commented 3 years ago

More testing in Toyger version 35570d3.

If I create a new dataset (that is, one distinct from the datasets that were migrated over from Prod), I can create new resources for that dataset.

However, I cannot modify these resources.

When I try to modify the resources, I get this 409 error:


  "help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update",
  "success": false,
  "error": {
    "__type": "Validation Error"
  }
}
annikaLiving commented 3 years ago

Version: 1.9.0-0a93892

@BrandonSharratt , tested editing a resource and got the following

This was on a resource i created to the data store but there was an issue that the file path did not stay.

{"help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update", "success": false, "error": {"__type": "Validation Error", "json_table_schema": ["Invalid JSON string: No JSON object could be decoded"]}}

This was on an existing resource

{"help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_update", "success": false, "error": {"__type": "Validation Error", "created": ["Date format incorrect"]}}

Adding: bcdc_type: geographic geographic_extent: [object Object] resource_description: RD supplemental_information: SI resource_update_cycle: annually temporal_extent: {"[object Object]":"","beginning_date":"2021-03-09","end_date":"2021-03-22"} resource_storage_format: fgdb resource_storage_location: bc geographic warehouse spatial_datatype: SDO_GEOMETRY projection_name: epsg3005 iso_topic_category: biota,environment resource_type: data resource_access_method: direct access package_id: annika-has-great-hair json_table_schema: [object Object]

annikaLiving commented 3 years ago

Still getting a 409

  1. ISO Topic Categaories - need to allow multiple selection

    {"help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_create", "success": false, "error": {"__type": "Validation Error", "iso_topic_category": ["unexpected choice \"biota,boundaries\""], "json_table_schema": ["Invalid JSON string: No JSON object could be decoded"]}}

  2. the JSON Schema Table is erroring. I left it empty.

    {"help": "https://cati.data.gov.bc.ca/api/3/action/help_show?name=resource_create", "success": false, "error": {"__type": "Validation Error", "json_table_schema": ["Invalid JSON string: No JSON object could be decoded"]}}

Adding:

bcdc_type: geographic geographic_extent: [object Object] resource_description: RD supplemental_information: SI resource_update_cycle: annually temporal_extent: {"[object Object]":"","beginning_date":"2021-03-09","end_date":"2021-03-22"} resource_storage_format: fgdb resource_storage_location: bc geographic warehouse spatial_datatype: SDO_GEOMETRY projection_name: epsg3005 iso_topic_category: biota,environment resource_type: data resource_access_method: direct access package_id: annika-has-great-hair json_table_schema: [object Object]

BrandonSharratt commented 3 years ago

Check again after https://github.com/bcgov/ckan-ui/pull/391 and https://github.com/bcgov/ckanext-bcgov-schema/pull/22 are merged