RuntimeError in convert_to_jpeg! when processing incoming email

(Leo McArdle) #1

Continuing the discussion from Send rejection email for unrecognised errors:

We just hit this very same error again, twice, (which we noticed thanks to the unrecognised error rejection email), so now I feel we’re in bug territory.

Unrecognized error type (RuntimeError: ) when processing incoming email

  /var/www/discourse/lib/discourse.rb:27:in `execute_command'
  /var/www/discourse/lib/upload_creator.rb:137:in `convert_to_jpeg!'
  /var/www/discourse/lib/upload_creator.rb:44:in `block in create_for'
  /var/www/discourse/lib/distributed_mutex.rb:21:in `synchronize'
  /var/www/discourse/lib/distributed_mutex.rb:5:in `synchronize'
  /var/www/discourse/lib/upload_creator.rb:36:in `create_for'
  /var/www/discourse/lib/email/receiver.rb:637:in `block in add_attachments'
  /var/www/discourse/lib/email/receiver.rb:630:in `each'
  /var/www/discourse/lib/email/receiver.rb:630:in `add_attachments'
  /var/www/discourse/lib/email/receiver.rb:624:in `create_post_with_attachments'

Last time this happened, neither I nor @zogstrip were able to recreate the error with the same email. @zogstrip do you want to try again with the couple of emails which caused it this time?

If you’re not able to, it unfortunately seems like we have no repro steps aside from waiting for it to happen again.

From my reading of the code, the convert command is failing in some way, but outputting nothing at all to stderr.

Might we also want to log stdout when a command doesn’t execute successfully? Aside from that, I’m not sure there’s anything additional we can do to make the logs more descriptive in this case.

(Régis Hanol) #2

Sure, send send a PM to me and @gerhard. We’ll have a look.

(Gerhard Schlager) #3

Thanks for the emails. Unfortunately I can’t reproduce the error. I tried it in my dev environment and a Docker container. Maybe it’s related to a specific value of the png_to_jpg_quality site setting or who knows what…

I made a small change that will hopefully log a little bit more when an error occurs: Retry PNG to JPG conversion with debug enabled on failure · discourse/discourse@b47b378 · GitHub

Please notify us, when you see the error again.