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

"scala.MatchError: application/xml" when using alpakka-s3 #1222

Closed
vvlevykin opened this Issue Jun 21, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@vvlevykin

vvlevykin commented Jun 21, 2017

Versions:

  • Akka: 2.5.3
  • Akka-HTTP: 10.0.8
  • Alpakka-s3: 0.9

I'm trying to upload a stream using alpakka-s3 and getting an error:

scala.MatchError: application/xml (of class akka.http.scaladsl.model.ContentType$WithMissingCharset)
        at akka.http.scaladsl.model.ContentTypeRange.matches(ContentType.scala:17)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$.$anonfun$forContentTypes$4(Unmarshaller.scala:112)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$.$anonfun$forContentTypes$4$adapted(Unmarshaller.scala:112)
        at scala.collection.IndexedSeqOptimized.prefixLengthImpl(IndexedSeqOptimized.scala:37)
        at scala.collection.IndexedSeqOptimized.exists(IndexedSeqOptimized.scala:45)
        at scala.collection.IndexedSeqOptimized.exists$(IndexedSeqOptimized.scala:45)
        at scala.collection.mutable.WrappedArray.exists(WrappedArray.scala:38)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$.$anonfun$forContentTypes$3(Unmarshaller.scala:112)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedUnmarshaller$.$anonfun$mapWithInput$3(Unmarshaller.scala:91)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58)
        at akka.http.scaladsl.unmarshalling.Unmarshaller.$anonfun$transform$3(Unmarshaller.scala:23)
        at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58)
        at akka.http.scaladsl.unmarshalling.Unmarshal.to(Unmarshal.scala:25)
        at akka.stream.alpakka.s3.impl.S3Stream.$anonfun$signAndGetAs$2(S3Stream.scala:242)
        at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:302)
        at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
        at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:38)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)
        at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

There is no error with Akka-HTTP <10.0.8.

@jypma

This comment has been minimized.

Show comment
Hide comment
@jypma

jypma Jun 21, 2017

Member

This is caused by jm.ContentType not being a sealed trait, and hence not causing any compiler warnings. Someone ought to try to make that a sealed trait, so we can squash all warnings.

Member

jypma commented Jun 21, 2017

This is caused by jm.ContentType not being a sealed trait, and hence not causing any compiler warnings. Someone ought to try to make that a sealed trait, so we can squash all warnings.

@jypma

This comment has been minimized.

Show comment
Hide comment
@jypma

jypma Jun 21, 2017

Member

Originally introduced by #1141 .

Member

jypma commented Jun 21, 2017

Originally introduced by #1141 .

@jypma jypma self-assigned this Jun 22, 2017

jypma added a commit to jypma/akka-http that referenced this issue Jun 22, 2017

#1222 Correctly handle ContentType.withMissingCharset in ContentTypeR…
…ange

This scenario was overlooked in #1141, because jm.ContentType isn't a
sealed trait (and can't be, because it is implemented in the scala DSL).

Fixes #1222.

@2m 2m closed this in #1223 Jun 22, 2017

2m added a commit that referenced this issue Jun 22, 2017

#1222 Correctly handle ContentType.withMissingCharset in ContentTypeR…
…ange (#1223)

This scenario was overlooked in #1141, because jm.ContentType isn't a
sealed trait (and can't be, because it is implemented in the scala DSL).

Fixes #1222.

@2m 2m added this to the 10.0.9 milestone Jun 22, 2017

@2m

This comment has been minimized.

Show comment
Hide comment
@2m

2m Jun 22, 2017

Member

@jypma thanks for a quick fix. How often do you think this is going to be an issue with 10.0.8? We should decide when to release 10.0.9 according to this.

Member

2m commented Jun 22, 2017

@jypma thanks for a quick fix. How often do you think this is going to be an issue with 10.0.8? We should decide when to release 10.0.9 according to this.

@jypma

This comment has been minimized.

Show comment
Hide comment
@jypma

jypma Jun 22, 2017

Member

@2m The issue shows every time the akka-http-xml unmarshaller hits a content-type of application/xml (without charset). Hard to say how often that is; apparently it's true for S3, maybe other APIs do that as well.

Member

jypma commented Jun 22, 2017

@2m The issue shows every time the akka-http-xml unmarshaller hits a content-type of application/xml (without charset). Hard to say how often that is; apparently it's true for S3, maybe other APIs do that as well.

@TimothyKlim

This comment has been minimized.

Show comment
Hide comment
@TimothyKlim

TimothyKlim Jun 26, 2017

We've problems with all xml webhooks after upgrade to 10.0.8. Is there any plans to release 10.0.9 soon with that hotfix?

TimothyKlim commented Jun 26, 2017

We've problems with all xml webhooks after upgrade to 10.0.8. Is there any plans to release 10.0.9 soon with that hotfix?

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Jun 26, 2017

Member

@TimothyKlim Yes, we'll be releasing a fixed version very soon

Member

ktoso commented Jun 26, 2017

@TimothyKlim Yes, we'll be releasing a fixed version very soon

jrudolph added a commit to jrudolph/akka-http that referenced this issue Jun 26, 2017

ktoso added a commit that referenced this issue Jun 26, 2017

tomrf1 added a commit to tomrf1/akka-http that referenced this issue Aug 13, 2017

#1222 Correctly handle ContentType.withMissingCharset in ContentTypeR…
…ange (#1223)

This scenario was overlooked in #1141, because jm.ContentType isn't a
sealed trait (and can't be, because it is implemented in the scala DSL).

Fixes #1222.

tomrf1 added a commit to tomrf1/akka-http that referenced this issue Aug 13, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment