orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.72k stars 870 forks source link

(please..)infinite error: java.lang.IllegalArgumentException: COLLATE cannot be null #8906

Closed efenzha closed 2 years ago

efenzha commented 5 years ago

OrientDB Version: orientdb-3.0.18

Java Version: 1.8.0_152

OS: linux

Expected behavior

connect to database without ERROR log

Actual behavior

ERROR log is reported, but can connect to database successfully

Steps to reproduce

  1. create a new database from console.
  2. create a new vertex type from code, and set an index.
  3. connect to this database, then it reports lots of "java.lang.IllegalArgumentException: COLLATE cannot be null" every time.

every time, every time, every time, every time for every Index, even for class OFunction

luigidellaquila commented 5 years ago

Hi @efenzha

Could you please post a SQL script to reproduce it exactly?

Thanks

Luigi

efenzha commented 5 years ago

Hi @luigidellaquila ,

The ERROR is logged when connectiong to database from code: val graph = new OrientGraphNoTx(dbUrl)

How to create a "SQL script" to reproduce it?

luigidellaquila commented 5 years ago

Hi @efenzha

I just need the exact commands you execute in console

Thanks

Luigi

efenzha commented 5 years ago

Hi @luigidellaquila ,

but it has no relation with console, the error is printed when running the code val graph = new OrientGraphNoTx(dbUrl)

Did I misunderstand your meaning?

luigidellaquila commented 5 years ago

Hi @efenzha

OK

how do you create a vertex type if you still did not connect to the db? Are you using the console? Studio? Which is the sequence of commands you are executing?

Java connection? From remote or plocal?

Thanks

Luigi

Luigi

efenzha commented 5 years ago

Hi @luigidellaquila ,

luigidellaquila commented 5 years ago

Hi @efenzha

Thank you very much. So you are using the legacy TinkerPop 2.6 API, is there any specific reason for doing it?

If you have a chance I strongly suggest you to use the MultiModel API https://orientdb.com/docs/3.0.x/java/Java-MultiModel-API.html

(or in case the new TinkerPop 3).

I have to double-check it, but I suspect the problem is due to the usage of the usage of the index APIs and how the legacy API uses them. I'd suggest to replace the API call with a simple SQL statement:

CREATE INDEX EiffelEvent.eventId on EiffelEvent (eventId) UNIQUE

It should solve the problem

Thanks

Luigi

luigidellaquila commented 5 years ago

Oh, and please double-check that the client and server have the exact same version (eg. both 3.0.18), as it could lead to such kind of problems

Thanks

Luigi

efenzha commented 5 years ago

Hi @luigidellaquila ,

No, SQL does not solve this problem.

graph.command(new OCommandSQL("CREATE INDEX EiffelEvent.eventId on EiffelEvent (eventId) UNIQUE")).execute()

The index is created successfully, it is shown from Console.

I checked the client version, it is 3.0.18, same as server.

I am using 2.6 API since I follow orientdb java api examples. Maybe I need to use this multi model api, it sounds better.

This is an example print stack. It complains all classes in this database. 19/06/11 09:11:43 ERROR OIndexManagerRemote: Error on loading of index by configuration: {type:UNIQUE,name:ORole.name,indexVersion:2,indexDefinition:{className:ORole,field:name,keyType:STRING,collate:ci,nullValuesIgnored:false},indexDefinitionClass:com.orientechnologies.orient.core.index.OPropertyIndexDefinition,clusters:[1],algorithm:CELL_BTREE,valueContainerAlgorithm:NONE} java.lang.IllegalArgumentException: COLLATE cannot be null at com.orientechnologies.orient.core.index.OAbstractIndexDefinition.setCollate(OAbstractIndexDefinition.java:47) at com.orientechnologies.orient.core.index.OAbstractIndexDefinition.setCollate(OAbstractIndexDefinition.java:55) at com.orientechnologies.orient.core.index.OPropertyIndexDefinition.serializeFromStream(OPropertyIndexDefinition.java:174) at com.orientechnologies.orient.core.index.OPropertyIndexDefinition.fromStream(OPropertyIndexDefinition.java:139) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.fromStream(ODocumentWrapperNoClass.java:44) at com.orientechnologies.orient.core.index.OIndexAbstract.loadMetadataInternal(OIndexAbstract.java:127) at com.orientechnologies.orient.core.index.OIndexManagerRemote.fromStream(OIndexManagerRemote.java:162) at com.orientechnologies.orient.core.type.ODocumentWrapperNoClass.reload(ODocumentWrapperNoClass.java:66) at com.orientechnologies.orient.core.index.OIndexManagerAbstract.load(OIndexManagerAbstract.java:104) at com.orientechnologies.orient.core.db.document.OSharedContextRemote.load(OSharedContextRemote.java:33) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.loadMetadata(ODatabaseDocumentRemote.java:278) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.initAtFirstOpen(ODatabaseDocumentRemote.java:263) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentRemote.internalOpen(ODatabaseDocumentRemote.java:229) at com.orientechnologies.orient.core.db.OrientDBRemote.open(OrientDBRemote.java:86) at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:898) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:2016) at com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:191) at com.tinkerpop.blueprints.impls.orient.OrientGraphNoTx.<init>(OrientGraphNoTx.java:66)