We've moved discussions to Discord

Sidekiq debugging + receipt emails not sending on production (Hatchbox)

Mike Hatfield
EDIT SOLVED:  I figured out the webhooks were not actually being triggered as expected on production and Stripe was sending response to dev endpoint instead of live.


Here is where I'm at:

I've got 3 separate servers for load balancer, web/worker/cron and redis using Hatchbox. I configured Mailjet.  The Devise emails (eg. password reset) work on both production and development.  On production only Devise emails send. Receipt emails triggered from the Pay gem are not sending on production.  

I listen for the Stripe charge succeeded webhook and do some processing.  This is working since the records get updated (as well as pay_charges) but nothing related to this or the worker task is in the prod logs.

So I've got two issues if anyone has some insight:

1) Pay receipt emails not sending on production.  However forgot password email works as expected sending through Mailjet.

2) I can't seem to find any log entries for the background worker related to Pay or Stripe webhooks.  Everything else logs on the production web server.  Other unrelated background jobs work and are recorded in the logs.  When running JSP locally in development (with overmind) everything works and everything is nicely logged in the single terminal under “web” “worker” and “stripe”.  Receipt emails work both with Letter Opener or Mailjet locally in dev. 

This logging issue is preventing me from debugging further on my own and am stuck.  Hope for some help on this!


config/initializers/stripe_webhook.rb

class StripeWebhook
  include Rails.application.routes.url_helpers

  def call(event)
    # Custom code
    Rails.logger.info 'this works but isn't in logs ********************'
    # Custom code
    order.update_attribute(:payment_status, "paid")
  end
end

Pay::Webhooks.delegator.subscribe 'stripe.charge.succeeded', StripeWebhook.new
Notifications
You’re not receiving notifications from this thread.