mukil / pmic

A graph application for mapping sustainability indicators across organizations, organizational units, processes and products.

Home Page:https://purl.org/promut/catalog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Write dmx-pmic plugin as prototype for authoring

mukil opened this issue · comments

commented
commented

So, currently there seems to be a bug in the upcoming 5.2 dmx-platform concerning our application model.

State of affairs so far:

  • We are using a customAssocType for relating instances of type Indicator with instances of type Indicator Category
  • This customAssocType (Categorizes) is of type composite and has the child topic type Weight in Category (Number).
  • Apparently, the platform crashes when there is no value for this "Weight in Category" given with the following error:

Resulting effect and steps to reproduce this issue are described further below in this ticket.

SCHWERWIEGEND: Request "PUT /core/topic/19226" failed. Responding with 500 (Internal Server Error). The original exception/error is:
java.lang.RuntimeException: Fetching and updating topic 19226 failed
        at systems.dmx.core.impl.AccessLayer.updateTopic(AccessLayer.java:205)
        at systems.dmx.core.impl.CoreServiceImpl.updateTopic(CoreServiceImpl.java:138)
        at systems.dmx.webservice.WebservicePlugin.updateTopic(WebservicePlugin.java:132)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:185)
        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)
        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1480)
        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1411)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1360)
        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1350)
        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:339)
        at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:300)
        at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:93)
        at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:50)
        at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:31)
        at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:76)
        at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:49)
        at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.RuntimeException: Updating topic 19226 failed
        at systems.dmx.core.impl.AccessLayer.updateTopic(AccessLayer.java:214)
        at systems.dmx.core.impl.AccessLayer.updateTopic(AccessLayer.java:199)
        ... 53 more
Caused by: java.lang.RuntimeException: Updating topic 19226 failed (typeUri="info.promut.indicator")
        at systems.dmx.core.impl.DMXObjectModelImpl.update(DMXObjectModelImpl.java:430)
        at systems.dmx.core.impl.AccessLayer.updateTopic(AccessLayer.java:212)
        ... 54 more
