Getting an error 502 trying to use the anonymize user feature

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

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

Thank you!

@neil is this feature still working?

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

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

2 Likes

I can attest to that…

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

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

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)

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?

2 Likes

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:

UserAnonymizer.make_anonymous(
  User.find_by_username('anon_this_user'),
  User.find_by_username('who_is_doing_it')
)
5 Likes

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).

3 Likes

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).

2 Likes