actionml / harness

Harness is a Machine Learning/AI Server with plugins for many algorithms including the Universal Recommender
Apache License 2.0
283 stars 49 forks source link

500 Internal Server Error with query contains "@" in user value #280

Closed lutek closed 3 years ago

lutek commented 3 years ago

In test i'm using user entityId in format: m+someID@test.pl

Have events with this user (with primary indicator), i have items and trained model.

With query: { "user": "m+63265@test.pl" } without + works well.

Got error:

harness          | 21:43:03.426 INFO  ActorSystemImpl   - Harness Server: HttpRequest(HttpMethod(POST),http://harness:9090/engines/fw_ur/queries,List(Host: harness:9090, User-Agent: GuzzleHttp/6.5.5 curl/7.58.0 PHP/7.2.33-1+ubuntu18.04.1+deb.sury.org+1, Accept-Encoding: gzip, Timeout-Access: <function1>),HttpEntity.Strict(application/json,{"user":"m+63265@test.pl"}),HttpProtocol(HTTP/1.1))
harness          | 21:43:03.429 INFO  URAlgorithm       - Engine-id: fw_ur. Got query:
harness          | URQuery(Some(m+63265@test.pl),None,None,None,None,None,None,None,None,None,None,None,None,None,None)
harness          | 21:43:03.441 ERROR ActorSystemImpl   - Internal error
harness          | java.util.NoSuchElementException: None.get
harness          |  at scala.None$.get(Option.scala:347)
harness          |  at scala.None$.get(Option.scala:345)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29$$anonfun$29$$anonfun$apply$32.apply(URAlgorithm.scala:538)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29$$anonfun$29$$anonfun$apply$32.apply(URAlgorithm.scala:538)
harness          |  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
harness          |  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
harness          |  at scala.collection.immutable.List.foreach(List.scala:392)
harness          |  at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
harness          |  at scala.collection.immutable.List.map(List.scala:296)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29$$anonfun$29.apply(URAlgorithm.scala:538)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29$$anonfun$29.apply(URAlgorithm.scala:537)
harness          |  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
harness          |  at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
harness          |  at scala.collection.immutable.List.foreach(List.scala:392)
harness          |  at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
harness          |  at scala.collection.immutable.List.map(List.scala:296)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29.apply(URAlgorithm.scala:537)
harness          |  at com.actionml.engines.ur.URAlgorithm$$anonfun$getUserHistMatcher$2$$anonfun$apply$29.apply(URAlgorithm.scala:511)
harness          |  at scala.util.Success$$anonfun$map$1.apply(Try.scala:237)
harness          |  at scala.util.Try$.apply(Try.scala:192)
harness          |  at scala.util.Success.map(Try.scala:237)
harness          |  at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237)
harness          |  at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:237)
harness          |  at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:36)
harness          |  at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
harness          |  at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
harness          |  at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
harness          |  at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
harness          |  at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
harness          |  at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
harness          |  at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
harness          |  at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
harness          |  at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
harness          |  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
harness          |  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
harness          |  at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
lutek commented 3 years ago

I did another test (deleted engind, created new, new import, new train), with the user I deleted the "+", there was the same error. I changed the user id to '223' and the bug was no longer present. Is it possible that the '@' character generates this error?

lutek commented 3 years ago

I have found the cause of the error. There was a null value in some targetEntityId events