softwaremill / elasticmq

In-memory message queue with an Amazon SQS-compatible interface. Runs stand-alone or embedded.
https://softwaremill.com/open-source/
Apache License 2.0
2.53k stars 193 forks source link

Exception when running routes spray.json.DeserializationException #946

Closed elopsod closed 8 months ago

elopsod commented 8 months ago

hi start to get error with aws sqs all work as expected

10:59:26.197 [elasticmq-pekko.actor.default-dispatcher-8] ERROR o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Exception when running routes
spray.json.DeserializationException: Expected Array as JsArray, but got "CqMDCJGygdChrrD3ARCU5Z6tBhogCJWrgbjLtKbBARIMhiVq4XwzbumwQEoATgBGiAIl
    at spray.json.package$.deserializationError(package.scala:23)
    at spray.json.ProductFormats.fromField(ProductFormats.scala:63)
    at spray.json.ProductFormats.fromField$(ProductFormats.scala:51)
    at spray.json.DefaultJsonProtocol$.fromField(DefaultJsonProtocol.scala:30)
    at spray.json.ProductFormatsInstances$$anon$7.read(ProductFormatsInstances.scala:198)
    at spray.json.ProductFormatsInstances$$anon$7.read(ProductFormatsInstances.scala:179)
    at spray.json.JsValue.convertTo(JsValue.scala:33)
    at org.elasticmq.rest.sqs.model.RequestPayload$JsonParams.readAs(RequestPayload.scala:29)
    at org.elasticmq.rest.sqs.model.RequestPayload.as(RequestPayload.scala:15)
    at org.elasticmq.rest.sqs.model.RequestPayload.as$(RequestPayload.scala:14)
    at org.elasticmq.rest.sqs.model.RequestPayload$JsonParams.as(RequestPayload.scala:27)
    at org.elasticmq.rest.sqs.SendMessageDirectives.$anonfun$sendMessage$1(SendMessageDirectives.scala:29)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$2(Directive.scala:184)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$Empty$1(Directive.scala:170)
    at org.apache.pekko.http.scaladsl.server.Directive$$anon$1.tapply(Directive.scala:165)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$1(Directive.scala:184)
    at org.elasticmq.rest.sqs.SendMessageDirectives.sendMessage(SendMessageDirectives.scala:28)
    at org.elasticmq.rest.sqs.SendMessageDirectives.sendMessage$(SendMessageDirectives.scala:27)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.sendMessage(SQSRestServerBuilder.scala:145)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.rawRoutes$1(SQSRestServerBuilder.scala:193)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.$anonfun$start$5(SQSRestServerBuilder.scala:235)
    at org.elasticmq.rest.sqs.directives.AnyParamDirectives.$anonfun$anyParamsMap$3(AnyParamDirectives.scala:76)
    at org.apache.pekko.http.scaladsl.server.util.ApplyConverterInstances$$anon$1.$anonfun$apply$1(ApplyConverterInstances.scala:23)
    at org.apache.pekko.http.scaladsl.server.ConjunctionMagnet$$anon$2.$anonfun$apply$3(Directive.scala:255)
    at org.apache.pekko.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResult$2(BasicDirectives.scala:80)
    at org.apache.pekko.http.scaladsl.server.directives.FutureDirectives.$anonfun$onComplete$3(FutureDirectives.scala:47)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$1(FastFuture.scala:45)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:49)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:59)
    at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
    at org.apache.pekko.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:73)
    at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:110)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
    at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:110)
    at org.apache.pekko.dispatch.TaskInvocation.run(AbstractDispatcher.scala:59)
    at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$PekkoForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:57)
    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)
    at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
    at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
10:59:26.202 [elasticmq-pekko.actor.default-dispatcher-8] ERROR o.e.r.s.TheSQSRestServerBuilder$$anon$1 - Exception when running routes
spray.json.DeserializationException: Expected Array as JsArray, but got "CvoBCJGygfjTr7j3ARCU5Z6tBhoXCJWrgdjLtKbBARIBXxizxISIw7umwQEaGwiVq4HYy7SmwQESAV8Ys8SAmMO7psEBKAE4ARobCJWrgdDNtKbBARIBXxiQ1IDYwrumwQEoATgBGhcIlauB0M20psEBEgFfGJDUhODCu6bBARokCJWrg
    at spray.json.package$.deserializationError(package.scala:23)
    at spray.json.ProductFormats.fromField(ProductFormats.scala:63)
    at spray.json.ProductFormats.fromField$(ProductFormats.scala:51)
    at spray.json.DefaultJsonProtocol$.fromField(DefaultJsonProtocol.scala:30)
    at spray.json.ProductFormatsInstances$$anon$7.read(ProductFormatsInstances.scala:198)
    at spray.json.ProductFormatsInstances$$anon$7.read(ProductFormatsInstances.scala:179)
    at spray.json.JsValue.convertTo(JsValue.scala:33)
    at org.elasticmq.rest.sqs.model.RequestPayload$JsonParams.readAs(RequestPayload.scala:29)
    at org.elasticmq.rest.sqs.model.RequestPayload.as(RequestPayload.scala:15)
    at org.elasticmq.rest.sqs.model.RequestPayload.as$(RequestPayload.scala:14)
    at org.elasticmq.rest.sqs.model.RequestPayload$JsonParams.as(RequestPayload.scala:27)
    at org.elasticmq.rest.sqs.SendMessageDirectives.$anonfun$sendMessage$1(SendMessageDirectives.scala:29)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$2(Directive.scala:184)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$Empty$1(Directive.scala:170)
    at org.apache.pekko.http.scaladsl.server.Directive$$anon$1.tapply(Directive.scala:165)
    at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$1(Directive.scala:184)
    at org.elasticmq.rest.sqs.SendMessageDirectives.sendMessage(SendMessageDirectives.scala:28)
    at org.elasticmq.rest.sqs.SendMessageDirectives.sendMessage$(SendMessageDirectives.scala:27)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.sendMessage(SQSRestServerBuilder.scala:145)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.rawRoutes$1(SQSRestServerBuilder.scala:193)
    at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.$anonfun$start$5(SQSRestServerBuilder.scala:235)
    at org.elasticmq.rest.sqs.directives.AnyParamDirectives.$anonfun$anyParamsMap$3(AnyParamDirectives.scala:76)
    at org.apache.pekko.http.scaladsl.server.util.ApplyConverterInstances$$anon$1.$anonfun$apply$1(ApplyConverterInstances.scala:23)
    at org.apache.pekko.http.scaladsl.server.ConjunctionMagnet$$anon$2.$anonfun$apply$3(Directive.scala:255)
    at org.apache.pekko.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResult$2(BasicDirectives.scala:80)
    at org.apache.pekko.http.scaladsl.server.directives.FutureDirectives.$anonfun$onComplete$3(FutureDirectives.scala:47)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$1(FastFuture.scala:45)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:49)
    at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:59)
    at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
    at org.apache.pekko.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:73)
    at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:110)
    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
    at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:110)
    at org.apache.pekko.dispatch.TaskInvocation.run(AbstractDispatcher.scala:59)
    at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$PekkoForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:57)
    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)
    at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
    at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
micossow commented 8 months ago

Thanks for reporting the issue! Fix is going to be released in v1.5.6

elopsod commented 8 months ago

@micossow hi Thank you Will check V1.5.6

elopsod commented 8 months ago

all work as expected many thanks to @micossow