Class 'OUSER' was not found in current database

503 views
Skip to first unread message

Tommy

unread,
May 22, 2014, 4:08:04 PM5/22/14
to orient-...@googlegroups.com
Somehow I got a test database into a state where the "OUser" class is missing.  Luckily there is nothing I care about in the db, but it got me thinking about how I can defend against this in the field.  Can I still get data out if there are no users?  Can I add users back in?  How are essential OrientDb classes protected against accidental deletes?

This is the error I see when trying to log into Orient Studio:

--> com.orientechnologies.orient.core.exception.OCommandExecutionException: Class 'OUSER' was not found in current database [ONetworkProtocolHttpDb]
2014-05-22 15:17:38:424 SEVE Internal server error: com.orientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #6: Error on parsing query
Query:  OUser where name = 'admin' limit 1
-----------^

And this is the error I see when trying to write to the database in my Java code:

Error on parsing query at position #6: Error on parsing query
Query:  OUser where name = 'admin' limit 1
-----------^
    com.orientechnologies.orient.core.sql.filter.OSQLTarget.<init>(OSQLTarget.java:70)
    com.orientechnologies.orient.core.sql.OSQLEngine.parseTarget(OSQLEngine.java:330)
    com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:109)
    com.orientechnologies.orient.core.sql.OCommandExecutorSQLSelect.parse(OCommandExecutorSQLSelect.java:65)
    com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:49)
    com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.parse(OCommandExecutorSQLDelegate.java:33)
    com.orientechnologies.orient.core.storage.OStorageEmbedded.command(OStorageEmbedded.java:83)
    com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:69)
    com.orientechnologies.orient.core.sql.query.OSQLSynchQuery.run(OSQLSynchQuery.java:82)
    com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:29)
    com.orientechnologies.orient.core.metadata.security.OSecurityShared.getUser(OSecurityShared.java:179)
    com.orientechnologies.orient.core.metadata.security.OSecurityShared.authenticate(OSecurityShared.java:148)
    com.orientechnologies.orient.core.metadata.security.OSecurityProxy.authenticate(OSecurityProxy.java:83)
    com.orientechnologies.orient.core.db.record.ODatabaseRecordAbstract.open(ODatabaseRecordAbstract.java:166)
    com.orientechnologies.orient.core.db.ODatabaseWrapperAbstract.open(ODatabaseWrapperAbstract.java:54)
    com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.openOrCreate(OrientBaseGraph.java:878)
    com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.<init>(OrientBaseGraph.java:134)
    com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:58)
    com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.<init>(OrientTransactionalGraph.java:54)
    com.tinkerpop.blueprints.impls.orient.OrientGraph.<init>(OrientGraph.java:34)
    ...

Andrey Lomakin

unread,
May 23, 2014, 4:38:57 AM5/23/14
to orient-database
Hi, 
What version do you use, which storage type do you use ?

Any way you can do following.

Put database into the server, logging as root,  put new users in database.



--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Tommy

unread,
May 23, 2014, 10:30:17 AM5/23/14
to orient-...@googlegroups.com
We are using 1.7-rc1.  The database using plocal storage and is running in a OServer in a Java process.  We believe the database got into this state because a developer was constantly terminating the Java process at startup while testing something else (unrelated to OrientDb) in our code base.

I can put the database in a server and log into the server as root in the console.  But I do not see a way to add users to my database without logging into a database.  What command should I be using?

Luca Garulli

unread,
May 23, 2014, 11:09:42 AM5/23/14
to orient-database
Hi Tommy,
login into the database as root and the password you find in your $ORIENTDB_HOME/config/orientdb-server-config.xml file. Then:

insert into OUser set name = 'admin', password = 'admin', status = 'ACTIVE', roles = (select from ORole where name = 'admin')

Lvc@

Luca Garulli

unread,
May 23, 2014, 11:28:02 AM5/23/14
to orient-database

Tommy

unread,
May 23, 2014, 11:34:44 AM5/23/14
to orient-...@googlegroups.com
Thank you for the link, but unfortunately I tried that and I get a similar error to the one I get before:
 
orientdb> connect remote:localhost/SystemDb root 295F75C29359FF358DD567ABB518E484B2E8507A6DD76665D5300B1117F51883
Connecting to database [remote:localhost/SystemDb] with user 'root'...
Error: com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing.
Error: com.orientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #6: Error on parsing query
Query:  OUser where name = 'root' limit 1
-----------^
Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Class 'OUSER' was not found in current database
orientdb {null}>

 I cannot do anything with the "orientdb {null}>" prompt.  I just get the an exception with the message "Database 'null' is closed".  The root/password combo appear to be correct because I have no trouble logging into the server.  

Luca Garulli

unread,
May 23, 2014, 11:35:50 AM5/23/14
to orient-database
Can you try the same from Studio?

Tommy

unread,
May 23, 2014, 11:46:57 AM5/23/14
to orient-...@googlegroups.com
I tried Studio and cannot get past the login screen.

 I also tried deleting the "OUser" class on the demo GratefulDeadConserts database to determine if my database is corrupted.  I get the same error with the GratefulDeadConcerts database.  My steps for that are below:

orientdb {remote:localhost/}> connect remote:localhost/GratefulDeadConcerts root 295F75C29359FF358DD567ABB518E484B2E8507A6DD76665D5300B1117F51883
Disconnecting from remote server [remote:localhost/]...
OKConnecting to database [remote:localhost/GratefulDeadConcerts] with user 'root'...OK
orientdb {GratefulDeadConcerts}> drop class OUser
Removed class in 0.166000 sec(s).
orientdb {GratefulDeadConcerts}> connect remote:localhost root 295F75C29359FF358DD567ABB518E484B2E8507A6DD76665D5300B1117F51883
Disconnecting from the database [GratefulDeadConcerts]...
OKConnecting to remote Server instance [remote:localhost] with user 'root'...OK
orientdb {remote:localhost/}> connect remote:localhost/GratefulDeadConcerts root 295F75C29359FF358DD567ABB518E484B2E8507A6DD76665D5300B1117F51883
Disconnecting from remote server [remote:localhost/]...
OKConnecting to database [remote:localhost/GratefulDeadConcerts] with user 'root'...

Error: com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during responseprocessing.
Error: com.orientechnologies.orient.core.exception.OQueryParsingException: Error on parsing query at position #6: Error on parsing query
Query:  OUser where name = 'root' limit 1
-----------^
Error: com.orientechnologies.orient.core.exception.OCommandExecutionException: Class 'OUSER' was not found in currentdatabase
orientdb {null}>

It looks like the documentation no longer applies.  I am worried about how easy it is to delete the OUser class and potentially brick a database.  Thank you for working with me on this issue.

-Tommy 

Luca Garulli

unread,
May 23, 2014, 1:25:55 PM5/23/14
to orient-database
Hi,

Fix arrives in a few minutes.

Lvc@

Luca Garulli

unread,
May 23, 2014, 1:35:42 PM5/23/14
to orient-database
Fixed. Please retry with last 1.7-SNAPSHOT.

Lvc@

Tommy

unread,
May 23, 2014, 3:21:51 PM5/23/14
to orient-...@googlegroups.com
Thank you! I will have to check it out.
Reply all
Reply to author
Forward
0 new messages