# 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:** [2017年七月18日 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:** 2

<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:** [2017年七月18日 15:06 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/21 "2017-07-18T15:06:05Z")

</div>

Just once, and a second time now. And that was immediately after acquiring a new IP address.

---

<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:** [2017年七月18日 15:06 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/22 "2017-07-18T15:06:33Z")

</div>

Still the same outcome I’m afraid.

---

<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:** [2017年七月19日 07:36 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/23 "2017-07-19T07:36:13Z")

</div>

New day, same issue.

In the end, I completely cloned the AWS instance that Discourse was running on. This all started without any issue. The lesson here is, never shut this instance down, or we will most likely have this issue again. This could be a problem in the future, obviously.

So it seems that the answer here is “sometimes Discourse issues too many requests from rubygems in too short a time, and therefore doesn’t work”. So we were stuck with a non-functioning Discourse installation and therefore no way of continuing conversations that were in progress with our customers. This is disappointing - clearly we never should have used Discourse to begin with.

Thanks everyone for the suggestions and help, however.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年七月19日 10:04 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/24 "2017-07-19T10:04:40Z")

</div>

I’ve never, ever been rate limited by rubygems during a rebuild in literally _years_ of running Discourse droplets on Digital Ocean. I wonder if AWS shares IP addresses among large numbers of machines, that would also be hitting Rubygems?

---

<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:** [2017年七月19日 10:06 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/25 "2017-07-19T10:06:16Z")

</div>

It’s frustrating indeed.

Given that you have a separate data container it is appears that you do, you can do this:

```plaintext
./launcher bootstrap app

```

That will build a new container without first trashing your old one.

Given that it rebuilds properly, you can then

```plaintext
./launcher destroy app
./launcher start app

```

and have less than a minute of downtime.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年七月19日 10:11 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/26 "2017-07-19T10:11:15Z")

</div>

> [@pfaffman](#):
>
> a separate data container

Do you think this behavior is somehow specific to the data container? Are multiple containers being rebuilt simultaneously and all hitting rubygems at the same time, and triggering rate limits?

---

<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:** [2017年七月19日 10:14 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/27 "2017-07-19T10:14:25Z")

</div>

I think that if he knew that he could rebuild just the web container without first destroying it (since it appears that there is a separate data container), he could have solved the problem (which remains a mystery) without first taking his site down.

The **actual** problem of the rubygems rate limiting is entirely befuddling. You guys claim it’s never happened to you, even when building tons of sites. I’ve seen it several times and cannot explain why it happens or why it goes away.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2017年七月19日 10:15 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/28 "2017-07-19T10:15:19Z")

</div>

I’ve literally _never_ seen it, on the Digital Ocean / Discourse sites I run, in three solid years of rebuilding at least once a week.

If someone has repro steps that’d be excellent.

---

<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:** [2017年七月19日 10:18 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/29 "2017-07-19T10:18:05Z")

</div>

> [@codinghorror](#):
>
> If someone has repro steps that’d be excellent.

It’s happened to me about 3 times, in building dozens of sites. I can’t figure out how to repro or how it goes away. I’ve contacted rubygems and gotten no response. My only guess, which is totally unfounded, is that Digital Ocean gets lumped into a single rate-limit bin for them.

---

<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:** [2017年七月19日 10:22 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/30 "2017-07-19T10:22:26Z")

</div>

From what I understand the rate limits were only introduced relatively recently.

---

<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:** [2017年七月19日 10:23 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/31 "2017-07-19T10:23:09Z")

</div>

Thanks Jay - I’ll refer back here if this problem ever comes up for me again.

---

<div class="post-metadata">

**Author:** ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)\
**Post date:** [2017年八月6日 01:51 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/32 "2017-08-06T01:51:05Z")

</div>

I have the same issue: every attempt to run `./launcher rebuild <container>` fails with the « **429 Too Many Requests** » from **[rubygems.org](http://rubygems.org)**:

 ![01](https://global.discourse-cdn.com/meta/original/3X/7/2/724e15181387741e46cd66dc03100df738aefa74.png)

Here is the only solution I have found: [The only solution I have found to workaround «429 Too Many Requests» failure from rubygems.org](https://meta.discourse.org/t/the-only-solution-i-have-found-to-workaround-429-too-many-requests-failure-from-rubygems-org/67544)

---

<div class="post-metadata">

**Author:** ![Matt\_1](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Matt\_1](https://meta.discourse.org/u/Matt_1)\
**Post date:** [2018年六月7日 05:17 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/33 "2018-06-07T05:17:42Z")

</div>

I’m running into this issue for the second time in a couple of weeks. Both instances were running on Vultr’s Ubuntu 18.04 x64 1GB RAM packages.

I tried going back to the previous version as described by Discourse.PRO above without any joy.

Maybe Ubuntu 18 is too fast?

---

<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:** [2018年六月7日 07:39 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/34 "2018-06-07T07:39:14Z")

</div>

If you are getting rate limited, going back to a previous version won’t help. Quite the opposite actually. Your best option is to wait X minutes before issuing another rebuild.

---

<div class="post-metadata">

**Author:** ![Matt\_1](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@Matt\_1](https://meta.discourse.org/u/Matt_1)\
**Post date:** [2018年六月7日 21:38 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/35 "2018-06-07T21:38:13Z")

</div>

> [@zogstrip](#):
>
> Your best option is to wait X minutes before issuing another rebuild

I’ve tried leaving it days before retrying and the same issue occurs.

I’ve also tried it on Ubuntu 17 instance instead. The initial install of Discourse is fine, but the rebuilds always fail due to the Ruby rate limiting. Surely there should be some way for Discourse to check that the required items have been downloaded and retry those that haven’t been?

---

<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:** [2018年六月8日 06:36 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/36 "2018-06-08T06:36:52Z")

</div>

In that case I would try to contact RubyGems and ask them if they’ve somehow blacklisted your IP address.

---

<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:** [2018年六月8日 13:10 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/37 "2018-06-08T13:10:12Z")

</div>

I did that last summer and in April they emailed to ask if I still needed help.

---

<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:** [2018年六月8日 17:48 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/38 "2018-06-08T17:48:43Z")

</div>

We will be releasing a new base image in the next few days that will help here.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年六月8日 20:19 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/39 "2018-06-08T20:19:50Z")

</div>

Hmm interesting so as the base image gets older, it makes more requests to rubygems and is thus more likely to trigger this?

---

<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:** [2018年六月8日 21:36 UTC](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381/40 "2018-06-08T21:36:56Z")

</div>

Yes, and we just went to Rails 5.2, so there is lots of updates.

Meta is running this new image, if the weekend goes alright I will push it to all self-hosters (and force a terminal rebuild for everyone).

[上一頁](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381.md?page=1)

[下一頁](https://meta.discourse.org/t/unable-to-start-discourse-due-to-rubygems-rate-limiting/66381.md?page=3)
