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

Deleting a vertex is throwning an ODatabaseException: Invalid type value: null #9651

Open
ghost opened this issue Aug 17, 2021 · 7 comments
Open
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 17, 2021

OrientDB Version: 3.2.0

Java Version: JDK 11

OS: Ubuntu

Expected behavior

Deleting a vertex is throwning an ODatabaseException: Invalid type value: null

Actual behavior

The vertex should just be deleted

Steps to reproduce

orientdb {db=dbName}> delete edge #39:18139
com.orientechnologies.orient.core.exception.ODatabaseException: Invalid type value: null
DB name="dbName"
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:758)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializeValue(ORecordSerializerBinaryV1.java:746)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV1.deserializePartial(ORecordSerializerBinaryV1.java:156)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:102)
at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:2422)
at com.orientechnologies.orient.core.record.impl.ODocument.checkForFields(ODocument.java:3258)
at com.orientechnologies.orient.core.record.impl.ODocument.accessProperty(ODocument.java:3264)
at com.orientechnologies.orient.core.record.impl.ODocumentHelper.getIdentifiableValue(ODocumentHelper.java:808)
at com.orientechnologies.orient.core.record.impl.ODocument.getProperty(ODocument.java:392)
at com.orientechnologies.orient.core.record.impl.OVertexDelegate.detachEdge(OVertexDelegate.java:236)
at com.orientechnologies.orient.core.record.impl.OVertexDelegate.detachIncomingEdge(OVertexDelegate.java:226)
at com.orientechnologies.orient.core.record.impl.OEdgeDelegate.deleteLinks(OEdgeDelegate.java:133)
at com.orientechnologies.orient.core.record.impl.OEdgeDocument.delete(OEdgeDocument.java:60)
at com.orientechnologies.orient.core.record.impl.OEdgeDocument.delete(OEdgeDocument.java:9)
at com.orientechnologies.orient.core.sql.executor.DeleteStep$1.next(DeleteStep.java:35)
at com.orientechnologies.orient.core.sql.executor.CountStep.syncPull(CountStep.java:52)
at com.orientechnologies.orient.core.sql.executor.OSelectExecutionPlan.fetchNext(OSelectExecutionPlan.java:34)
at com.orientechnologies.orient.core.sql.executor.OUpdateExecutionPlan.executeInternal(OUpdateExecutionPlan.java:41)
at com.orientechnologies.orient.core.sql.parser.ODeleteEdgeStatement.execute(ODeleteEdgeStatement.java:57)
at com.orientechnologies.orient.core.sql.parser.ODeleteEdgeStatement.execute(ODeleteEdgeStatement.java:70)
at com.orientechnologies.orient.core.sql.parser.OStatement.execute(OStatement.java:72)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentEmbedded.command(ODatabaseDocumentEmbedded.java:654)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.sqlCommand(OConsoleDatabaseApp.java:3571)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.delete(OConsoleDatabaseApp.java:855)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.orientechnologies.common.console.OConsoleApplication.execute(OConsoleApplication.java:456)
at com.orientechnologies.common.console.OConsoleApplication.executeCommands(OConsoleApplication.java:283)
at com.orientechnologies.common.console.OConsoleApplication.run(OConsoleApplication.java:144)
at com.orientechnologies.orient.console.OConsoleDatabaseApp.main(OConsoleDatabaseApp.java:161)

If I try to performance an update, I get the following:
2021-08-17 17:57:36:412 WARNI {db=dbName} Invalid type index: 95 [OType]
2021-08-17 17:57:36:413 WARNI {db=dbName} Error deserializing record with id #1071:17916 send this data for debugging: AYYBIGluX0F1ZGl0UmVzcG9uc2UMX0F1ZGl0UmVzcG9uc2UMFhBvdXRfTGluaw4WqQMMvwFKzwGeAh0SY0ZRDAEU0QGOAgECggfo8AMBAk62mwIBAqYK4ukFntbyyeVeSGQ5OTNmYTdmLTVhMTItNGY3Zi05M2ZhLTdmNWExMmJmN2Y2N5oCeyJfaWQiOiJkOTkzZmE3Zi01YTEyLTRmN2YtOTNmYS03ZjVhMTJiZjdmNjciLCJkYXRhIjp7InByb0JpbGxOdW1iZXIiOiIxNTYxNzI3MTEifSwicHVibGlzaGVkRm9ybU9pZCI6IjAwYjRlNzMxLTRjMzYtNDdjZC1iNGU3LTMxNGMzNmI3Y2Q3NCJ9EEFyY2hpdmVkRGRvY3VtZW50cy52ZXJzYS5zY2Fuc0Bwcm92aXNpb24uaW+e1vLJ5V4SMTU2MTcyNzExAEAGX2lkSgcIZGF0YTYMIHB1Ymxpc2hlZEZvcm1PaWRKB0hkOTkzZmE3Zi01YTEyLTRmN2YtOTNmYS03ZjVhMTJiZjdmNjcCBxpwcm9CaWxsTnVtYmVyBxIxNTYxNzI3MTFIMDBiNGU3MzEtNGMzNi00N2NkLWI0ZTctMzE0YzM2YjdjZDc0 [ORecordSerializerBinary]
2021-08-17 17:58:50:719 WARNI {db=dbName} Invalid type index: 95 [OType]
2021-08-17 17:58:50:720 WARNI {db=dbName} Error deserializing record with id #1071:17916 send this data for debugging: AYYBIGluX0F1ZGl0UmVzcG9uc2UMX0F1ZGl0UmVzcG9uc2UMFhBvdXRfTGluaw4WqQMMvwFKzwGeAh0SY0ZRDAEU0QGOAgECggfo8AMBAk62mwIBAqYK4ukFntbyyeVeSGQ5OTNmYTdmLTVhMTItNGY3Zi05M2ZhLTdmNWExMmJmN2Y2N5oCeyJfaWQiOiJkOTkzZmE3Zi01YTEyLTRmN2YtOTNmYS03ZjVhMTJiZjdmNjciLCJkYXRhIjp7InByb0JpbGxOdW1iZXIiOiIxNTYxNzI3MTEifSwicHVibGlzaGVkRm9ybU9pZCI6IjAwYjRlNzMxLTRjMzYtNDdjZC1iNGU3LTMxNGMzNmI3Y2Q3NCJ9EEFyY2hpdmVkRGRvY3VtZW50cy52ZXJzYS5zY2Fuc0Bwcm92aXNpb24uaW+e1vLJ5V4SMTU2MTcyNzExAEAGX2lkSgcIZGF0YTYMIHB1Ymxpc2hlZEZvcm1PaWRKB0hkOTkzZmE3Zi01YTEyLTRmN2YtOTNmYS03ZjVhMTJiZjdmNjcCBxpwcm9CaWxsTnVtYmVyBxIxNTYxNzI3MTFIMDBiNGU3MzEtNGMzNi00N2NkLWI0ZTctMzE0YzM2YjdjZDc0 [ORecordSerializerBinary]

@andrii0lomakin
Copy link
Member

Hi @pa-chris , if I am not mistaken you delete vertex as an edge delete edge #39:18139. That is the reason of exception of course. I agree that exception should be more user friendly, but do you have any problems if you use delete vertex command ?

@ghost
Copy link
Author

ghost commented Aug 19, 2021

Hi @Laa , sorry for the late reply. Yes, when I use delete vertex I get the same issue. I had 2 vertexes and 1 edge that fell into this issue.

If I try any select from #.... that would also give me the same stacktrace. Now what was interesting, if I would to do
select @class from #.... I would get the actual class. If I tried
select a from #..., I would get no error, would return an empty attribute. But I know the attribute should have a value. I also tried:
select @type from #..., this blew up with the exception. I wish I could send you this database, but I can't as has production data.

I have also tried to export and import into a different database and this was in the new database. In the imported 2nd database, I am not able to DELETE VERTEX. I can't drop the table either.

@andrii0lomakin
Copy link
Member

Hi @pa-chris , you see nobody else this problem, so this problem is specific to your data. If you create a database with a couple of records so I can reproduce it. It will help a lot to fix the problem.

@andrii0lomakin
Copy link
Member

The problem is in the serialization of data as I can see. Could you create code that puts several records in the database, tries to remove one and as result gets given an exception?

@andrii0lomakin
Copy link
Member

@pa-chris question do you use remote connection during export/import procedure. What if you use an embedded database during import, is an issue still reproducible?

@ghost
Copy link
Author

ghost commented Aug 21, 2021

@Laa I have used a combination of remote and embedded exporting/import. Lately I have switched to only embedded. I have had issues with remote imports failing.

I am not able to recreate this specific issue. I have no idea how it happened. In the database, that I have, I can still insert and deleted nodes and edges.

I am thinking, that I may have actually caused this issue by a specific insert into a table. The field is an embedded that I store a json object. There may have been an invalidate character or something a long that lines. I am going to see if I can figure out which specific record from our event source data that caused it. Just taking wild swings. I will let you know what I found in the next day or two

@andrii0lomakin andrii0lomakin self-assigned this Aug 26, 2021
@andrii0lomakin
Copy link
Member

Hi @pa-chris I am working right now on the new JSON module. If incorrect parsing of JSON file is a root cause of this problem it should solve it. Also tomorrow I am going to push a fix of the issue #9562 .

@tglman tglman added this to the 3.2.x milestone Feb 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants