# 在尝试使用匿名用户功能时出现错误502

**URL:** <https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518>\
**Category:** Support\
**Created:** [2017年一月28日 15:56 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518 "2017-01-28T15:56:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![skozz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skozz/32/119704_2.png) [@skozz](https://meta.discourse.org/u/skozz)\
**Post date:** [2017年一月28日 15:56 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/1 "2017-01-28T15:56:09Z")

</div>

I’m receiving a 502 error using the anonymize user feature

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

I’m running Discourse over DigitalOcean + Docker (using the DO application installer)

Thank you!

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年一月30日 15:44 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/2 "2017-01-30T15:44:28Z")

</div>

@neil is this feature still working?

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [2017年一月30日 15:50 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/3 "2017-01-30T15:50:30Z")

</div>

Yes it still works. What else can you tell us about your install @skozz? Do you get bad gateway errors for other operations?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年一月30日 16:12 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/4 "2017-01-30T16:12:24Z")

</div>

One possibility is that the user has SOOOO many records that this thing times out mid job.

---

<div class="post-metadata">

**Author:** ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)\
**Post date:** [2017年一月30日 16:15 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/5 "2017-01-30T16:15:18Z")

</div>

I can attest to that…

---

<div class="post-metadata">

**Author:** ![skozz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skozz/32/119704_2.png) [@skozz](https://meta.discourse.org/u/skozz)\
**Post date:** [2017年一月30日 16:17 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/6 "2017-01-30T16:17:07Z")

</div>

> [@sam](#):
>
> One possibility is that the user has SOOOO many records that this thing times out mid job.

Is the same conclusion that I just reach 🤔 The user has 479 psots. 140 private messages

> [@neil](#):
>
> Yes it still works. What else can you tell us about your install @skozz? Do you get bad gateway errors for other operations?

Yup, of course. It’s a docker from the DigitalOcean installer, v1.8.0.beta4 +7 at the moment of this reply. And no, there no have more gateway errors.

Thank you guys for your time

---

<div class="post-metadata">

**Author:** ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)\
**Post date:** [2017年一月30日 16:26 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/7 "2017-01-30T16:26:39Z")

</div>

Is there some way to throttle such admin tasks?

On my test machine (AWS t2.micro with 1 GB ram) when I do a rake users:change\_post\_ownership on an account with more than about 100 posts the task loses communication and bombs out and I end up restarting the whole box.

Or is my docker broken? (other than apt-get update/upgrade I haven’t done anything criminal)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年一月30日 16:45 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/8 "2017-01-30T16:45:43Z")

</div>

Both this task (anonymize) and re-assign ownership need to be re-written so they kick off a background job to do the actual work and then simply make quick web calls to check on progress.

Unfortunately there is a day or 2 of work in making this kind of change. But we should get it on someone’s list.

In the meantime @neil can you provide CLI instructions on how to anonymize an account by entering the container?

---

<div class="post-metadata">

**Author:** ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)\
**Post date:** [2017年一月30日 18:46 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/9 "2017-01-30T18:46:30Z")

</div>

Yeah this should definitely be done in a background job. Doesn’t look hard to do that, although error reports will need to be sent via PM if something goes wrong.

From rails console, you can anonymize like this:

```plaintext
UserAnonymizer.make_anonymous(
  User.find_by_username('anon_this_user'),
  User.find_by_username('who_is_doing_it')
)

```

---

<div class="post-metadata">

**Author:** ![skozz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/skozz/32/119704_2.png) [@skozz](https://meta.discourse.org/u/skozz)\
**Post date:** [2017年一月30日 21:29 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/10 "2017-01-30T21:29:28Z")

</div>

Works! thank you! btw, if you will address the issue could be awesome if you can improve the translation. In my case, “anon123456” could be “ **anónimo123456** ” (Spanish).

Of course, if you let me know when and where (branch) you will address the issue, I can do the localisation part (I’m starting developing things on Discourse).

---

<div class="post-metadata">

**Author:** ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)\
**Post date:** [2017年二月6日 09:15 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/11 "2017-02-06T09:15:45Z")

</div>

Just to invoke closure on my issue. Once I changed my VM to 2GB ram rake tasks became a LOT more stable (as did everything else).

---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2024年六月8日 12:45 UTC](https://meta.discourse.org/t/getting-an-error-502-trying-to-use-the-anonymize-user-feature/56518/12 "2024-06-08T12:45:04Z")

</div>

此主题已在 2687 天后自动关闭。不再允许回复。
