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

No error reported in import_csv ETL module for good UUID's that don't point to anything #11599

Open
whatisgalen opened this issue Oct 31, 2024 · 3 comments
Labels
Subject: ETL Modules Type: Bug Something isn't working

Comments

@whatisgalen
Copy link
Member

If you load resource-instance data via the csv ETL import module, if the uuid for resourceId is a valid UUID but it doesn't actually point to a resource instance, the task will Fail but say "No Error Found" in the error reporting part under "Task Status". On the backend, the error looks like this:

[2024-10-31 16:54:47,026: ERROR/ForkPoolWorker-8] null value in column "resourcexid" of relation "resource_x_resource" violates not-null constraint
DETAIL:  Failing row contains (null, , null, null, , 58cae833-885b-48a8-8ca6-ce8d017ec863, 8cba3b90-fcab-455b-a9ca-dd3d3aef0c46, 2024-10-31 16:54:46.965601-05, 2024-10-31 16:54:46.965601-05, , 45a09c8b-ae4c-47a8-b4cf-3f2c69110b6d, 75b26286-87f8-11ef-84b8-e639e569e167, 07e8c951-f6b0-4d02-aa91-4b40fa2942d2, 9c46c119-1c44-4dee-b88f-5d85ce9eaf5f).
CONTEXT:  SQL statement "WITH relationships AS (
                SELECT n.nodeid,
                    jsonb_array_elements(t.tiledata->n.nodeid::text) AS relationship
                FROM tiles t
                    LEFT JOIN nodes n ON t.nodegroupid = n.nodegroupid
                WHERE n.datatype IN ('resource-instance-list', 'resource-instance')
                    AND t.tileid = tile_id
                    AND t.tiledata->>n.nodeid::text IS NOT null
            )
            INSERT INTO resource_x_resource (
                resourcexid,
                notes,
                relationshiptype,
                resourceinstanceidfrom,
                resourceinstanceidto,
                inverserelationshiptype,
                tileid,
                nodeid,
                created,
                modified,
                resourceinstancefrom_graphid,
                resourceinstanceto_graphid
            ) SELECT
                CASE relationship->>'resourceXresourceId'
                    WHEN '' THEN uuid_generate_v4()
                    ELSE (relationship->>'resourceXresourceId')::uuid
                END,
                '',
                relationship->>'ontologyProperty',
                resource_id,
                (relationship->>'resourceId')::uuid,
                relationship->>'inverseOntologyProperty',
                tile_id,
                nodeid,
                now(),
                now(),
                resourcefrom.graphid,
                resourceto.graphid
            FROM relationships r
                LEFT JOIN resource_instances resourcefrom ON resourcefrom.resourceinstanceid = resource_id
                LEFT JOIN resource_instances resourceto ON resourceto.resourceinstanceid = (r.relationship ->> 'resourceId')::uuid"
PL/pgSQL function __arches_refresh_tile_resource_relationships(uuid) line 9 at SQL statement
SQL statement "SELECT __arches_refresh_tile_resource_relationships(tile_id)"
PL/pgSQL function __arches_staging_to_tile(uuid) line 103 at PERFORM
@whatisgalen whatisgalen added Type: Bug Something isn't working Subject: ETL Modules labels Oct 31, 2024
@whatisgalen
Copy link
Member Author

See this screenshot as well
Screenshot 2024-10-31 at 2 59 42 PM

@whatisgalen
Copy link
Member Author

whatisgalen commented Oct 31, 2024

Actually I'm seeing the same error pop up (on the backend) for valid uuids that point to real resources; it seems that perhaps the datatype.pre_tile_save method isn't getting called in the import csv module?

@jacobtylerwalls
Copy link
Member

Yep, see #10851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Subject: ETL Modules Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants