Unable to Deploy a Service to BackendlesPro

Hi,

I’m trying to deploy a sample service to BackendlessPro on backendless.local … once I run:

npm run deploy

I get this error:

16:30:25.330 VFXR < (1): 5729.489ms
16:30:25.332 vJ3U > GET http://backendless.local:9000/CCAE4A70-A292-6B5C-FF22-48B9A8846400/console/data/tables  {"auth-key":"xbwgrynhftptwfmnapdddwtvkjmlsqzqaqgj"}
16:30:25.554 vJ3U < (1): 218.984ms
16:30:25.639 7B0u < (err): 725.584ms
16:30:25.640 Error: Unable to publish model. Backendless encountered an error while handling the request. Error id is B2EF99E5-C87E-58D8-FF4F-1D55D5063700. You can find the error in the bl-server logs
org.hibernate.exception.GenericJDBCException: could not extract ResultSet
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
        at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:154)
        at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1542)
        at org.hibernate.query.Query.getResultList(Query.java:165)
        at com.backendless.datamodel.application.dao.TimerBindingDao.lambda$findByMode$2(TimerBindingDao.java:59)
        at com.backendless.datamodel.dao.JpaContext.execute(JpaContext.java:86)
        at com.backendless.datamodel.dao.JpaContext.executeApp(JpaContext.java:72)
        at com.backendless.datamodel.application.dao.TimerBindingDao.findByMode(TimerBindingDao.java:55)
        at com.backendless.management.servercode.TimerService.startTimers(TimerService.java:87)
        at com.backendless.management.servercode.service.CustomServiceManagement.publishCodeToProduction(CustomServiceManagement.java:234)
        at controllers.ServerCodeModel.publishCode(ServerCodeModel.java:147)
        at router.Routes$$anonfun$routes$1.$anonfun$applyOrElse$1354(Routes.scala:15381)
        at play.core.routing.HandlerInvokerFactory$$anon$8.resultCall(HandlerInvoker.scala:150)
        at play.core.routing.HandlerInvokerFactory$$anon$8.resultCall(HandlerInvoker.scala:149)
        at play.core.routing.HandlerInvokerFactory$JavaActionInvokerFactory$$anon$3$$anon$4$$anon$5.invocation(HandlerInvoker.scala:115)
        at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:119)
        at play.http.DefaultActionCreator$1.call(DefaultActionCreator.java:33)
        at com.backendless.old.security.ValidateApplication.call(ValidateApplication.java:75)
        at com.backendless.old.security.ApplicationExistenceAndUseAction.call(ApplicationExistenceAndUseAction.java:39)
        at com.backendless.old.security.ConsiderApiCallAction.call(ConsiderApiCallAction.java:29)
        at com.backendless.TimeOutAction.call(TimeOutAction.java:28)
        at com.backendless.old.security.SuperScalingAction.lambda$call$0(SuperScalingAction.java:26)
        at com.backendless.services.billing.superscaling.SuperScalingManager.applyWithPolicies(SuperScalingManager.java:45)
        at com.backendless.old.security.SuperScalingAction.call(SuperScalingAction.java:26)
        at com.backendless.ApiCallLimitAction.call(ApiCallLimitAction.java:26)
        at com.backendless.ApiCallAction.call(ApiCallAction.java:15)
        at com.backendless.StaticHttpResponseHeadersAction.call(StaticHttpResponseHeadersAction.java:22)
        at com.backendless.StackOverflowHandlerAction.call(StackOverflowHandlerAction.java:21)
        at com.backendless.CloseEntityManagerAction.call(CloseEntityManagerAction.java:36)
        at com.backendless.CurrentRequestsNumberAction.call(CurrentRequestsNumberAction.java:41)
        at com.backendless.ContextInitAction.call(ContextInitAction.java:21)
        at play.core.j.JavaAction.$anonfun$apply$8(JavaAction.scala:175)
        at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:659)
        at scala.util.Success.$anonfun$map$1(Try.scala:255)
        at scala.util.Success.map(Try.scala:213)
        at scala.concurrent.Future.$anonfun$map$1(Future.scala:292)
        at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:33)
        at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:33)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at play.core.j.HttpExecutionContext.$anonfun$execute$1(HttpExecutionContext.scala:64)
        at play.api.libs.streams.Execution$trampoline$.execute(Execution.scala:70)
        at play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:59)
        at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:72)
        at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete(Promise.scala:372)
        at scala.concurrent.impl.Promise$KeptPromise$Kept.onComplete$(Promise.scala:371)
        at scala.concurrent.impl.Promise$KeptPromise$Successful.onComplete(Promise.scala:379)
        at scala.concurrent.impl.Promise.transform(Promise.scala:33)
        at scala.concurrent.impl.Promise.transform$(Promise.scala:31)
        at scala.concurrent.impl.Promise$KeptPromise$Successful.transform(Promise.scala:379)
        at scala.concurrent.Future.map(Future.scala:292)
        at scala.concurrent.Future.map$(Future.scala:292)
        at scala.concurrent.impl.Promise$KeptPromise$Successful.map(Promise.scala:379)
        at scala.concurrent.Future$.apply(Future.scala:659)
        at play.core.j.JavaAction.apply(JavaAction.scala:176)
        at play.api.mvc.Action.$anonfun$apply$4(Action.scala:82)
        at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307)
        at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56)
        at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48)
        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)
Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet
        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
        at org.hibernate.loader.Loader.getResultSet(Loader.java:2311)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2064)
        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2026)
        at org.hibernate.loader.Loader.doQuery(Loader.java:951)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:352)
        at org.hibernate.loader.Loader.doList(Loader.java:2857)
        at org.hibernate.loader.Loader.doList(Loader.java:2839)
        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2671)
        at org.hibernate.loader.Loader.list(Loader.java:2666)
        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506)
        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1412)
        at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1565)
        at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1533)
        ... 64 more
Caused by: java.sql.SQLException: Incorrect information in file: './CCAE4A70@002dA292@002d6B5C@002dFF22@002d48B9A8846400/Timer.frm'

Query being executed when exception was thrown:
select timerentit0_.id as id1_48_, timerentit0_.enabled as enabled2_48_, timerentit0_.expire as expire3_48_, timerentit0_.frequency as frequenc4_48_, timerentit0_.lang as lang5_48_, timerentit0_.mode as mode6_48_, timerentit0_.model
Name as modelnam7_48_, timerentit0_.nextStartup as nextstar8_48_, timerentit0_.provider as provider9_48_, timerentit0_.startdate as startda10_48_, timerentit0_.startup as startup11_48_, timerentit0_.timername as timerna12_48_, timer
entit0_.type as type13_48_ from Timer timerentit0_ where timerentit0_.mode=2


        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1003)
        at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:122)
        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:57)
        ... 79 more

Looks like this is a problem with access? I’ve tried to make a GET request to the url:
http://backendless.local:9000/CCAE4A70-A292-6B5C-FF22-48B9A8846400/console/data/tables

and I set a header for: “auth-key”=“xbwgrynhftptwfmnapdddwtvkjmlsqzqaqgj”

It returned tables data just fine

Hi Bassam,

Is your Backendless Pro installation properly licensed? I think you got the evaluation key way back.

Regards,
Mark

Yes. I got a new one from our live env. One note though. Inside BL Pro, I can’t find a “coderunner” api key to use in coderunner.json. So, instead, I used “CloudCode API key”. Do you think this might be causing this problem? and why BL Pro doesn’t have that?

I’ve just noticed that in mysql on my local BL Pro, there’s no Timer table? Do you think this might be the problem?

hello @Bassam_Jarad

One note though. Inside BL Pro, I can’t find a “coderunner” api key to use in coderunner.json. So, instead, I used “CloudCode API key”. Do you think this might be causing this problem?

No, it is not a problem

The problem is here:

Caused by: java.sql.SQLException: Incorrect information in file: './CCAE4A70@002dA292@002d6B5C@002dFF22@002d48B9A8846400/Timer.frm'

table timer is corrupted somehow, and I am not sure that there is a way to fix it. The easiest way to recreate the app

Thanks for the tip Sergey. I’ve entered to the Mysql Container:

docker exec -it {container_id} bash

then, logged into mysql and dropped the table “Timer”, then, I recreated it again using this:

create table Timer
(
    id          varchar(100)                                          not null
        primary key,
    timername   varchar(100)                                          not null,
    startdate   datetime                                              null,
    expire      datetime                                              null,
    type        enum ('once', 'daily', 'weekly', 'monthly', 'custom') not null,
    frequency   varchar(1000)                                         null,
    startup     bigint                                                null,
    nextStartup bigint                                                null,
    modelName   varchar(45)                                           not null,
    lang        int                                                   not null,
    mode        int                                                   not null,
    provider    varchar(500)                                          not null,
    enabled     tinyint(1)                                            not null,
    constraint timername_UNIQUE
        unique (timername, modelName, mode)
);

and now it’s working. Then, I’ve tried to deploy my service and everything went exactly like expected. Not sure how the Timers table got corrupted in the first place … but that doesn’t matter now.

Thank you so much for the help.