orientechnologies / orientechnologies/orientdb

NPE when creating vertex with link via studio

Open
#9,503 3 comments 0 reactions 1 assignee View on GitHub

@luigidellaquila is already working on this.

Since Jan 11, 2021.

Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Description

OrientDB Version: orientdb-3.1.6
Java Version: 11.0.5
OS: mac os x (10.15.7, x86_64)

Expected behavior

I want to be able to create a new vertex that has a mandatory link property.

Actual behavior

NPE when saving the new vertex:

Internal server error:

java.lang.NullPointerException
        at com.orientechnologies.orient.core.record.impl.ODocument.validateField(ODocument.java:786)
        at com.orientechnologies.orient.core.record.impl.ODocument.validate(ODocument.java:2625)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.saveInternal(ODatabaseDocumentAbstract.java:1830)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:1802)
        at com.orientechnologies.orient.core.db.document.ODatabaseDocumentAbstract.save(ODatabaseDocumentAbstract.java:135)
        at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2361)
        at com.orientechnologies.orient.core.record.impl.ODocument.save(ODocument.java:2350)
        at com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostDocument.execute(OServerCommandPostDocument.java:54)
        at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:253)
        at com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:811)
        at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:67)

Steps to reproduce

  1. I installed orientDB, edited orientdb.sh (properly set ORIENTDB_DIR und ORIENTDB_USER) and run it with start arg.
  2. I opened studio at http://localhost:2480/ and logged in
  3. I created a new vertex Country with some string properties
  4. I created a new vertex Address with some string properties and a link property called Country pointing to County vertex and with min=1, max=1, mandatory=true and not null = true.
  5. I created a record of Country with all properties filled and noted its RID
  6. I created a record of Address with all properties filled and the Country property set to the before noted RID.

At 6. saving failed with the above exception.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.