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

Unable to create edges in the latest 1.4.0 (June 7th, 2013) #1518

Closed
choxnox opened this issue Jun 12, 2013 · 9 comments
Closed

Unable to create edges in the latest 1.4.0 (June 7th, 2013) #1518

choxnox opened this issue Jun 12, 2013 · 9 comments
Assignees
Milestone

Comments

@choxnox
Copy link

choxnox commented Jun 12, 2013

I've installed the latest stable 1.4.0 Snapshot from June 7th, 2013 and I'm not able to create edges to nodes through console nor web interface. I'm using "tinkerpop" database, and the following to create a test edge:

create edge written_by from #9:1 to #9:2

but I'm getting an error saying:

"Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: Class WRITTEN_BY was not found"

even tough the class "written_by" exists. I've tried to create my own database, and adding nodes is working, but trying to add edges fails. If I don't use class name and just try to execute:

create edge from #9:1 to #9:2

I get the error saying:

"Error: java.lang.IllegalArgumentException: Edge label can not be null"

@lvca
Copy link
Member

lvca commented Jun 12, 2013

Probably WRITTEN_BY doesn't extend V ? Can you connect with the console and type:

orientdb> list classes

On create edge specify always the class name, or "E" if you don't care about sub-types.

@ghost ghost assigned lvca Jun 12, 2013
@choxnox
Copy link
Author

choxnox commented Jun 12, 2013

Shouldn't WRITTEN_BY extend E since it's defining edges, and not V as in your question?
I can check in OrientDB Studio that WRITTEN_BY extends E class. As I said, I've tried to define new class which also extends E, but it just doesn't work no matter from where I try to create an edge (console or Studio).

If I type:

create edge E from #9:1 to #9:2

I get:

Error: java.lang.IllegalArgumentException: Edge label can not be null

So in short: when using custom class which extends E, I get: "Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on parsing command at position #0: Class [here goes custom class name] was not found"
When I leave out class name or just put E, I get: "Error: java.lang.IllegalArgumentException: Edge label can not be null"

@choxnox
Copy link
Author

choxnox commented Jun 12, 2013

I've more information now if needed. "Tinkerpop" database that comes with OrientDB has 3 classes extended from class E: followed_by, sung_by, written_by.

If I try to create an edge for class "written_by" I get an error I reported earlier (Class WRITTEN_BY was not found).
However, if I create edges for classes "followed_by" or "sung_by", they're created without any problems.

@choxnox
Copy link
Author

choxnox commented Jun 12, 2013

Ok, it seems I've narrowed the problem. I've just installed OrientDB on one of our test Ubuntu servers, and everything is working OK: creating databases, creating classes extended from either V or E, creating nodes and creating edges.

The original problem is still persistent on my own Windows machine, but I've also noticed another problem which might be related to this one. When I start OrientDB server, I can create a new database (let's say it's name is "ABC"). I can then connect to that database and make changes (add classes, add data). If I shut down the server, and restart it, next time I try to connect to my ABC database I get the following error:

orientdb> connect remote:localhost/abc root ********
Connecting to database [remote:localhost/abc] with user 'root'...
Error: com.orientechnologies.orient.core.exception.OStorageException: Cannot open local storage 'd:/Projects/databases/orientdb/databases/abc' with mode=rw
Error: com.orientechnologies.common.exception.OException: java.io.FileNotFoundException: File: d:\Projects\databases\orientdb\databases\orientdb\databases\abc\default.0.oda
Error: java.io.FileNotFoundException: File: d:\Projects\databases\orientdb\databases\orientdb\databases\abc\default.0.oda
orientdb>

I don't know why but it repeats certain parts of the path when it tries to connect to my new database. My OrientDB installation path is:

d:\Projects\databases\orientdb

and my ABC database is located in:

d:\Projects\databases\orientdb\databases\abc

but server tries to access my database here (which is non-existing location):

d:\Projects\databases\orientdb\databases\orientdb\databases\abc

It seems OrientDB doesn't write the database path correctly when the database is created for the first time which might cause the original issue ("Class [some class] was not found").

@lvca lvca closed this as completed Jun 18, 2013
@choxnox
Copy link
Author

choxnox commented Jun 26, 2013

I don't know why this issue is closed and marked as "Invalid", yet it's behaving same with 1.4.1 version. I've managed to fix issue with wrong path, but issue with creating edges is still persistent.

However, I've some more information regarding this issue. It seems the problem is only with the first created class extended from E because if I try to add another class which extends E, I can successfully create an edge.

So, to make the long story short: create "Users" class which extends V class, and two classes "Friendship" and "Hates" which extend E class. Following happens:

  • if I try to connect 2 users with "Friendship" edge, it's NOT working
  • if I try to connect 2 users with "Hates" edge, it's working

Now, if I delete both "Friendship" and "Hates" classes, and recreate them in the following order: first "Hates", then "Friendship", then I have the following:

  • if I try to connect 2 users with "Hates" edge, it's NOT working
  • if I try to connect 2 users with "Friendship" edge, it's working

I hope this helps.

@lvca lvca reopened this Jun 26, 2013
@lvca
Copy link
Member

lvca commented Jun 26, 2013

I've replicated your case and seems to work with latest snapshot. Please, can you check if it's the same of your?

orientdb> create database local:/temp/databases/issue1518 admin admin local graph
Creating database [local:/temp/databases/issue1518] using the storage type [local]...
Database created successfully.

Current database is: local:/temp/databases/issue1518

orientdb> create class Users extends V

Class created successfully. Total classes in database now: 11

orientdb> create class Friendship extends E

Class created successfully. Total classes in database now: 12

orientdb> create class Hates extends E

Class created successfully. Total classes in database now: 13

orientdb> create vertex Users set name = 'Luca'

Created vertex 'Users#11:0{name:Luca} v0' in 0,010000 sec(s).

orientdb> create vertex Users set name = 'Nobody'

Created vertex 'Users#11:1{name:Nobody} v0' in 0,001000 sec(s).

orientdb> create edge Friendship from #11:0 to #11:1

Created edge '[e[#11:0->#11:1][#11:0-Friendship->#11:1]]' in 0,005000 sec(s).

orientdb> create edge Hates from #11:0 to #11:1

Created edge '[e[#11:0->#11:1][#11:0-Hates->#11:1]]' in 0,002000 sec(s).

orientdb>

@choxnox
Copy link
Author

choxnox commented Jun 26, 2013

With both 1.4.2 and 1.5.0 snapshots I'm having same issue, but even worse: I'm not able to create edges for any class no matter in which order they were created. 1.4.1 is OK, but it's not working with the first created class.

However, by your database path I'd assume you're using Linux based system. As stated before, even 1.4.0 is working OK on Ubuntu, I seem to only have problems on Windows.

@lvca
Copy link
Member

lvca commented Jun 26, 2013

Can you create/work with the database using slashs instead of back-slashes? It could be the reason.

@lvca
Copy link
Member

lvca commented Jul 13, 2013

I'm going to close this issue. If the problem persists with last snapshot please reopen/comment this.

@lvca lvca closed this as completed Jul 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants