SeldonIO / seldon-server

Machine Learning Platform and Recommendation Engine built on Kubernetes
https://www.seldon.io/
Apache License 2.0
1.47k stars 300 forks source link

NoTableManagedException #5

Closed vincent-chang closed 9 years ago

vincent-chang commented 9 years ago

After the server started, I visit http://localhost:8080/seldon-server/token?consumer_key=seldonAll&consumer_secret=seldon

The server throw NoTableManagedException

2015-06-19 13:09:34,517 DEBUG http-bio-8080-exec-3 Log4JLogger.debug(58) - QueryCompilation: [filter:DyadicExpression{PrimaryExpression{consumerKey} = ParameterExpression{c}}] [symbols: c type=java.lang.String, this type=io.seldon.api.jdo.Consumer] 2015-06-19 13:09:34,519 DEBUG http-bio-8080-exec-3 Log4JLogger.debug(58) - JDOQL Query : Compiling "SELECT FROM io.seldon.api.jdo.Consumer WHERE consumerKey == c PARAMETERS java.lang.String c" for datastore 2015-06-19 13:09:40,765 WARN http-bio-8080-exec-3 Log4JLogger.warn(106) - Query for candidates of io.seldon.api.jdo.Consumer and subclasses resulted in no possible candidates Persistent class "io.seldon.api.jdo.Consumer" has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class. org.datanucleus.store.rdbms.exceptions.NoTableManagedException: Persistent class "io.seldon.api.jdo.Consumer" has no table in the database, but the operation requires it. Please check the specification of the MetaData for this class. at org.datanucleus.store.rdbms.RDBMSStoreManager.getDatastoreClass(RDBMSStoreManager.java:692) at org.datanucleus.store.rdbms.query.RDBMSQueryUtils.getStatementForCandidates(RDBMSQueryUtils.java:425)

gsunner commented 9 years ago

Hi, could you first check that the schema "api" exists in the MySql instance that the server is connecting to. Then list the tables in that schema so that we can check.

Thanks.

vincent-chang commented 9 years ago

Thank you for your reply very much!!!

I have check the schema "api" is in the MySql.

seldon-schema

I also see seldon has loaded the meta data of api.CONSUMER table when start up.

2015-06-19 22:59:46,286 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Registering class "org.datanucleus.identity.StringId" as not having MetaData. 2015-06-19 22:59:46,317 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Managing Persistence of Class : io.seldon.api.jdo.Token [Table : API.TOKEN, InheritanceStrategy : new-table] 2015-06-19 22:59:46,333 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.TOKEN_KEY" added to internal representation of table. 2015-06-19 22:59:46,333 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.tokenKey] -> Column(s) [API.TOKEN.TOKEN_KEY] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Managing Persistence of Class : io.seldon.api.jdo.Consumer [Table : API.CONSUMER, InheritanceStrategy : new-table] 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.CONSUMER_KEY" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.consumerKey] -> Column(s) [API.CONSUMER.CONSUMER_KEY] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Table API.TOKEN will manage the persistence of the fields for class io.seldon.api.jdo.Token (inheritance strategy="new-table") 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.ACTIVE" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.active] -> Column(s) [API.TOKEN.ACTIVE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.BooleanMapping" (org.datanucleus.store.rdbms.mapping.datastore.BitRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.EXPIRES_IN" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.expires_in] -> Column(s) [API.TOKEN.EXPIRES_IN] using mapping of type "org.datanucleus.store.rdbms.mapping.java.LongMapping" (org.datanucleus.store.rdbms.mapping.datastore.BigIntRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.SCOPE" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.scope] -> Column(s) [API.TOKEN.SCOPE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.TIME" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.time] -> Column(s) [API.TOKEN.TIME] using mapping of type "org.datanucleus.store.rdbms.mapping.java.DateMapping" (org.datanucleus.store.rdbms.mapping.datastore.TimestampRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.TOKEN.TYPE" added to internal representation of table. 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Token.type] -> Column(s) [API.TOKEN.TYPE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,348 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Table/View API.TOKEN has been initialised 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Table API.CONSUMER will manage the persistence of the fields for class io.seldon.api.jdo.Consumer (inheritance strategy="new-table") 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.ACTIVE" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.active] -> Column(s) [API.CONSUMER.ACTIVE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.BooleanMapping" (org.datanucleus.store.rdbms.mapping.datastore.BitRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.CONSUMER_SECRET" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.consumerSecret] -> Column(s) [API.CONSUMER.CONSUMER_SECRET] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.NAME" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.name] -> Column(s) [API.CONSUMER.NAME] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.SCOPE" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.scope] -> Column(s) [API.CONSUMER.SCOPE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.SECURE" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.secure] -> Column(s) [API.CONSUMER.SECURE] using mapping of type "org.datanucleus.store.rdbms.mapping.java.BooleanMapping" (org.datanucleus.store.rdbms.mapping.datastore.BitRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.SHORT_NAME" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.short_name] -> Column(s) [API.CONSUMER.SHORT_NAME] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.TIME" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.time] -> Column(s) [API.CONSUMER.TIME] using mapping of type "org.datanucleus.store.rdbms.mapping.java.DateMapping" (org.datanucleus.store.rdbms.mapping.datastore.TimestampRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column "API.CONSUMER.URL" added to internal representation of table. 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Field [io.seldon.api.jdo.Consumer.url] -> Column(s) [API.CONSUMER.URL] using mapping of type "org.datanucleus.store.rdbms.mapping.java.StringMapping" (org.datanucleus.store.rdbms.mapping.datastore.VarCharRDBMSMapping) 2015-06-19 22:59:46,364 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Table/View API.CONSUMER has been initialised 2015-06-19 22:59:46,395 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - ManagedConnection(non-enlisted) "org.datanucleus.store.rdbms.ConnectionFactoryImpl$ManagedConnectionImpl@5e69e466 [conn=null, commitOnRelease=true, closeOnRelease=true, closeOnTxnEnd=true]" opened with isolation level "serializable" and auto-commit=false 2015-06-19 22:59:46,395 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Schema Transaction started with connection "org.apache.commons.dbcp2.PoolingDataSource$PoolGuardConnectionWrapper@7a1214f6" with isolation "serializable" 2015-06-19 22:59:46,411 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Check of existence of API.TOKEN returned table type of TABLE 2015-06-19 22:59:46,411 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Loading column info for table(s) "token" in Catalog "API", Schema "" 2015-06-19 22:59:46,442 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column info loaded for Catalog "API", Schema "", 1 tables, time = 31 ms 2015-06-19 22:59:46,442 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column info retrieved for table "TOKEN" : 7 columns found 2015-06-19 22:59:46,442 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Check of existence of API.CONSUMER returned table type of TABLE 2015-06-19 22:59:46,442 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Loading column info for table(s) "token, consumer" in Catalog "API", Schema "" 2015-06-19 22:59:46,473 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column info loaded for Catalog "API", Schema "", 2 tables, time = 31 ms 2015-06-19 22:59:46,473 DEBUG localhost-startStop-1 Log4JLogger.debug(58) - Column info retrieved for table "CONSUMER" : 9 columns found

ukclivecox commented 9 years ago

Hi Vincent,

That is strange. How are you starting the server? From inside an IDE or externally. Did you build the WAR for the Seldon server using Maven and deploy inside Tomcat?

Clive

vincent-chang commented 9 years ago

Hi Clive,

I usually start and debug the server from eclipse , but I also try Maven and get the same exception.

seldon001

The registeredClasses is empty in org.datanucleus.enhancer.EnhancementHelper when calling the getMeta method.

The registerClass method in org.datanucleus.enhancer.EnhancementHelper can put the class meta data into registeredClasses .But the registerClass method have not called.

Thank you!

ukclivecox commented 9 years ago

The only thing I can think is the project is not getting Enhanced in JDO. Are you able to create the WAR using MVN and deploy to Tomcat standalone?

vincent-chang commented 9 years ago

The exception is gone, when I use mvn to create the WAR and deploy to Tomcat. Thank you very much!