How to look up a user based on a user_id?

(Joshua McFarland) #1

I’ve been looking at sidekiq and noticing an abnormally high number of failed Jobs::UserEmail jobs. Looking into the arguments almost all of them seem to be coming from the same user id. It’s import to note that all other emails are sending normally.

{"type"=>"digest", "user_id"=>398, "current_site_id"=>"default"}

Jobs::HandledExceptionWrapper: Wrapped Net::SMTPServerBusy: 401 4.1.3 Bad recipient address syntax

I’m unable to actually find the user by id to figure out where all these failed attempts are coming from. Any thoughts?

(Blake Erickson) #2

I’m not sure if you can through the Discourse interface, but you could use the Rails console:

u = User.find(398)

(Felix Freiberger) #3

Alternatively, you can use the awesome Data Explorer plugin:

FROM users
WHERE id = 398

(Dean Taylor) #4

For me the quickest way is simply to make a request like this whilst logged in as admin:

This will get the user by ID 398.

Yes, the result is JSON but it’s pretty easy to read the first few lines.