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.52k stars 193 forks source link

Docker image crashes on list-dead-letter-source-queues #1036

Closed BabakBarati closed 1 month ago

BabakBarati commented 1 month ago

I am using ElasticMQ v1.6.6 via Docker. When I try to retrieve list-dead-letter-source-queues, the docker container crashes. To reproduce the bug, use the docker-compose.yml file as follows:

services:
  elasticmq:
    image: softwaremill/elasticmq-native:1.6.6
    container_name: reproduce-bug-elasticmq
    ports:
      - "9324:9324"
      - "9325:9325"
    volumes:
      - "./elasticmq.conf:/opt/elasticmq.conf"

and use a simple elasticmq.conf file as follows:

include classpath("application.conf")

node-address {
    protocol = http
    host = "*"
    port = 9324
    context-path = ""
}

rest-sqs {
    enabled = true
    bind-port = 9324
    bind-hostname = "0.0.0.0"
    sqs-limits = relaxed
}

queues {
    myQueue {
        deadLettersQueue {
            name = "myQueue-dlq"
            maxReceiveCount = 3
        }
    }
    myQueue-dlq { }
}

I use docker v27.1.1 on MacOS. Run docker up: docker compose up -d elasticmq Then try to get the source queues of the dead-letter queue using awscli (I used aws-cli v2.17.28):

aws --endpoint-url=http://localhost:9324 sqs list-dead-letter-source-queues --queue-url=http://localhost:9324/000000000000/myQueue-dlq

Then the container crashes and shuts down. These are the logs of the container during the crash:

reproduce-bug-elasticmq  | Uncaught error from thread [elasticmq-pekko.actor.default-dispatcher-7]: null, shutting down JVM since 'pekko.jvm-exit-on-fatal-error' is enabled for ActorSystem[elasticmq]
reproduce-bug-elasticmq  | java.lang.ExceptionInInitializerError
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.$anonfun$listDeadLetterSourceQueues$1(ListDeadLetterSourceQueuesDirectives.scala:17)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$2(Directive.scala:184)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$Empty$1(Directive.scala:170)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$$anon$1.tapply(Directive.scala:165)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$1(Directive.scala:184)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.listDeadLetterSourceQueues(ListDeadLetterSourceQueuesDirectives.scala:16)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.listDeadLetterSourceQueues$(ListDeadLetterSourceQueuesDirectives.scala:15)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.listDeadLetterSourceQueues(SQSRestServerBuilder.scala:139)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.rawRoutes$1(SQSRestServerBuilder.scala:211)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.$anonfun$start$8(SQSRestServerBuilder.scala:239)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.directives.AnyParamDirectives.$anonfun$anyParamsMap$3(AnyParamDirectives.scala:76)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.util.ApplyConverterInstances$$anon$1.$anonfun$apply$1(ApplyConverterInstances.scala:23)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.ConjunctionMagnet$$anon$2.$anonfun$apply$3(Directive.scala:255)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResult$2(BasicDirectives.scala:80)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.directives.FutureDirectives.$anonfun$onComplete$3(FutureDirectives.scala:47)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$1(FastFuture.scala:45)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:49)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:59)
reproduce-bug-elasticmq  | at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:73)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:110)
reproduce-bug-elasticmq  | at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
reproduce-bug-elasticmq  | at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:110)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.TaskInvocation.run(AbstractDispatcher.scala:59)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$PekkoForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:57)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
reproduce-bug-elasticmq  | at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
reproduce-bug-elasticmq  | at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
reproduce-bug-elasticmq  | Caused by: scala.MatchError: [Ljava.lang.String;@22877a1a (of class [Ljava.lang.String;)
reproduce-bug-elasticmq  | at spray.json.ProductFormatsInstances.jsonFormat3(ProductFormatsInstances.scala:68)
reproduce-bug-elasticmq  | at spray.json.ProductFormatsInstances.jsonFormat3$(ProductFormatsInstances.scala:67)
reproduce-bug-elasticmq  | at spray.json.DefaultJsonProtocol$.jsonFormat3(DefaultJsonProtocol.scala:30)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesActionRequest$.<clinit>(ListDeadLetterSourceQueuesDirectives.scala:38)
reproduce-bug-elasticmq  | ... 33 more
reproduce-bug-elasticmq  | 14:15:22.957 [elasticmq-pekko.actor.default-dispatcher-10] ERROR o.apache.pekko.actor.ActorSystemImpl - Uncaught error from thread [elasticmq-pekko.actor.default-dispatcher-7]: null, shutting down JVM since 'pekko.jvm-exit-on-fatal-error' is enabled for ActorSystem[elasticmq]
reproduce-bug-elasticmq  | java.lang.ExceptionInInitializerError: null
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.$anonfun$listDeadLetterSourceQueues$1(ListDeadLetterSourceQueuesDirectives.scala:17)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$2(Directive.scala:184)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$Empty$1(Directive.scala:170)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$$anon$1.tapply(Directive.scala:165)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.Directive$.$anonfun$addByNameNullaryApply$1(Directive.scala:184)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.listDeadLetterSourceQueues(ListDeadLetterSourceQueuesDirectives.scala:16)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesDirectives.listDeadLetterSourceQueues$(ListDeadLetterSourceQueuesDirectives.scala:15)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder$$anon$1.listDeadLetterSourceQueues(SQSRestServerBuilder.scala:139)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.rawRoutes$1(SQSRestServerBuilder.scala:211)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.TheSQSRestServerBuilder.$anonfun$start$8(SQSRestServerBuilder.scala:239)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.directives.AnyParamDirectives.$anonfun$anyParamsMap$3(AnyParamDirectives.scala:76)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.util.ApplyConverterInstances$$anon$1.$anonfun$apply$1(ApplyConverterInstances.scala:23)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.ConjunctionMagnet$$anon$2.$anonfun$apply$3(Directive.scala:255)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.directives.BasicDirectives.$anonfun$mapRouteResult$2(BasicDirectives.scala:80)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.server.directives.FutureDirectives.$anonfun$onComplete$3(FutureDirectives.scala:47)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$1(FastFuture.scala:45)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:49)
reproduce-bug-elasticmq  | at org.apache.pekko.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:59)
reproduce-bug-elasticmq  | at scala.concurrent.impl.Promise$Transformation.run(Promise.scala:484)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:73)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:110)
reproduce-bug-elasticmq  | at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
reproduce-bug-elasticmq  | at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:94)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:110)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.TaskInvocation.run(AbstractDispatcher.scala:59)
reproduce-bug-elasticmq  | at org.apache.pekko.dispatch.ForkJoinExecutorConfigurator$PekkoForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:57)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
reproduce-bug-elasticmq  | at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
reproduce-bug-elasticmq  | at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
reproduce-bug-elasticmq  | at com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:202)
reproduce-bug-elasticmq  | Caused by: scala.MatchError: [Ljava.lang.String;@22877a1a (of class [Ljava.lang.String;)
reproduce-bug-elasticmq  | at spray.json.ProductFormatsInstances.jsonFormat3(ProductFormatsInstances.scala:68)
reproduce-bug-elasticmq  | at spray.json.ProductFormatsInstances.jsonFormat3$(ProductFormatsInstances.scala:67)
reproduce-bug-elasticmq  | at spray.json.DefaultJsonProtocol$.jsonFormat3(DefaultJsonProtocol.scala:30)
reproduce-bug-elasticmq  | at org.elasticmq.rest.sqs.ListDeadLetterSourceQueuesActionRequest$.<clinit>(ListDeadLetterSourceQueuesDirectives.scala:38)
reproduce-bug-elasticmq  | ... 33 common frames omitted
reproduce-bug-elasticmq  | 14:15:22.957 [Thread-1] INFO  org.elasticmq.server.Main$ - ElasticMQ server stopping ...

Please contact me if you need more information.

micossow commented 1 month ago

Thanks for reporting the issue! The fixed docker image with version v.1.6.7 should be available soon.

BabakBarati commented 1 month ago

Thank you for the quick fix! I tested version 1.6.7 and I confirm it is working now.