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

Detail of model returns "internal_server_error" with java.lang.NullPointerException #271

Open
zajacjakub opened this issue Oct 7, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@zajacjakub
Copy link

Versions
Please fill in all that apply:

  • Convergence Version: 1.0.0-rc.12
  • OS: Alpine Linux v3.14
  • Browser: Chrome, Postman

Describe the Bug
Can't get the detail of the model. It works after the first time the Convergence docker is built and launched, but after some time it starts to return NullPointerException.

The bug first shows in our web app console trying to connect:
ERROR Error: An unknown error has occurred, check the server logs for more details.

The admin interface can't get the models of the domain also:

POST http://localhost:3000/api/rest/domains/convergence/dev/model-query
PAYLOAD: {"query":"SELECT\n                   FROM canvases LIMIT 25\n                   OFFSET 0"}
RESPONSE: {"body":{"error_code":"internal_server_error"},"ok":false}

Using REST API in Postman, I can easily get collection of models inside domain:
GET http://localhost:3000/api/rest/domains/convergence/dev/models
RESPONSE:

{
    "body": [
        {
            "id": "394b8a58-937e-4363-b120-0880041d81c8",
            "collection": "canvases",
            "version": 3935,
            "createdTime": 1664460201437,
            "modifiedTime": 1664478359101
        }
    ],
    "ok": true
}

But Cant get the detail:
GET http://localhost:3000/api/rest/domains/convergence/dev/models/394b8a58-937e-4363-b120-0880041d81c8
RESPONSE:

{
    "body": {
        "error_code": "internal_server_error"
    },
    "ok": false
}

Server log:

18:20:28 ERROR RealtimeModelActor - Unexpected error getting model
java.lang.NullPointerException: null
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.DataValueMapper$.oDocumentToDataValue(DataValueMapper.scala:42) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.$anonfun$oDocumentToObjectValue$1(ObjectValueMapper.scala:53) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.collection.StrictOptimizedMapOps.map(StrictOptimizedMapOps.scala:28) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.StrictOptimizedMapOps.map$(StrictOptimizedMapOps.scala:27) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.map(JavaCollectionWrappers.scala:309) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.oDocumentToObjectValue(ObjectValueMapper.scala:49) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.DataValueMapper$.oDocumentToDataValue(DataValueMapper.scala:43) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.$anonfun$oDocumentToObjectValue$1(ObjectValueMapper.scala:53) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.collection.StrictOptimizedMapOps.map(StrictOptimizedMapOps.scala:28) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.StrictOptimizedMapOps.map$(StrictOptimizedMapOps.scala:27) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.map(JavaCollectionWrappers.scala:309) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.oDocumentToObjectValue(ObjectValueMapper.scala:49) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.DataValueMapper$.oDocumentToDataValue(DataValueMapper.scala:43) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ArrayValueMapper$.$anonfun$oDocumentToArrayValue$1(ArrayValueMapper.scala:43) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.collection.StrictOptimizedIterableOps.map(StrictOptimizedIterableOps.scala:99) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.StrictOptimizedIterableOps.map$(StrictOptimizedIterableOps.scala:86) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.convert.JavaCollectionWrappers$JListWrapper.map(JavaCollectionWrappers.scala:103) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ArrayValueMapper$.oDocumentToArrayValue(ArrayValueMapper.scala:39) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.DataValueMapper$.oDocumentToDataValue(DataValueMapper.scala:44) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.$anonfun$oDocumentToObjectValue$1(ObjectValueMapper.scala:53) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.collection.StrictOptimizedMapOps.map(StrictOptimizedMapOps.scala:28) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.StrictOptimizedMapOps.map$(StrictOptimizedMapOps.scala:27) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.collection.convert.JavaCollectionWrappers$AbstractJMapWrapper.map(JavaCollectionWrappers.scala:309) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$.oDocumentToObjectValue(ObjectValueMapper.scala:49) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.mapper.ObjectValueMapper$ODocumentToObjectValue$.asObjectValue$extension(ObjectValueMapper.scala:41) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore$.com$convergencelabs$convergence$server$backend$datastore$domain$model$ModelStore$$docToModel(ModelStore.scala:370) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$getModel$3(ModelStore.scala:215) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.Option.map(Option.scala:242) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$getModel$2(ModelStore.scala:215) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.util.Success.map(Try.scala:262) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.$anonfun$getModel$1(ModelStore.scala:215) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.$anonfun$withDatabase$3(PooledDatabaseProvider.scala:58) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.util.TryWithResource.tryWithResolvedResource(TryWithResource.scala:50) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.util.TryWithResource.com$convergencelabs$convergence$server$util$TryWithResource$$tryWithResource(TryWithResource.scala:36) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.util.TryWithResource$.apply(TryWithResource.scala:78) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.$anonfun$withDatabase$1(PooledDatabaseProvider.scala:56) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.util.Success.flatMap(Try.scala:258) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.db.PooledDatabaseProvider.withDatabase(PooledDatabaseProvider.scala:55) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.AbstractDatabasePersistence.withDb(AbstractDatabasePersistence.scala:32) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.datastore.domain.model.ModelStore.getModel(ModelStore.scala:212) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelActor.$anonfun$retrieveModel$3(RealtimeModelActor.scala:337) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelActor.$anonfun$retrieveModel$3$adapted(RealtimeModelActor.scala:335) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.util.Success.flatMap(Try.scala:258) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at com.convergencelabs.convergence.server.backend.services.domain.model.RealtimeModelActor.$anonfun$retrieveModel$1(RealtimeModelActor.scala:335) ~[com.convergencelabs.convergence-server-1.0.0-rc.12.jar:1.0.0-rc.12]
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:672) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:431) ~[org.scala-lang.scala-library-2.13.5.jar:?]
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:63) ~[com.typesafe.akka.akka-actor_2.13-2.6.15.jar:2.6.15]
        at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:100) ~[com.typesafe.akka.akka-actor_2.13-2.6.15.jar:2.6.15]
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18) [org.scala-lang.scala-library-2.13.5.jar:?]
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94) [org.scala-lang.scala-library-2.13.5.jar:?]
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:100) [com.typesafe.akka.akka-actor_2.13-2.6.15.jar:2.6.15]
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49) [com.typesafe.akka.akka-actor_2.13-2.6.15.jar:2.6.15]
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) [com.typesafe.akka.akka-actor_2.13-2.6.15.jar:2.6.15]
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) [?:?]
        at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) [?:?]
        at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) [?:?]
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) [?:?]
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]

Step To Reproduce
I apologize for the poor reproduction description. I am still trying to figure out what exactly causes this bug.

1.) Run docker and create container based on image convergencelabs/convergence-omnibus.
2.) Use it freely and without bugs.
3.) Some next time you will run the docker image, the errors starts to show.

Expected Behavior
Not resulting in Server error and returning the detail of model.

@zajacjakub zajacjakub added the bug Something isn't working label Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant