You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
Attempting a multi-upload with alpakka results in Unsupported Content-Type, supported: application/octet-stream. This is likely caused by the returned content type from s3mock being plain/text for the InitiateMultiUpload request.
Test to reproduce issue:
feature("Alpakka") {
scenario("Fails on multi part upload with s3mock") {
implicit val inMemorySystem = ActorSystem.create("some-system", configFor("localhost", 8001))
implicit val inMemoryMat = ActorMaterializer()(inMemorySystem)
val api = new S3Mock(8001, new FileProvider("/tmp/s3"))(inMemorySystem)
api.start
val endpoint = new EndpointConfiguration(s"http://localhost:8001", "eu-west-1")
val client = AmazonS3ClientBuilder.standard()
.withPathStyleAccessEnabled(true)
.withCredentials(new AWSStaticCredentialsProvider(new AnonymousAWSCredentials()))
.withEndpointConfiguration(endpoint)
.build()
client.createBucket("test-bucket")
val inMemoryBasedAlpakkaClient = S3Client(BasicCredentials("foo", "bar"), "us-east-1")(inMemorySystem, inMemoryMat)
val eventualResult: Future[MultipartUploadResult] = Source.single(ByteString("test-content"))
.runWith(inMemoryBasedAlpakkaClient.multipartUpload("test-bucket", "test-key"))
Await.result(eventualResult, 10 seconds)
}
}
def configFor(host: String, port: Int): Config = {
ConfigFactory.parseMap(Map(
"akka.stream.alpakka.s3.proxy.host" -> host,
"akka.stream.alpakka.s3.proxy.port" -> port,
"akka.stream.alpakka.s3.proxy.secure" -> false,
"akka.stream.alpakka.s3.path-style-access" -> true
).asJava)
}
Output:
[2017-08-04 11:43:57,926] activity-fun-test INFO [some-system-akka.actor.default-dispatcher-16] i.f.s.route.PutObjectMultipartStart - multipart upload start to test-bucket/test-key
[2017-08-04 11:43:57,932] activity-fun-test DEBUG [some-system-akka.actor.default-dispatcher-16] i.f.s3mock.provider.FileProvider - starting multipart upload for s3://test-bucket/test-key
Unsupported Content-Type, supported: application/octet-stream
akka.http.scaladsl.unmarshalling.Unmarshaller$UnsupportedContentTypeException: Unsupported Content-Type, supported: application/octet-stream
at akka.http.scaladsl.unmarshalling.Unmarshaller$UnsupportedContentTypeException$.apply(Unmarshaller.scala:158)
at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$$anonfun$forContentTypes$extension$1$$anonfun$apply$24$$anonfun$apply$25.apply(Unmarshaller.scala:114)
at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedFromEntityUnmarshaller$$anonfun$forContentTypes$extension$1$$anonfun$apply$24$$anonfun$apply$25.apply(Unmarshaller.scala:111)
at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58)
at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedUnmarshaller$$anonfun$mapWithInput$extension$1$$anonfun$apply$18$$anonfun$apply$19.apply(Unmarshaller.scala:91)
at akka.http.scaladsl.unmarshalling.Unmarshaller$EnhancedUnmarshaller$$anonfun$mapWithInput$extension$1$$anonfun$apply$18$$anonfun$apply$19.apply(Unmarshaller.scala:91)
at akka.http.scaladsl.unmarshalling.Unmarshaller$$anon$1.apply(Unmarshaller.scala:58)
at akka.http.scaladsl.unmarshalling.Unmarshaller$$anonfun$transform$1$$anonfun$apply$2$$anonfun$apply$3.apply(Unmarshaller.scala:23)
at akka.http.scaladsl.unmarshalling.Unmarshaller$$anonfun$transform$1$$anonfun$apply$2$$anonfun$apply$3.apply(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$akka$stream$alpakka$s3$impl$S3Stream$$initiateMultipartUpload$1.apply(S3Stream.scala:130)
at akka.stream.alpakka.s3.impl.S3Stream$$anonfun$akka$stream$alpakka$s3$impl$S3Stream$$initiateMultipartUpload$1.apply(S3Stream.scala:128)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:251)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:249)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90)
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)
The text was updated successfully, but these errors were encountered:
Attempting a multi-upload with alpakka results in
Unsupported Content-Type, supported: application/octet-stream
. This is likely caused by the returned content type from s3mock being plain/text for the InitiateMultiUpload request.Test to reproduce issue:
Output:
The text was updated successfully, but these errors were encountered: