Getting an error 502 trying to use the anonymize user feature


(Angel Raul Molina Muñoz) #1

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!


(Sam Saffron) #2

@neil is this feature still working?


(Neil Lalonde) #3

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


(Sam Saffron) #4

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


(Andrew Waugh) #5

I can attest to that…


(Angel Raul Molina Muñoz) #6

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


(Andrew Waugh) #7

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)


(Sam Saffron) #8

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?


(Neil Lalonde) #9

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

(Angel Raul Molina Muñoz) #10

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


(Andrew Waugh) #11

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