GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bitnine Tech] - When it executes VLE(Variable Length Edge) query, why it occurs an error just the first try? · Issue #365 · apache/age

[Bitnine Tech] - When it executes VLE(Variable Length Edge) query, why it occurs an error just the first try? #365

New issue
Copy link
New issue
Copy link
Closed
Closed
[Bitnine Tech] - When it executes VLE(Variable Length Edge) query, why it occurs an error just the first try?#365
Copy link
Labels
questionFurther information is requested

Description

@Hyundong-Seo
Hyundong-Seo
opened on Nov 23, 2022
Issue body actions

vle_execute_error
The first time I try the VLE query, I always get an insert_vertex_edge error.
A second attempt at the same query executes the query.

ldbc=# SELECT * from cypher('test', $$
  EXPLAIN ANALYZE
  MATCH (v:comment)-[e:hascreatorcomment*1..3]->(v2:person)
  WHERE v.id = '962072674361'
  RETURN v, v2
$$) as (v agtype, v2 agtype);
ERROR:  insert_vertex_edge: failed to insert

Activity

Next
  1. Hyundong-Seo
    added
    questionFurther information is requested
    on Nov 23, 2022
  2. jrgemignani commented on Nov 23, 2022

    @jrgemignani
    jrgemignani
    on Nov 23, 2022
    Contributor
    More actions

    Thank you for your question!

    For any issues like this, please provide the following information to allow us to look into it -

    1. The version of PostgreSQL you are using.
    2. The version of AGE you are using.
    3. The OS that you are using.
    4. A simple explanation of the dataset being used.
    5. A small sample of the dataset that causes the issue so that we can reproduce it.
    6. An example showing the issue.
    7. What your are trying to do.

    Unfortunately, until I know more, I cannot give you an answer.

    john

  3. Hyundong-Seo
    changed the title [-]When it executes VLE(Variable Length Edge) query, why it occurs an error just the first try?[/-] [+][Bitnine Tech] - When it executes VLE(Variable Length Edge) query, why it occurs an error just the first try?[/+] on Nov 24, 2022
  4. Hyundong-Seo commented on Nov 24, 2022

    @Hyundong-Seo
    Hyundong-Seo
    on Nov 24, 2022
    Author
    More actions

    The information tested is as follows.

    1. PG11.17
    2. AGE - 1.1.0 / commit version - 4e9110d
    3. Ubuntu 20.04.5 LTS
    4. The start vertex is about COMMENT, the end vertex is about PERSON and the edge is about simple relation between comment and person.
    5. I don't know whether you want to see a dataset like this or other type.
      Edges greater than 2 depths may or may not exist.
      [start vertex - comment]
      {
      "id": 845661880713217,
      "label": "comment",
      "properties": {
      "id": "1236950581249",
      "id": 1236950581249,
      "length": "3",
      "content": "yes",
      "locationIP": "92.39.58.88",
      "browserUsed": "Chrome",
      "creationDate": "2011-08-17T14:26:59.961+0000"
      }
      }
      [edge - hascreatorcomment]
      {
      "id": 3940649673949185,
      "label": "hascreatorcomment",
      "end_id": 1981319953259400,
      "start_id": 845661880713217,
      "properties": {}
      }
      [end vertex - person]
      {
      "id": 1981319953259400,
      "label": "person",
      "properties": {
      "id": "10995116284808",
      "id": 10995116284808,
      "gender": "male",
      "birthday": "1982-02-04",
      "lastName": "Condariuc",
      "firstName": "Andrei",
      "locationIP": "92.39.58.88",
      "browserUsed": "Chrome",
      "creationDate": "2010-12-26T14:40:36.649+0000"
      }
      }
    6. I just executed it because I wanted to see the plan of the VLE lookup query, but an error occurred.
      But if I execute directly the same query again, it works.
      [the first try]
      ldbc=# SELECT * from cypher('test', $$
      ldbc$# EXPLAIN ANALYZE
      ldbc$# MATCH (v:comment)-[e:hascreatorcomment1..3]->(v2:person)
      ldbc$# WHERE v.id = '962072674361'
      ldbc$# RETURN v, v2
      ldbc$# $$) as (v agtype, v2 agtype);
      ERROR: insert_vertex_edge: failed to insert
      [The second try]
      ldbc=# SELECT * from cypher('test', $$
      EXPLAIN ANALYZE
      MATCH (v:comment)-[e:hascreatorcomment
      1..3]->(v2:person)
      WHERE v.id = '962072674361'
      RETURN v, v2
      $$) as (v agtype, v2 agtype);
      QUERY PLAN


    Nested Loop (cost=0.01..1860999881.03 rows=33830636617 width=64) (actual time=3.128..9990.038 rows=1 loops=1)
    Join Filter: age_match_vle_terminal_edge(v.id, v2.id, _age_default_alias_0.edges)
    Rows Removed by Join Filter: 9891
    -> Nested Loop (cost=0.01..314225.21 rows=10260000 width=267) (actual time=1.212..9976.277 rows=1 loops=1)
    -> Seq Scan on comment v (cost=0.00..109025.20 rows=10260 width=235) (actual time=0.420..9975.479 rows=1 loops=1)
    Filter: (agtype_access_operator(VARIADIC ARRAY[_agtype_build_vertex(id, _label_name('41527'::oid, id), properties), '"id"'::agtype]) = '"962072674361"'
    ::agtype)
    Rows Removed by Filter: 2052168
    -> Function Scan on age_vle _age_default_alias_0 (cost=0.01..10.01 rows=1000 width=32) (actual time=0.785..0.787 rows=1 loops=1)
    -> Materialize (cost=0.00..514.38 rows=9892 width=263) (actual time=0.014..10.410 rows=9892 loops=1)
    -> Seq Scan on person v2 (cost=0.00..464.92 rows=9892 width=263) (actual time=0.009..1.965 rows=9892 loops=1)
    Planning Time: 0.594 ms
    Execution Time: 9991.038 ms
    (12 rows)
    7. I have already checked by executing the query what I want to do, but I wonder why the error occurs only on the first try.

    I hope this answer has been sufficient.

    Hyundong

    Reacted by John Gemignani
  5. jrgemignani commented on Nov 29, 2022

    @jrgemignani
    jrgemignani
    on Nov 29, 2022
    Contributor
    More actions

    Does the command error if you don't use EXPLAIN at all?

  6. Hyundong-Seo commented on Nov 30, 2022

    @Hyundong-Seo
    Hyundong-Seo
    on Nov 30, 2022
    Author
    More actions

    @jrgemignani I get the same error, even if I don't use EXPLAIN

  7. jrgemignani commented on Dec 1, 2022

    @jrgemignani
    jrgemignani
    on Dec 1, 2022
    Contributor
    More actions

    @Hyundong-Seo, I am unable to reproduce your issue. So, I will need more information -

    1. What is the dataset that you are using? How is it loaded? Where is it from?
    2. Where is the v.id that you are looking for from?

    For that id - WHERE v.id = '962072674361' - is that from the vertex's internal id or is it from some property that is stored and named id?

    I should note that if it is from the vertex's id, you need to use the id() function -

    psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ MATCH (v:comment)-[e:hascreatorcomment]->(v2:person)
      WHERE v.id = 844424930131969 RETURN v, v2 $$) as (v agtype, v2 agtype);
     v | v2
    ---+----
    (0 rows)
    
    psql-11.5-5432-pgsql=# SELECT * from cypher('graph1', $$ MATCH (v:comment)-[e:hascreatorcomment]->(v2:person)
      WHERE id(v) = 844424930131969 RETURN v, v2 $$) as (v agtype, v2 agtype);
                                       v                                   |                                  v2
    
    -----------------------------------------------------------------------+------------------------------------------------------------
    -----------
     {"id": 844424930131969, "label": "comment", "properties": {}}::vertex | {"id": 1407374883553281, "label": "person", "properties": {
    }}::vertex
    (1 row)
    
    psql-11.5-5432-pgsql=#
    
    
  8. jrgemignani commented on Dec 21, 2022

    @jrgemignani
    jrgemignani
    on Dec 21, 2022
    Contributor
    More actions

    @Hyundong-Seo ?

  9. Hyundong-Seo commented on Dec 22, 2022

    @Hyundong-Seo
    Hyundong-Seo
    on Dec 22, 2022
    Author
    More actions

    @jrgemignani
    I'm sorry to response too late.

    1. What is the dataset that you are using? How is it loaded? Where is it from?
      -> This is the csv file used when using agensgraph.
    2. Where is the v.id that you are looking for from?
      -> it is from properties not from the vertex's internal id, like this
      {"id": 845387002806329, "label": "comment", "properties": {"id": "962072674361", "id": 962072674361, "length": "83", "content": "About Bertolt Brecht rn; 10 FebruarAbout France Pierre-Louis About Danc
      ing on My", "locationIP": "213.55.127.9", "browserUsed": "Internet Explorer", "creationDate": "2011-04-14T05:20:46.802+0000"}}

    When I tried it again, but it was executed today.
    thank you for your reply

    Reacted by John Gemignani
  10. Hyundong-Seo
    closed this as completedon Dec 22, 2022
  11. jrgemignani commented on Dec 23, 2022

    @jrgemignani
    jrgemignani
    on Dec 23, 2022
    Contributor
    More actions

    That happens sometimes and it is hard to figure out why. If you happen to find something like this again, that is repeatable with a specific dataset, please let us know.

  12. avowkind commented on Apr 9, 2024

    @avowkind
    avowkind
    on Apr 9, 2024
    More actions

    I know this is closed. but I am getting the same issue.

    After a long time of having no problem with VLE requests just today - on one instance of my database and not on another a request with * on the edge request causes the ERROR: "insert_vertex_edge: failed to insert" to appear.

    This occurs on a variety of requests that usually work just fine.

    I have found that if I establish an ongoing session e.g. using psql that I get this error the first time the request is run. Subsequent runs give the correct result without an error.

    Requests going in through my App API always fail because each is run in a new session.

    Why would running the query twice fix the problem?

    Reacted by John Gemignani
  13. jrgemignani commented on Apr 9, 2024

    @jrgemignani
    jrgemignani
    on Apr 9, 2024
    Contributor
    More actions

    @avowkind What version of AGE are you using? What PG version?

  14. jrgemignani commented on Apr 9, 2024

    @jrgemignani
    jrgemignani
    on Apr 9, 2024
    Contributor
    More actions

    From the code it looks to only give that specific error if the start or end vertex for the edge don't exist at the time of the vle command execution.

  15. avowkind commented on Apr 9, 2024

    @avowkind
    avowkind
    on Apr 9, 2024
    More actions

    is it worth creating a new bug report?

    Describe the bug
    A clear and concise description of what the bug is.

    It is possible to get the database into a state where a request of the form:

    SELECT * FROM cypher('fishpond', $$
    MATCH (p:PropertyType)<-[edge:typeOf*]-(node:PropertyType)
    WHERE p.id = 'fish_weight_g'
    RETURN node, edge
    $$) as ( node agtype, edge agtype);

    returns the error

    ERROR,XX000,"insert_vertex_edge: failed to insert"
    

    While the same request with [edge:typeOf] i.e no variable length path on the edge succeeds

    However, a second attempt in the same session will succeed.

    Is is an instance of #365 ( which was closed with insufficient information).

    How are you accessing AGE (Command line, driver, etc.)?

    • Can be reproduced in psql, PGAdmin and nodejs driver.

    What data setup do we need to do?

    • I'm not sure I can reproduce this issue in a small example as it only occurred after some time of use with a large dataset.
    • however the same issue does appear in a db setup from a backup of the production db. i.e. I can provide an example if required although this is

    What is the necessary configuration info needed?

    • docker image: apache/age:PG15_latest

    What is the command that caused the error?

    SELECT * FROM cypher('fishpond', $$
    MATCH (p:PropertyType)<-[edge:typeOf*]-(node:PropertyType)
    WHERE p.id = 'fish_weight_g'
    RETURN node, edge
    $$) as ( node agtype, edge agtype);
    ERROR,XX000,"insert_vertex_edge: failed to insert"
    

    Expected behavior
    on repeating the request we get back

    "{""id"": 844424930131972, ""label"": ""PropertyType"", ""properties"": {""id"": ""average_fish_weight_g"", ""name"": ""Average fish weight"", ""published"": true, ""relations"": [{""id"": ""fish_weight_g"", ""relation"": ""typeOf""}], ""resultType"": ""measurement"", ""description"": ""The average weight of the fish in the tank""}}::vertex"	"{""id"": 1125899906842627, ""label"": ""typeOf"", ""end_id"": 844424930131971, ""start_id"": 844424930131972, ""properties"": {}}::edge"
    "{""id"": 844424930131974, ""label"": ""PropertyType"", ""properties"": {""id"": ""culled_fish_weight_g"", ""name"": ""Fish Weight (culled)"", ""units"": ""g"", ""published"": true, ""relations"": [{""id"": ""fish_weight_g"", ""relation"": ""typeOf""}], ""resultType"": ""measurement"", ""description"": ""Weight of fish after culling""}}::vertex"	"{""id"": 1125899906842628, ""label"": ""typeOf"", ""end_id"": 844424930131971, ""start_id"": 844424930131974, ""properties"": {}}::edge"
    "{""id"": 844424930131975, ""label"": ""PropertyType"", ""properties"": {""id"": ""mortality_fish_weight_g"", ""name"": ""Fish Weight (mortality)"", ""units"": ""g"", ""published"": true, ""relations"": [{""id"": ""fish_weight_g"", ""relation"": ""typeOf""}], ""resultType"": ""measurement"", ""description"": ""Weight of dead fish""}}::vertex"	"{""id"": 1125899906842629, ""label"": ""typeOf"", ""end_id"": 844424930131971, ""start_id"": 844424930131975, ""properties"": {}}::edge"
    "{""id"": 844424930131976, ""label"": ""PropertyType"", ""properties"": {""id"": ""sampled_live_fish_weight_g"", ""name"": ""Fish Weight (sampled)"", ""units"": ""g"", ""published"": true, ""relations"": [{""id"": ""fish_weight_g"", ""relation"": ""typeOf""}], ""resultType"": ""measurement"", ""description"": ""Weight of live sampled fish""}}::vertex"	"{""id"": 1125899906842630, ""label"": ""typeOf"", ""end_id"": 844424930131971, ""start_id"": 844424930131976, ""properties"": {}}::edge"
    "{""id"": 844424930131977, ""label"": ""PropertyType"", ""properties"": {""id"": ""morphometric_fish_weight_g"", ""name"": ""Fish Weight (morphometric)"", ""units"": ""g"", ""published"": true, ""relations"": [{""id"": ""fish_weight_g"", ""relation"": ""typeOf""}], ""resultType"": ""measurement"", ""description"": ""Weight of live fish in tank calculated from morphometric imaging""}}::vertex"	"{""id"": 1125899906842631, ""label"": ""typeOf"", ""end_id"": 844424930131971, ""start_id"": 844424930131977, ""properties"": {}}::edge"
    
  16. 12 remaining items

  17. avowkind commented on Apr 10, 2024

    @avowkind
    avowkind
    on Apr 10, 2024 via email
    More actions
    To clarify This [edge:featureOfInterest] is the link between an observation and a feature. Might it be the case that we have an observation that has been lost or deleted somehow without the edge being removed. e.g .if someone did MATCH DELETE without the DETACH? Or is it the feature end that is missing? Thanks Andrew
    …
    On 11 Apr 2024, at 8:41 AM, John Gemignani ***@***.***> wrote: ***@***.***(https://github.com/avowkind) I know why it fails and then works - Technically speaking, it shouldn't work as that error is a fatal error, that's why it fails the first run. However, the context isn't cleaned up, so it works the second run because a context already exists and it doesn't need to build a new one. As to why it is getting an edge that doesn't have a valid start or end id and why that edge it got doesn't exist,... I'm still looking into that. For me, it is failing on an edge found in "featureOfInterest" - (gdb) p {edge_id, edge_vertex_start_id, edge_vertex_end_id} $4 = {3096224744137124, 2533274790715812, 1407374883553780} fishpond=# SELECT * FROM cypher('fishpond', $$MATCH ()-[edge:featureOfInterest]->() where id(edge) > 3096224744137122 and id(edge) < 3096224744137126 RETURN edge ORDER BY id(edge) $$) as (edge agtype); edge ------------------------------------------------------------------------------------------------------------------------------------ ------ {"id": 3096224744137123, "label": "featureOfInterest", "end_id": 1407374883553780, "start_id": 2533274790715811, "properties": {}}: :edge {"id": 3096224744137125, "label": "featureOfInterest", "end_id": 1407374883555256, "start_id": 2533274790715813, "properties": {}}: :edge (2 rows) fishpond=# — Reply to this email directly, [view it on GitHub](#365 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAMFYFLOHEUCESYI3TEYUXDY4WPY3AVCNFSM6AAAAAASIWFLLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGQYDCMRRGU). You are receiving this because you were mentioned.Message ID: ***@***.***>
  18. avowkind commented on Apr 10, 2024

    @avowkind
    avowkind
    on Apr 10, 2024 via email
    More actions
    Using that query I get "{""id"": 3096224744137123, ""label"": ""featureOfInterest"", ""end_id"": 1407374883553780, ""start_id"": 2533274790715811, ""properties"": {}}::edge" "{""id"": 3096224744137124, ""label"": ""featureOfInterest"", ""end_id"": 1407374883553780, ""start_id"": 2533274790715812, ""properties"": {}}::edge" "{""id"": 3096224744137125, ""label"": ""featureOfInterest"", ""end_id"": 1407374883555256, ""start_id"": 2533274790715813, ""properties"": {}}::edge” Using this modified version SELECT * FROM cypher('fishpond', $$ MATCH (o)-[edge:featureOfInterest]->(f) where id(edge) > 3096224744137122 and id(edge) < 3096224744137126 RETURN o, edge, f ORDER BY id(edge) $$) as (o agtype, edge agtype, f agtype); I get only 2 results "{""id"": 2533274790715811, ""label"": ""Observation"", ""properties"": {""id"": ""fde14e35"", ""result"": 6, ""parameters"": {""filename"": ""Class 18 2021 feeding records Nov 21 -.xlsx"", ""sheetname"": ""South pen (mix)""}, ""resultTime"": ""2022-03-20T00:00:00Z"", ""phenomenonTime"": ""2022-03-20T00:00:00Z"", ""observedProperty"": ""mortality_fish_weight_g"", ""featureOfInterest"": ""pfr:nelson:tank:C09""}}::vertex""{""id"": 3096224744137123, ""label"": ""featureOfInterest"", ""end_id"": 1407374883553780, ""start_id"": 2533274790715811, ""properties"": {}}::edge""{""id"": 1407374883553780, ""label"": ""Feature"", ""properties"": {""id"": ""pfr:nelson:tank:C09"", ""name"": ""C09"", ""relations"": [{""id"": ""pfr:nelson:tank_group:C"", ""relation"": ""partOf""}], ""description"": ""C09"", ""featureGroup"": ""pfr:fg:tank""}}::vertex" "{""id"": 2533274790715813, ""label"": ""Observation"", ""properties"": {""id"": ""3de89087"", ""result"": 750, ""parameters"": {""Comments"": ""2mm Japanese and 2.3mm skretting"", ""filename"": ""Class 18 2021 feeding records Nov 21 -.xlsx"", ""food_type"": ""2.3mm EP02 Otohime (g)"", ""sheetname"": ""South pen (mix) (2)""}, ""resultTime"": ""2022-03-25T00:00:00Z"", ""phenomenonTime"": ""2022-03-25T00:00:00Z"", ""observedProperty"": ""fish_food_g"", ""featureOfInterest"": ""pfr:nelson:tank:seapen_south""}}::vertex""{""id"": 3096224744137125, ""label"": ""featureOfInterest"", ""end_id"": 1407374883555256, ""start_id"": 2533274790715813, ""properties"": {}}::edge""{""id"": 1407374883555256, ""label"": ""Feature"", ""properties"": {""id"": ""pfr:nelson:tank:seapen_south"", ""name"": ""Beatrix Bay South"", ""relations"": [{""id"": ""pfr:nelson:tank_group:beatrix_bay"", ""relation"": ""partOf""}], ""description"": ""South Pen"", ""featureGroup"": ""pfr:fg:tank""}}::vertex” So the "{""id"": 3096224744137124, ""label"": ""featureOfInterest"", ""end_id"": 1407374883553780, ""start_id"": 2533274790715812, ""properties"": {}}::edge”. Is the problem one. Checking the start ID It does not exist. select * from cypher('fishpond', $$ MATCH (o) WHERE id(o) = 2533274790715812 RETURN o $$) as (o agtype); While changing the id to 811 or 813 we get a result. So we have a single observation record that is missing and a dangling edge. Deleting the edge SELECT * FROM cypher('fishpond', $$ MATCH ()-[edge:featureOfInterest]->() where id(edge) = 3096224744137124 DELETE edge RETURN edge ORDER BY id(edge) $$) as (edge agtype); However I think there must be multiple examples of these deleted observations that have dangling edges. What would a cypher query look like to find them? Thanks Andrew
    …
    On 11 Apr 2024, at 10:45 AM, Andrew Watkins ***@***.***> wrote: To clarify This [edge:featureOfInterest] is the link between an observation and a feature. Might it be the case that we have an observation that has been lost or deleted somehow without the edge being removed. e.g .if someone did MATCH DELETE without the DETACH? Or is it the feature end that is missing? Thanks Andrew > On 11 Apr 2024, at 8:41 AM, John Gemignani ***@***.***> wrote: > > ***@***.***(https://github.com/avowkind) I know why it fails and then works - > > Technically speaking, it shouldn't work as that error is a fatal error, that's why it fails the first run. However, the context isn't cleaned up, so it works the second run because a context already exists and it doesn't need to build a new one. As to why it is getting an edge that doesn't have a valid start or end id and why that edge it got doesn't exist,... I'm still looking into that. > > For me, it is failing on an edge found in "featureOfInterest" - > > (gdb) p {edge_id, edge_vertex_start_id, edge_vertex_end_id} > $4 = {3096224744137124, 2533274790715812, 1407374883553780} > > fishpond=# SELECT * FROM cypher('fishpond', $$MATCH ()-[edge:featureOfInterest]->() where id(edge) > 3096224744137122 and id(edge) < 3096224744137126 RETURN edge ORDER BY id(edge) $$) as (edge agtype); > edge > > ------------------------------------------------------------------------------------------------------------------------------------ > ------ > {"id": 3096224744137123, "label": "featureOfInterest", "end_id": 1407374883553780, "start_id": 2533274790715811, "properties": {}}: > :edge > {"id": 3096224744137125, "label": "featureOfInterest", "end_id": 1407374883555256, "start_id": 2533274790715813, "properties": {}}: > :edge > (2 rows) > > fishpond=# > > — > Reply to this email directly, [view it on GitHub](#365 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAMFYFLOHEUCESYI3TEYUXDY4WPY3AVCNFSM6AAAAAASIWFLLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGQYDCMRRGU). > You are receiving this because you were mentioned.Message ID: ***@***.***>
  19. jrgemignani commented on Apr 10, 2024

    @jrgemignani
    jrgemignani
    on Apr 10, 2024
    Contributor
    More actions

    @avowkind The odd thing is that, at least for me, the edge does not exist when I do a select. Yet, the load logic clearly gets that edge, which doesn't seem to exist. This is a weird case for sure.

  20. jrgemignani commented on Apr 10, 2024

    @jrgemignani
    jrgemignani
    on Apr 10, 2024
    Contributor
    More actions

    Only the end vertex for the edge exists.

    fishpond=# SELECT * FROM cypher('fishpond', $$ MATCH (u) WHERE id(u) = 2533274790715812 RETURN u $$) as (u agtype);
     u
    ---
    (0 rows)
    
    fishpond=# SELECT * FROM cypher('fishpond', $$ MATCH (u) WHERE id(u) = 1407374883553780 RETURN u $$) as (u agtype);
                                                                                                                           u
    
    ------------------------------------------------------------------------------------------------------------------------------------
    -----------------------------------------------------------------------------------------------------------
     {"id": 1407374883553780, "label": "Feature", "properties": {"id": "pfr:nelson:tank:C09", "name": "C09", "relations": [{"id": "pfr:n
    elson:tank_group:C", "relation": "partOf"}], "description": "C09", "featureGroup": "pfr:fg:tank"}}::vertex
    (1 row)
    
    fishpond=#
    
  21. avowkind commented on Apr 10, 2024

    @avowkind
    avowkind
    on Apr 10, 2024 via email
    More actions
    This query SELECT * FROM cypher('fishpond', $$ MATCH ()-[edge:featureOfInterest]->() where id(edge) = 3377699720847780 RETURN edge ORDER BY id(edge) $$) as (edge agtype); Returns null But this SELECT * FROM fishpond._ag_label_edge e WHERE id::text = '3377699720847780’; Return s "3377699720847780""2533274790715812""2251799813685250""{}" Where vertex 2533274790715812 does not exist. So the above delete also doesn’t work. Here is SQL to list dangling edges SELECT e.* FROM fishpond._ag_label_edge e LEFT JOIN fishpond._ag_label_vertex v ON e.start_id = v.id WHERE v.id IS NULL; Let me know if you think this is right. - I get one result - the known issue. So I then run DELETE FROM fishpond._ag_label_edge e WHERE id::text = '3377699720847780’; Removing the line from the edge table. And this fixes everything. The VLE search now runs ok. So to sum up. We have a dangling edge in ._ag_label_edge where the start_id does not exist or was somehow removed from the vertices table. The check for dangling edges is Here is SQL to list dangling edges SELECT e.* FROM fishpond._ag_label_edge e LEFT JOIN fishpond._ag_label_vertex v ON e.start_id = v.id WHERE v.id IS NULL; And then you can delete an edge using DELETE FROM fishpond._ag_label_edge e WHERE id::text = '{id}' I had to cast the id from a graphID. The underlying question is whether a query of the form MATCH. x pattern DELETE x Without the DETACH leaves dangling edges by design. Thanks Andrew
    …
    On 11 Apr 2024, at 11:36 AM, John Gemignani ***@***.***> wrote: Only the end vertex for the edge exists. fishpond=# SELECT * FROM cypher('fishpond', $$ MATCH (u) WHERE id(u) = 2533274790715812 RETURN u $$) as (u agtype); u --- (0 rows) fishpond=# SELECT * FROM cypher('fishpond', $$ MATCH (u) WHERE id(u) = 1407374883553780 RETURN u $$) as (u agtype); u ------------------------------------------------------------------------------------------------------------------------------------ ----------------------------------------------------------------------------------------------------------- {"id": 1407374883553780, "label": "Feature", "properties": {"id": "pfr:nelson:tank:C09", "name": "C09", "relations": [{"id": "pfr:n elson:tank_group:C", "relation": "partOf"}], "description": "C09", "featureGroup": "pfr:fg:tank"}}::vertex (1 row) fishpond=# — Reply to this email directly, [view it on GitHub](#365 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAMFYFMAUKHHYSA7LOBBMFLY4XEGHAVCNFSM6AAAAAASIWFLLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGYYDENJZGQ). You are receiving this because you were mentioned.Message ID: ***@***.***>
    Reacted by John Gemignani
  22. jrgemignani commented on Apr 11, 2024

    @jrgemignani
    jrgemignani
    on Apr 11, 2024
    Contributor
    More actions

    @avowkind Yeah, the VLE goes on the assumption that everything is set up correctly, meaning every edge that exists has vertices that exist. If it comes across issues, it just quits because it might be a data corruption issue.

    I'm going to put a PR together to have the VLE highlight these cases when the VLE loads. This way a user can find them. I will also fix it so that it just gives warning messages and continues.

    Thoughts?

  23. avowkind commented on Apr 11, 2024

    @avowkind
    avowkind
    on Apr 11, 2024 via email
    More actions
    Thanks - this was a good debug experience. I think my key underlying question is about whether it’s possible to create a dangling edge via cypher queries alone? If not we would have to look at whether the vertex got deleted by some other route or something happened during creation. Also given that the request was for VLE for paths like this SELECT * FROM cypher('fishpond', $$ MATCH (p:PropertyType)<-[edge:typeOf*0..]-(node:PropertyType) WHERE p.id = 'fish_weight_g' RETURN node, edge $$) as ( node agtype, edge agtype); I wonder that we went anywhere near edges that link to observations. While there are only a few 100 items in the property graph and a few 1000 in the feature graph there will be millions in the observation graph. Thanks Andrew
    …
    On 11 Apr 2024, at 12:13 PM, John Gemignani ***@***.***> wrote: ***@***.***(https://github.com/avowkind) Yeah, the VLE goes on the assumption that everything is set up correctly, meaning every edge that exists has vertices that exist. If it comes across issues, it just quits because it might be a data corruption issue. I'm going to put a PR together to have the VLE highlight these cases when the VLE loads. This way a user can find them. I will also fix it so that it just gives warning messages and continues. Thoughts? — Reply to this email directly, [view it on GitHub](#365 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAMFYFKZAQP2N55C4YTWPHTY4XITRAVCNFSM6AAAAAASIWFLLGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBYGYZTCMRQGU). You are receiving this because you were mentioned.Message ID: ***@***.***>
  24. jrgemignani commented on Apr 11, 2024

    @jrgemignani
    jrgemignani
    on Apr 11, 2024
    Contributor
    More actions

    Thanks - this was a good debug experience.

    Yes, it was :)

    I wonder that we went anywhere near edges that link to observations.

    This has to do with how the VLE load and context system works. In the beginning, I tried to limit what it loaded. However, that ended up requiring more contexts, more reloads, and more complexity. So, I opted for just loading everything which meant a bigger context, but only one per graph and fewer loads.

    The big difference with the VLE is that it has a graph representation, not tables. This allows graph algorithms to work more directly with it.

  25. jrgemignani commented on Apr 11, 2024

    @jrgemignani
    jrgemignani
    on Apr 11, 2024
    Contributor
    More actions

    @avowkind I have modified the VLE to help identify these "dangling" edges -

    fishpond=# load 'age'; set search_path TO ag_catalog;
    LOAD
    SET
    fishpond=# SELECT * FROM cypher('fishpond', $$
    MATCH (p:PropertyType)<-[edge:typeOf*0..]-(node:PropertyType)
    WHERE p.id = 'fish_weight_g'
    RETURN node, edge
    $$) as ( node agtype, edge agtype);
    WARNING:  edge: [id: 3096224744137124, start: 2533274790715812, end: 1407374883553780, label: featureOfInterest] missing start vertex
    WARNING:  ignored dangling edge
    WARNING:  edge: [id: 3377699720847780, start: 2533274790715812, end: 2251799813685250, label: in] missing start vertex
    WARNING:  ignored dangling edge
    

    The remainder of the output was left out. But, the query will run with this modification.

    I may change some of the wording before it goes to a PR.

  26. jrgemignani commented on Apr 11, 2024

    @jrgemignani
    jrgemignani
    on Apr 11, 2024
    Contributor
    More actions

    @avowkind I have a PR for the master branch #1742 that will add in the new messaging and ignore these errors in the VLE. I will try to get it to the other branches by later today so that you can try it out.

  27. jrgemignani commented on Apr 12, 2024

    @jrgemignani
    jrgemignani
    on Apr 12, 2024
    Contributor
    More actions

    @avowkind There is also a PR for PG15 #1744 that should be merged and available shortly. Then you will be able to test it out.

  28. jrgemignani commented on Apr 12, 2024

    @jrgemignani
    jrgemignani
    on Apr 12, 2024
    Contributor
    More actions

    @avowkind PG15 should have a docker build that is updated now.

  29. jrgemignani commented on Apr 12, 2024

    @jrgemignani
    jrgemignani
    on Apr 12, 2024
    Contributor
    More actions

    @avowkind All supported branches are now updated. As this is now understood and resolved, I will close the ticket.

  30. jrgemignani
    closed this as completedon Apr 12, 2024
  31. ToLboo commented on Dec 22, 2024

    @ToLboo
    ToLboo
    on Dec 22, 2024
    More actions

    @jrgemignani Hello, I am experiencing a similar issue. Whenever I run the following query:

    SELECT * FROM cypher('multi_in_1_graph', $$ MATCH (cs:CLOSED_SHELL {id: 32722, file_name: "Jaguar_E_Type_roadster"})-[*1..3]->(el:EDGE_LOOP) RETURN el.id AS id, el $$) AS (id integer, el agtype);

    It always throws the following error on the first execution:

    `ERROR: could not open relation with OID 0

    SQL state: XX000`

    Subsequent executions do not throw this error but always return empty results. However, when I run this query:

    SELECT * FROM cypher('multi_in_1_graph', $$ MATCH (cs:CLOSED_SHELL {id: 32722, file_name: "Jaguar_E_Type_roadster"})-[]->()-[]->()-[]->(el:EDGE_LOOP) RETURN el.id AS id, el $$) AS (id integer, el agtype);

    It successfully retrieves valid results.

    Could you please help me understand why this is happening and how to resolve the issue?

    Reacted by Tobi Akomolede AKA Mocuto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.