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

Unhandled exception: Hostname lookup for s3-us-east1.amazonaws.com failed: No address found #81

Closed
ejstembler opened this issue Jul 2, 2020 · 2 comments

Comments

@ejstembler
Copy link

ejstembler commented Jul 2, 2020

I'm getting this error:

Unhandled exception: Hostname lookup for s3-us-east1.amazonaws.com failed: No address found (Socket::Addrinfo::Error)
  from /usr/local/Cellar/crystal/0.34.0/src/socket/tcp_socket.cr:124:9 in 'initialize'
  from /usr/local/Cellar/crystal/0.34.0/src/socket/tcp_socket.cr:27:3 in 'new'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:762:5 in 'socket'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:650:19 in 'send_request'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:587:5 in 'exec_internal_single'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:574:5 in 'exec_internal'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:570:5 in 'exec'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:692:5 in 'exec'
  from /usr/local/Cellar/crystal/0.34.0/src/http/client.cr:396:3 in 'put'
  from lib/awscr-s3/src/awscr-s3/http.cr:47:7 in 'put'
  from lib/awscr-s3/src/awscr-s3/client.cr:231:7 in 'put_object'
  from lib/awscr-s3/src/awscr-s3/file_uploader.cr:33:9 in 'upload'
  from src/xxxxxx.cr:51:13 in '__crystal_main'
  from /usr/local/Cellar/crystal/0.34.0/src/crystal/main.cr:105:5 in 'main_user_code'
  from /usr/local/Cellar/crystal/0.34.0/src/crystal/main.cr:91:7 in 'main'
  from /usr/local/Cellar/crystal/0.34.0/src/crystal/main.cr:114:3 in 'main'

I noticed it's looking for s3-us-east1.amazonaws.com. Shouldn't it be s3.us-east1.amazonaws.com instead?

From Working with Amazon S3 Buckets > AWS SDK > Creating a client:

creating-a-client

I'm not sure, but this may be the related line of code:

src/awscr-s3/http.cr#L103

URI.parse("https://#{SERVICE_NAME}-#{@region}.amazonaws.com")
@taylorfinnell
Copy link
Owner

I think the region when you configure the client needs to be us-east-1. Looks like it might be us-east1

@ejstembler
Copy link
Author

I think the region when you configure the client needs to be us-east-1. Looks like it might be us-east1

Yes, I think you're correct. I changed it to us-east-1 and now I'm getting an access denied error which I need to look in to.

Thanks!

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

2 participants