Skip to content
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

S3: akka.stream.StreamTcpException Tcp Command failed #175

Closed
callicles opened this issue Feb 7, 2017 · 9 comments
Closed

S3: akka.stream.StreamTcpException Tcp Command failed #175

callicles opened this issue Feb 7, 2017 · 9 comments

Comments

@callicles
Copy link
Contributor

Hi!

I am trying to use the s3 connector but I get an exception while trying to use it.

Here is my exception:

akka.stream.StreamTcpException: Tcp command [Connect(<s3bucket>:443,None,List(),Some(10 seconds),true)] failed

Here is my code to instantiate the Sink

scala: 2.11.8
alpakka version: 0.5
akka-http version: 10.0.3
akka-stream version: 2.4.16

Thank you,

@2m
Copy link
Member

2m commented Feb 7, 2017

Tcp command [Connect(<host> ...] failed indicates that a connection to <host> could not be established. Have you specified the correct URL for the s3 to connect to?

@callicles
Copy link
Contributor Author

callicles commented Feb 7, 2017

I did not specify the host, I specified the bucket (datalogue) and the region (us-east-1)
The resulting host looks like a properly specified one:

datalogue.s3-us-east-1.amazonaws.com:443

I tried from different locations with a working connection

@callicles
Copy link
Contributor Author

callicles commented Feb 8, 2017

Ok, so after some investigation, it looks like the schema used to build the url is not valid for us-east-1.

The endpoints for that region are:

  • s3.amazonaws.com
  • s3-external-1.amazonaws.com
  • s3.dualstack.us-east-1.amazonaws.com

and not: s3-us-east-1.amazonaws.com

A solution would be to have the region be Option[String] so that if it is not used, the endpoint requested will just be <bucket>.s3.amazonaws.com

or another solution might be to remove the region part when the us-east-1 region is selected

@2m
Copy link
Member

2m commented Feb 8, 2017

Could be related to #171

@callicles
Copy link
Contributor Author

it is, looks like the same issue.
I made a local fix that works, should I push it in a PR?

@raboof raboof added this to the invalid milestone Sep 19, 2017
@JPrakashM
Copy link

If you are using proxy then it will help you.

val httpsProxyTransport : ClientTransport = ClientTransport.httpsProxy(InetSocketAddress.createUnresolved("proxy.services", 90))
val connSetts: ClientConnectionSettings = ClientConnectionSettings(system).withTransport(httpsProxyTransport).withIdleTimeout(Duration(180, "second"))

val httpClient: Flow[HttpRequest, HttpResponse, Future[Http.OutgoingConnection]] = Http().outgoingConnection(host,port,None,connSetts)

@Elderry
Copy link

Elderry commented Mar 5, 2019

The problem described in this issue also applies for Chinese endpoints, and it is not fixed. For region cn-north-1 and cn-northwest-1. The correct endpoint is s3.<region>.amazonaws.com.cn, according to the
AWS reference
, instead of s3-<region>.amazonaws.com generated by alpakka.

@2m
Copy link
Member

2m commented Mar 5, 2019

@Elderry can you create a separate ticket for this issue?

@Elderry
Copy link

Elderry commented Mar 5, 2019

@2m Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants