Discussion Forum

About TypeDBClientException

I encountered this error code when I ran the program [TYR03] Invalid Type Read: The type ‘user_id’ does not exist. Please check server logs for the stack trace.

Hi -
that’s not a very useful message. Please provide context of what caused this error, version numbers, schema, etc.

Messages obtained in the server log:
[typedb-service::0] [ERROR] c.v.t.core.server.TransactionService - [TYR03] Invalid Type Read: The type ‘user’ does not exist.
com.vaticle.typedb.core.common.exception.TypeDBException: [TYR03] Invalid Type Read: The type ‘user’ does not exist.
at com.vaticle.typedb.core.common.exception.TypeDBException.of(TypeDBException.java:55)
at com.vaticle.typedb.core.query.Inserter$Operation.getThingType(Inserter.java:211)
at com.vaticle.typedb.core.query.Inserter$Operation.insertIsa(Inserter.java:219)
at com.vaticle.typedb.core.query.Inserter$Operation.insert(Inserter.java:186)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
at com.vaticle.typedb.core.query.Inserter$Operation.execute(Inserter.java:157)
at com.vaticle.typedb.core.query.Inserter.execute(Inserter.java:117)
at com.vaticle.typedb.core.query.QueryManager.insert(QueryManager.java:126)
at com.vaticle.typedb.core.server.query.QueryService.insert(QueryService.java:158)
at com.vaticle.typedb.core.server.query.QueryService.execute(QueryService.java:96)
at com.vaticle.typedb.core.server.TransactionService.executeRequest(TransactionService.java:159)
at com.vaticle.typedb.core.server.TransactionService.execute(TransactionService.java:135)
at com.vaticle.typedb.core.server.TransactionService.onNext(TransactionService.java:115)
at com.vaticle.typedb.core.server.TransactionService.onNext(TransactionService.java:74)
at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onMessage(ServerCalls.java:255)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailableInternal(ServerCallImpl.java:309)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.messagesAvailable(ServerCallImpl.java:292)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1MessagesAvailable.runInContext(ServerImpl.java:782)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

Typedb ver2.1.1
schema:
define

restaurant sub entity,
plays feeback:food,
owns address,
owns name,
owns phone_number;

user sub entity,
plays feeback:provider,
owns user_id;

feeback sub relation,
relates food,
relates provider,
owns comment,
owns star,
owns restaurant_name;
user_id sub attribute,
value string;
comment sub attribute,
value string;
star sub attribute,
value long;
address sub attribute,
value string;
name sub attribute,
value string;
phone_number sub attribute,
value string;
restaurant_name sub attribute,
value string;

I just loaded your schema and no error occurred! Did you make sure you commit after it is is loaded?

The error generated when I run the following program(python)
def user_template(user):
return ‘insert $user isa user, has user_id "’ + user[“user_id”] + ‘";’

I’m sure there is “user” in my profile, but it can’t be read the type “user”
Data sample(csv):
user_id
john
hank

you can do a quick test whether the type is defined by opening up console on the correct database and running a query like:

match $x type user;

or

match $x sub entity;

and check the types that come back!

I use:
match $x sub entity;
The response is:
{$x type entity sub thing;}
{$x type restaurant sub entity;}
{$x type user sub entity;}

can you try just typing a sample insert query that your template generates into the console?