# Failed to open TCP connection to \<my-site\>.s3.amazonaws.com:443

**URL:** https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727
**Category:** Support
**Created:** [October 23, 2019, 2:51pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727 "2019-10-23T14:51:56Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)
#### Post date: [October 23, 2019, 2:51pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/1 "2019-10-23T14:51:56Z")

</div>

I’ve enabled S3 uploads, but when I try to upload a file, I get this error:

> Failed to open TCP connection to \<my-site\>.s3.amazonaws.com:443 (getaddrinfo: Temporary failure in name resolution)

I’ve checked the logs and this is what I see:

```plaintext
/usr/local/lib/ruby/2.6.0/net/http.rb:949:in `rescue in block in connect'
/usr/local/lib/ruby/2.6.0/net/http.rb:946:in `block in connect'
/usr/local/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/usr/local/lib/ruby/2.6.0/timeout.rb:103:in `timeout'
/usr/local/lib/ruby/2.6.0/net/http.rb:945:in `connect'
/usr/local/lib/ruby/2.6.0/net/http.rb:930:in `do_start'
/usr/local/lib/ruby/2.6.0/net/http.rb:925:in `start'
/usr/local/lib/ruby/2.6.0/delegate.rb:83:in `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/net_http/connection_pool.rb:297:in `start_session'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/net_http/connection_pool.rb:96:in `session_for'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/net_http/handler.rb:121:in `session'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/net_http/handler.rb:73:in `transmit'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/net_http/handler.rb:47:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/plugins/content_length.rb:12:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/s3_signer.rb:109:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/s3_signer.rb:57:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/s3_host_id.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/xml/error_handler.rb:8:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/helpful_socket_errors.rb:10:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/s3_signer.rb:87:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/redirects.rb:18:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:173:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:204:in `retry_request'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:187:in `retry_if_possible'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:175:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:204:in `retry_request'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:187:in `retry_if_possible'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:175:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:204:in `retry_request'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:187:in `retry_if_possible'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/retry_errors.rb:175:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/dualstack.rb:34:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/accelerate.rb:50:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/md5s.rb:31:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/bucket_name_restrictions.rb:13:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/expect_100_continue.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/bucket_dns.rb:33:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/rest/handler.rb:8:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/user_agent.rb:13:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/endpoint_pattern.rb:28:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/endpoint_discovery.rb:78:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/plugins/endpoint.rb:45:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/param_validator.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/sse_cpk.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/dualstack.rb:26:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/plugins/accelerate.rb:35:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/jsonvalue_converter.rb:20:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/idempotency_token.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/param_converter.rb:24:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/plugins/response_paging.rb:10:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/plugins/response_target.rb:23:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/seahorse/client/request.rb:70:in `send_request'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/poller.rb:63:in `send_request'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/poller.rb:49:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:105:in `block in poll'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:102:in `loop'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:102:in `poll'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:92:in `block (2 levels) in wait'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:91:in `catch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:91:in `block in wait'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:90:in `catch'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-core-3.48.6/lib/aws-sdk-core/waiters/waiter.rb:90:in `wait'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/waiters.rb:57:in `wait'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/bucket.rb:93:in `wait_until_exists'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/aws-sdk-s3-1.36.1/lib/aws-sdk-s3/bucket.rb:74:in `exists?'
/var/www/discourse/lib/s3_helper.rb:260:in `s3_bucket'
/var/www/discourse/lib/s3_helper.rb:179:in `list'
/var/www/discourse/lib/backup_restore/s3_backup_store.rb:60:in `unsorted_files'
/var/www/discourse/lib/backup_restore/backup_store.rb:23:in `files'
/var/www/discourse/lib/backup_restore/backup_store.rb:28:in `latest_file'
/var/www/discourse/app/jobs/scheduled/schedule_backup.rb:12:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/rails_multisite-2.0.7/lib/rails_multisite/connection_management.rb:63:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
/var/www/discourse/app/jobs/base.rb:279:in `perform'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_scheduler-0.12.2/lib/mini_scheduler/manager.rb:86:in `process_queue'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/mini_scheduler-0.12.2/lib/mini_scheduler/manager.rb:36:in `block (2 levels) in initialize'

```

I’ve followed @fefrei’s advice on [adding an offline page](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238), which worked perfectly, but I’m not sure if it’s related to this.

I’d appreciate any recommendations on things I could try to fix this error. For example, is there any way I could check to see if it’s an SSL certificate-related error? The rest of the forum seems to be running fine.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [October 23, 2019, 5:06pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/2 "2019-10-23T17:06:34Z")

</div>

> [@Nacho\_Caballero](#):
>
> getaddrinfo: Temporary failure in name resolution

The means the name does not exist which means the bucket you specified doesn’t exist. You probably don’t have the right bucket name configured.

---

<div class="post-metadata">

### Author: ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)
#### Post date: [October 23, 2019, 5:39pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/3 "2019-10-23T17:39:58Z")

</div>

Thanks for the help, but I don’t think that’s it. Here is the name in S3:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/e/2e058218a3ba51699fd5d74cef1dbbc78121821f.png)

And here is the name in Discourse:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/3/b39d808897468d1e9fe731d3bc0e97ed4a0978d4.png)

And here is the actual error:  
 ![image](https://global.discourse-cdn.com/meta/optimized/3X/2/8/2801b700dc7e3f33130d3f49bff8f87dbdb0ec9b_2_690x20.png)

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [October 23, 2019, 5:42pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/4 "2019-10-23T17:42:23Z")

</div>

Ah, from the perspective of the server the name doesn’t exist.

You’ll need to fix DNS on the server so that it’s able to resolve the name.

---

<div class="post-metadata">

### Author: ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)
#### Post date: [October 23, 2019, 5:43pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/5 "2019-10-23T17:43:11Z")

</div>

Thanks, any obvious places/commands I should check out?

For example, how do I reproduce this test in the command line?  
Running this in my server gives a 403 error:

```
wget lacomunidad-nachotime2.s3.amazonaws.com

```

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [October 23, 2019, 5:55pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/6 "2019-10-23T17:55:15Z")

</div>

You’ll need to make this work from inside your app container:

```plaintext
$ host lacomunidad-nachotime2.s3.amazonaws.com
lacomunidad-nachotime2.s3.amazonaws.com is an alias for s3-1-w.amazonaws.com.
s3-1-w.amazonaws.com has address 52.217.37.148

```

---

<div class="post-metadata">

### Author: ![Nacho\_Caballero](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nacho_caballero/32/130189_2.png) [@Nacho\_Caballero](https://meta.discourse.org/u/Nacho_Caballero)
#### Post date: [October 23, 2019, 8:46pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/7 "2019-10-23T20:46:01Z")

</div>

That actually already works, so it must be something else 🤔

```plaintext
$ /var/discourse/launcher enter app
host lacomunidad-nachotime2.s3.amazonaws.com
lacomunidad-nachotime2.s3.amazonaws.com is an alias for s3-1-w.amazonaws.com.
s3-1-w.amazonaws.com has address 52.216.176.51

```

EDIT: Actually I just tried re-enabling S3 inside Discourse and the error seems to have gone away. It might have been something wrong on AWS’s side? 🤷🏻‍:male\_sign: Thanks for the help, anyway. I learned about the `host` command 😊

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 22, 2019, 8:46pm UTC](https://meta.discourse.org/t/failed-to-open-tcp-connection-to-my-site-s3-amazonaws-com-443/131727/8 "2019-11-22T20:46:04Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