Caused by: java.lang.RuntimeException: Value integration failed, newValues=TopicModelImpl {
    "id": 19226,
    "uri": "",
    "typeUri": "info.promut.indicator",
    "value": "New Indicator",
    "children": {
        "info.promut.indicator_audience": [{
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_audience",
            "value": "",
            "children": {}
        }],
        "dmx.base.url": [{
            "id": -1,
            "uri": "",
            "typeUri": "dmx.base.url",
            "value": "",
            "children": {}
        }],
        "info.promut.indicator_name": {
            "id": 19221,
            "uri": "",
            "typeUri": "info.promut.indicator_name",
            "value": "New Indicator",
            "children": {}
        },
        "info.promut.set_name": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.set_name",
            "value": "",
            "children": {}
        },
        "info.promut.indicator_objective": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_objective",
            "value": "",
            "children": {}
        },
        "info.promut.measurement_unit": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.measurement_unit",
            "value": "",
            "children": {}
        },
        "info.promut.indicator_category#info.promut.categorizes": [
            {
                "id": 19255,
                "uri": "",
                "typeUri": "info.promut.indicator_category",
                "value": "Testing",
                "children": {}
            },
            {
                "id": 19277,
                "uri": "",
                "typeUri": "info.promut.indicator_category",
                "value": "Another Category",
                "children": {}
            }
        ],
        "info.promut.indicator_usage": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_usage",
            "value": "",
            "children": {}
        },
        "info.promut.data_source": [{
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.data_source",
            "value": "",
            "children": {}
        }],
        "info.promut.indicator_formula": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_formula",
            "value": "",
            "children": {}
        },
        "info.promut.indicator_type": [{
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_type",
            "value": "",
            "children": {}
        }],
        "info.promut.indicator_datasources": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_datasources",
            "value": "",
            "children": {}
        },
        "info.promut.dimension_name": [{
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.dimension_name",
            "value": "",
            "children": {}
        }],
        "info.promut.indicator_background": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_background",
            "value": "",
            "children": {}
        },
        "info.promut.set_version": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.set_version",
            "value": "",
            "children": {}
        },
        "info.promut.system_name": [{
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.system_name",
            "value": "",
            "children": {}
        }],
        "info.promut.indicator_descr": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_descr",
            "value": "",
            "children": {}
        },
        "info.promut.indicator_guidance": {
            "id": -1,
            "uri": "",
            "typeUri": "info.promut.indicator_guidance",
            "value": "",
            "children": {}
        }
    }
}, targetObject=TopicModelImpl {
    "id": 19226,
    "uri": "",
    "typeUri": "info.promut.indicator",
    "value": "New Indicator",
    "children": {
        "info.promut.indicator_category#info.promut.categorizes": [
            {
                "id": 19255,
                "uri": "",
                "typeUri": "info.promut.indicator_category",
                "value": "Testing",
                "children": {},
                "assoc": {
                    "id": 19260,
                    "uri": "",
                    "typeUri": "info.promut.categorizes",
                    "value": "1",
                    "children": {"info.promut.weight_in_category": {
                        "id": 19264,
                        "uri": "",
                        "typeUri": "info.promut.weight_in_category",
                        "value": 1,
                        "children": {},
                        "assoc": {
                            "id": 19269,
                            "uri": "",
                            "typeUri": "dmx.core.composition",
                            "value": "",
                            "children": {},
                            "player1": {
                                "assocId": 19260,
                                "roleTypeUri": "dmx.core.parent"
                            },
                            "player2": {
                                "topicId": 19264,
                                "roleTypeUri": "dmx.core.child"
                            }
                        }
                    }},
                    "player1": {
                        "topicId": 19226,
                        "roleTypeUri": "dmx.core.parent"
                    },
                    "player2": {
                        "topicId": 19255,
                        "roleTypeUri": "dmx.core.child"
                    }
                }
            },
            {
                "id": 19277,
                "uri": "",
                "typeUri": "info.promut.indicator_category",
                "value": "Another Category",
                "children": {"dmx.workspaces.workspace#dmx.workspaces.workspace_assignment": {
                    "id": 2328,
                    "uri": "dmx.workspaces.dmx",
                    "typeUri": "dmx.workspaces.workspace",
                    "value": "DMX",
                    "children": {},
                    "assoc": {
                        "id": 19280,
                        "uri": "",
                        "typeUri": "dmx.workspaces.workspace_assignment",
                        "value": "",
                        "children": {},
                        "player1": {
                            "topicId": 19277,
                            "roleTypeUri": "dmx.core.parent"
                        },
                        "player2": {
                            "topicId": 2328,
                            "roleTypeUri": "dmx.core.child"
                        }
                    }
                }},
                "assoc": {
                    "id": 19282,
                    "uri": "",
                    "typeUri": "info.promut.categorizes",
                    "children": {"dmx.workspaces.workspace#dmx.workspaces.workspace_assignment": {
                        "id": 2328,
                        "uri": "dmx.workspaces.dmx",
                        "typeUri": "dmx.workspaces.workspace",
                        "value": "DMX",
                        "children": {},
                        "assoc": {
                            "id": 19284,
                            "uri": "",
                            "typeUri": "dmx.workspaces.workspace_assignment",
                            "value": "",
                            "children": {},
                            "player1": {
                                "assocId": 19282,
                                "roleTypeUri": "dmx.core.parent"
                            },
                            "player2": {
                                "topicId": 2328,
                                "roleTypeUri": "dmx.core.child"
                            }
                        }
                    }},
                    "player1": {
                        "topicId": 19226,
                        "roleTypeUri": "dmx.core.parent"
                    },
                    "player2": {
                        "topicId": 19277,
                        "roleTypeUri": "dmx.core.child"
                    }
                }
            }
        ],
        "info.promut.indicator_name": {
            "id": 19221,
            "uri": "",
            "typeUri": "info.promut.indicator_name",
            "value": "New Indicator",
            "children": {},
            "assoc": {
                "id": 19229,
                "uri": "",
                "typeUri": "dmx.core.composition",
                "value": "",
                "children": {},
                "player1": {
                    "topicId": 19221,
                    "roleTypeUri": "dmx.core.child"
                },
                "player2": {
                    "topicId": 19226,
                    "roleTypeUri": "dmx.core.parent"
                }
            }
        }
    }
}, compDef=null
        at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:108)
        at systems.dmx.core.impl.DMXObjectModelImpl.update(DMXObjectModelImpl.java:418)
        ... 55 more
Caused by: java.lang.RuntimeException: Updating relating assoc 19282 failed, compDefUri="info.promut.indicator_category#info.promut.categorizes", assoc=AssocModelImpl {
    "id": 19282,
    "uri": "",
    "typeUri": "info.promut.categorizes",
    "children": {"dmx.workspaces.workspace#dmx.workspaces.workspace_assignment": {
        "id": 2328,
        "uri": "dmx.workspaces.dmx",
        "typeUri": "dmx.workspaces.workspace",
        "value": "DMX",
        "children": {},
        "assoc": {
            "id": 19284,
            "uri": "",
            "typeUri": "dmx.workspaces.workspace_assignment",
            "value": "",
            "children": {},
            "player1": {
                "assocId": 19282,
                "roleTypeUri": "dmx.core.parent"
            },
            "player2": {
                "topicId": 2328,
                "roleTypeUri": "dmx.core.child"
            }
        }
    }},
    "player1": {
        "topicId": 19226,
        "roleTypeUri": "dmx.core.parent"
    },
    "player2": {
        "topicId": 19277,
        "roleTypeUri": "dmx.core.child"
    }
}
        at systems.dmx.core.impl.ValueIntegrator.updateRelatingAssoc(ValueIntegrator.java:590)
        at systems.dmx.core.impl.ValueIntegrator.updateAssignmentsMany(ValueIntegrator.java:564)
        at systems.dmx.core.impl.ValueIntegrator.updateAssignments(ValueIntegrator.java:426)
        at systems.dmx.core.impl.ValueIntegrator.unifyComposite(ValueIntegrator.java:317)
        at systems.dmx.core.impl.ValueIntegrator.integrateComposite(ValueIntegrator.java:258)
        at systems.dmx.core.impl.ValueIntegrator.integrate(ValueIntegrator.java:98)
        ... 56 more
Caused by: java.lang.RuntimeException: Updating association 19282 failed (typeUri="info.promut.categorizes")
        at systems.dmx.core.impl.DMXObjectModelImpl.update(DMXObjectModelImpl.java:430)
        at systems.dmx.core.impl.ValueIntegrator.updateRelatingAssoc(ValueIntegrator.java:583)
        ... 61 more
Caused by: java.lang.RuntimeException: Fetching assocs between topics 19226 and 19277 failed, assocTypeUri="info.promut.categorizes", roleTypeUri1="dmx.core.parent", roleTypeUri2="dmx.core.child"
        at systems.dmx.core.impl.AccessLayer.getAssocs(AccessLayer.java:316)
        at systems.dmx.core.impl.AssocModelImpl.duplicateCheck(AssocModelImpl.java:395)
        at systems.dmx.core.impl.AssocModelImpl.postUpdate(AssocModelImpl.java:323)
        at systems.dmx.core.impl.DMXObjectModelImpl.update(DMXObjectModelImpl.java:422)
        ... 62 more
Caused by: java.lang.RuntimeException: Building an AssocModel failed, id=19282, typeUri=info.promut.categorizes
        at systems.dmx.storage.neo4j.Neo4jStorage.buildAssoc(Neo4jStorage.java:975)
        at systems.dmx.storage.neo4j.Neo4jStorage.buildAssocs(Neo4jStorage.java:982)
        at systems.dmx.storage.neo4j.Neo4jStorage.queryAssocIndex(Neo4jStorage.java:826)
        at systems.dmx.storage.neo4j.Neo4jStorage.fetchAssocs(Neo4jStorage.java:252)
        at systems.dmx.core.impl.AccessLayer.getAssocs(AccessLayer.java:314)
        ... 65 more
Caused by: org.neo4j.graphdb.NotFoundException: 'value' property not found for NodeImpl#19282.
        at org.neo4j.kernel.impl.core.Primitive.newPropertyNotFoundException(Primitive.java:184)
        at org.neo4j.kernel.impl.core.Primitive.getProperty(Primitive.java:179)
        at org.neo4j.kernel.impl.core.NodeImpl.getProperty(NodeImpl.java:52)
        at org.neo4j.kernel.impl.core.NodeProxy.getProperty(NodeProxy.java:155)
        at systems.dmx.storage.neo4j.Neo4jStorage.simpleValue(Neo4jStorage.java:1143)
        at systems.dmx.storage.neo4j.Neo4jStorage.buildAssoc(Neo4jStorage.java:970)
        ... 69 more

Apr 15, 2021 11:19:17 AM systems.dmx.core.impl.TransactionFactory$TransactionResourceFilter$2 filter

The result being:

  • Existing indicators (imported programmatically) cannot be opened on a topicmap. A similar error as above is thrown.
  • When trying to create a new "Indicator" instance using the webclient, adding an "Indicator Category" is not possible. The above error is thrown.

Reproduce:

  1. Model two topic types: "Dummy Parent" (Entity) and "Dummy Child" (Text) and set cardinality to "Many".

2.) Create "Custom Value" (Number) topic type and create a new "Custom Assoc Type" (of datatype Composite). Set "Custom Value" as a child of "Custom Assoc Type".

3.) Configure the new "Custom Assoc Type" to be the standard assoc type in between "Dummy Parent" and "Dummy Child".

  1. Try to create an instance of "Dummy Parent" adding one or many "Dummy Child" values. The same error as above should appear.

FYI: @jri

commented

So, just to follow up with a confirmation of a missing "Custom Assoc Type" number value might cause the above mentioned error: When I remove the customAssocType (Categorizes) alltogether from the model, import, display and navigating to related topics works again.

Just a hint: org.neo4j.graphdb.NotFoundException: 'value' property not found for NodeImpl#19282 means that object 19282 has no value stored. In particular even if an assoc has no label, empty string needs to be stored. In the DB every object expects value is there. Otherwise DB is regarded corrupt.

Here 19282 refers to an assoc of type info.promut.categorizes.

Possibly there is a new bug in the value integrator (https://git.dmx.systems/dmx-platform/dmx-platform/-/issues/459).