# Unable to start discourse due to rubygems rate limiting

**URL:** https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381
**Category:** Support
**Created:** [18 Julio, 2017 12:00 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381 "2017-07-18T12:00:51Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 12:00 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/1 "2017-07-18T12:00:51Z")

</div>

I ran some standard updates on the Ubuntu machine I have hosting my discourse instance. Now I cannot start discourse again.

I’m not a docker user, but the instructions I inherited from a previous staff member who set this up are to run:

```
./launcher stop app
./launcher rebuild data
./launcher rebuild app
./launcher start app

```

But when I run

`./launcher rebuild app`

It takes forever and finally fails. The reason for the failure seems to be below:

```
URGENT: could not connect to server: No route to host
         Is the server running on host "172.17.0.1" and accepting
         TCP/IP connections on port 5432

```

Can anyone please help with this? I’ve been messing around for hours now.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [18 Julio, 2017 12:26 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/2 "2017-07-18T12:26:08Z")

</div>

We need more information in order to help you. Can you start by providing us with the **full** log of the rebuild operation?

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 12:51 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/3 "2017-07-18T12:51:42Z")

</div>

The full log? I’ve just discovered it is over 32K lines. Do you actually want it all?

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [18 Julio, 2017 13:26 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/4 "2017-07-18T13:26:28Z")

</div>

There shouldn’t be 32K lines in the rebuild log. What Régis is looking for the the console after from after you run `./launcher rebuild app`. Share everything that appears in the console after that command.

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 13:28 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/5 "2017-07-18T13:28:43Z")

</div>

Thanks for clarifying, but that’s actually what I am talking about. I run the rebuild command, and after that there are 32K lines that appear in the console, right up to the failure notification.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [18 Julio, 2017 13:31 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/6 "2017-07-18T13:31:35Z")

</div>

Wow. In that case please do upload the output to something like pastebin or gist, and share the link here.

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 13:35 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/7 "2017-07-18T13:35:22Z")

</div>

OK, I’ve pasted here: [gist:6464801c6cde865ab60e3f10dba21e05 · GitHub](https://gist.github.com/anonymous/6464801c6cde865ab60e3f10dba21e05)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [18 Julio, 2017 13:38 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/8 "2017-07-18T13:38:56Z")

</div>

Thanks.

Here is something concerning

```
Bundler::HTTPError: Net::HTTPTooManyRequests: <html>
<head><title>429 Too Many Requests</title></head>
<body bgcolor="white">
<center><h1>429 Too Many Requests</h1></center>
<hr><center>nginx</center>
</body>
</html>

```

You are hitting the rate limit for [rubygems.org](http://rubygems.org).

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 13:44 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/9 "2017-07-18T13:44:52Z")

</div>

Thanks for spotting that. I have no idea what I can do about that though - I’m just running the commands that are meant to work with Discourse. I can’t even find any results for rubygem rate limits.

Every time we have had to do anything that involved restarting this server, Discourse breaks and I have to spend hours or days trying to fix it. It doesn’t seem to really work.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [18 Julio, 2017 13:46 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/10 "2017-07-18T13:46:42Z")

</div>

I’m afraid there’s nothing you can do about that short of waiting a bit before re-issuing your rebuild command or contacting rubygems.

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 13:53 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/11 "2017-07-18T13:53:48Z")

</div>

Do you mean that the rebuild could work if I try it later on? It seems to me that the problem is that the rebuild job itself involves too many requests and is therefore impossible. I can see others have stumbled across this recently too.

> [@Update failing due to rate limiting by RubyGems](https://meta.discourse.org/t/update-failing-due-to-rate-limiting-by-rubygems/64636/):
>
> Hello. I wanted to update my discourse for new commits, it did fail. Then I rebuild app, it also failed with the following error. Any Idea? FAILED -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #\<Process::Status: pid 13406 exit 1\> Location of failure: /pups/lib/pups/exec\_command.rb:108:in `spawn' exec failed with the params {"cd"=\>"$home", "hook"=\>"bundle\_exec", "cmd"=\>["su discourse -c 'bundle install --deployment…

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [18 Julio, 2017 14:07 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/12 "2017-07-18T14:07:12Z")

</div>

> [@shaneoh](#):
>
> Do you mean that the rebuild could work if I try it later on?

Pretty sure it will unless your IP has been blacklisted. The only way to know for certain is to contact [rubygems.org](http://rubygems.org).

> [@shaneoh](#):
>
> It seems to me that the problem is that the rebuild job itself involves too many requests and is therefore impossible.

From what I’ve seen, it only happens when using a VPS (_where you don’t know what the other/previous tenants are doing_) and/or when you rebuild your Discourse several times in a row in a short period of time.

FYI: we’ve never been rate limited, even when we deploy all our customers.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 Julio, 2017 14:34 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/13 "2017-07-18T14:34:24Z")

</div>

> [@zogstrip](#):
>
> Pretty sure it will unless your IP has been blacklisted. The only way to know for certain is to contact [rubygems.org](http://rubygems.org).

When I’ve contacted them I’ve gotten no response.

> [@zogstrip](#):
>
> From what I’ve seen, it only happens when using a VPS (where you don’t know what the other/previous tenants are doing) and/or when you rebuild your Discourse several times in a row in a short period of time.
> 
> FYI: we’ve never been rate limited, even when we deploy all our customers.

I can’t make rhyme or reason of the cause when I’ve been rate limited. It also doesn’t make sense that you guys have never been rate limited when I have on several occasions. Stranger still, sometimes I see the rate limit errors, but the build appears to complete successfully.

But yes, @shaneoh, it should work eventually.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [18 Julio, 2017 14:40 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/14 "2017-07-18T14:40:24Z")

</div>

You have a multicontainer setup and is starting `app` before `data`. Try the other way around.

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 14:48 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/15 "2017-07-18T14:48:54Z")

</div>

Would you mind telling me the exact series of commands you would recommend running? I’ve just tried this and get the same issue:

```
  ./launcher stop data
  ./launcher stop app
  ./launcher start data
  ./launcher start app
  ./launcher rebuild app

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [18 Julio, 2017 14:50 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/16 "2017-07-18T14:50:52Z")

</div>

```
./launcher start data
# wait 10 seconds
./launcher start app

```

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 14:50 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/17 "2017-07-18T14:50:59Z")

</div>

Yeah, general feedback online seems the same, nobody gets a response.

I’ve just restarted the server and made sure it was assigned a new IP address. On the first attempt I got the same issue. This rate limit thing doesn’t seem to be very logical. As it’s a brand new attempt, I still have to suspect something about the way discourse is attempting to do this is breaking things, but I don’t know enough about how it works to know for sure.

---

<div class="post-metadata">

### Author: ![shaneoh](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shaneoh](https://meta.discourse.org/u/shaneoh)
#### Post date: [18 Julio, 2017 14:53 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/18 "2017-07-18T14:53:57Z")

</div>

The result there was the same as it’s been all when the rebuild fails. It seems fine but the URL shows a bad gateway.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [18 Julio, 2017 14:56 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/19 "2017-07-18T14:56:16Z")

</div>

> [@shaneoh](#):
>
> t seems fine but the URL shows a bad gateway.

Enter the container `/launcher enter app` and tail the logs `tail -f /var/www/discourse/log/*` and try to find why.

How many times did you use the rebuild command? Running it multiple times in quick sucession will 100% put you on RubyGems rate limit.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [18 Julio, 2017 14:56 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/20 "2017-07-18T14:56:17Z")

</div>

That’s probably a good sign. If you reload about . . . now, it’ll probably be up and running.

[Página siguiente](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381.md?page=2)
