pay-rails / pay

Payments for Ruby on Rails apps
https://github.com/pay-rails/pay
MIT License
1.96k stars 313 forks source link

[BUG] Paddle Billing charge method should rescue from ActiveRecord::RecordNotUnique #1095

Open codadrop opened 3 hours ago

codadrop commented 3 hours ago

Bug Report

Describe the Bug: Pay receives multiple webhooks from Paddle Billing when using the overlay checkout. These seems to be stepping on each other and throwing ActiveRecord::RecordNotUnique error.

To Reproduce:

  1. Create pay customer per docs.
  2. Use overlay checkout and perform successful subscription purchase.
  3. Look in console and see error thrown.

Expected Behavior: Webhooks trigger updating subscription, but rescue from ActiveRecord::RecordNotUnique and switch to update instead of create.

Actual Behavior: Webhook fails to create subscription because subscription is already present.

Screenshots (if applicable): N/A

Environment:

Additional Context: Started POST "/pay/webhooks/paddle_billing" for 54.234.237.108 at 2024-10-22 20:51:39 -0600 Cannot render console from 54.234.237.108! Allowed networks: 127.0.0.0/127.255.255.255, ::1 Processing by Pay::Webhooks::PaddleBillingController#create as JSON Parameters: {"data"=>{"id"=>"sub_01javmjxeax84dxdy5rmp3r47s", "items"=>[{"price"=>{"id"=>"pri_01j31vccj0pp48wjhspa20kjp2", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "quantity"=>{"maximum"=>1, "minimum"=>1}, "tax_mode"=>"account_setting", "seller_id"=>"21184", "created_at"=>"2024-07-18T02:40:15.936926Z", "product_id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "unit_price"=>{"amount"=>"1500", "currency_code"=>"USD"}, "updated_at"=>"2024-07-18T20:41:17.49105Z", "custom_data"=>nil, "description"=>"Monthly Pro Plan", "import_meta"=>nil, "trial_period"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "unit_price_overrides"=>[]}, "status"=>"active", "product"=>{"id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "image_url"=>nil, "seller_id"=>"21184", "created_at"=>"2024-07-18T02:36:38.659Z", "updated_at"=>"2024-10-04T02:55:44.147Z", "custom_data"=>nil, "description"=>nil, "import_meta"=>nil, "tax_category"=>"saas"}, "quantity"=>1, "recurring"=>true, "created_at"=>"2024-10-23T02:51:37.802Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "trial_dates"=>nil, "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "previously_billed_at"=>"2024-10-23T02:51:37.163694Z"}], "status"=>"active", "discount"=>nil, "paused_at"=>nil, "address_id"=>"add_01javmj875ykcnw5962fy7epaq", "created_at"=>"2024-10-23T02:51:37.802Z", "started_at"=>"2024-10-23T02:51:37.163694Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "business_id"=>nil, "canceled_at"=>nil, "custom_data"=>nil, "customer_id"=>"ctm_01javmgfq796j6k2mraxa8p8xs", "import_meta"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "currency_code"=>"USD", "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "transaction_id"=>"txn_01javmhc9wttpewqdj2rjp5rxz", "billing_details"=>nil, "collection_mode"=>"automatic", "first_billed_at"=>"2024-10-23T02:51:37.163694Z", "scheduled_change"=>nil, "current_billing_period"=>{"ends_at"=>"2024-11-23T02:51:37.163694Z", "starts_at"=>"2024-10-23T02:51:37.163694Z"}}, "event_id"=>"evt_01javmjyfhftgsxr7yw2zh5sqp", "event_type"=>"subscription.created", "occurred_at"=>"2024-10-23T02:51:38.865096Z", "notification_id"=>"ntf_01javmjykdgyss5rw2bqzmxat4", "paddle_billing"=>{"data"=>{"id"=>"sub_01javmjxeax84dxdy5rmp3r47s", "items"=>[{"price"=>{"id"=>"pri_01j31vccj0pp48wjhspa20kjp2", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "quantity"=>{"maximum"=>1, "minimum"=>1}, "tax_mode"=>"account_setting", "seller_id"=>"21184", "created_at"=>"2024-07-18T02:40:15.936926Z", "product_id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "unit_price"=>{"amount"=>"1500", "currency_code"=>"USD"}, "updated_at"=>"2024-07-18T20:41:17.49105Z", "custom_data"=>nil, "description"=>"Monthly Pro Plan", "import_meta"=>nil, "trial_period"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "unit_price_overrides"=>[]}, "status"=>"active", "product"=>{"id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "image_url"=>nil, "seller_id"=>"21184", "created_at"=>"2024-07-18T02:36:38.659Z", "updated_at"=>"2024-10-04T02:55:44.147Z", "custom_data"=>nil, "description"=>nil, "import_meta"=>nil, "tax_category"=>"saas"}, "quantity"=>1, "recurring"=>true, "created_at"=>"2024-10-23T02:51:37.802Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "trial_dates"=>nil, "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "previously_billed_at"=>"2024-10-23T02:51:37.163694Z"}], "status"=>"active", "discount"=>nil, "paused_at"=>nil, "address_id"=>"add_01javmj875ykcnw5962fy7epaq", "created_at"=>"2024-10-23T02:51:37.802Z", "started_at"=>"2024-10-23T02:51:37.163694Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "business_id"=>nil, "canceled_at"=>nil, "custom_data"=>nil, "customer_id"=>"ctm_01javmgfq796j6k2mraxa8p8xs", "import_meta"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "currency_code"=>"USD", "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "transaction_id"=>"txn_01javmhc9wttpewqdj2rjp5rxz", "billing_details"=>nil, "collection_mode"=>"automatic", "first_billed_at"=>"2024-10-23T02:51:37.163694Z", "scheduled_change"=>nil, "current_billing_period"=>{"ends_at"=>"2024-11-23T02:51:37.163694Z", "starts_at"=>"2024-10-23T02:51:37.163694Z"}}, "event_id"=>"evt_01javmjyfhftgsxr7yw2zh5sqp", "event_type"=>"subscription.created", "occurred_at"=>"2024-10-23T02:51:38.865096Z", "notification_id"=>"ntf_01javmjykdgyss5rw2bqzmxat4"}} TRANSACTION (0.2ms) BEGIN Pay::Webhook Create (1.1ms) INSERT INTO "pay_webhooks" ("processor", "event_type", "event", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["processor", "paddle_billing"], ["event_type", "subscription.created"], ["event", "{\"data\":{\"id\":\"sub_01javmjxeax84dxdy5rmp3r47s\",\"items\":[{\"price\":{\"id\":\"pri_01j31vccj0pp48wjhspa20kjp2\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"quantity\":{\"maximum\":1,\"minimum\":1},\"tax_mode\":\"account_setting\",\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:40:15.936926Z\",\"product_id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"unit_price\":{\"amount\":\"1500\",\"currency_code\":\"USD\"},\"updated_at\":\"2024-07-18T20:41:17.49105Z\",\"custom_data\":null,\"description\":\"Monthly Pro Plan\",\"import_meta\":null,\"trial_period\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"unit_price_overrides\":[]},\"status\":\"active\",\"product\":{\"id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"image_url\":null,\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:36:38.659Z\",\"updated_at\":\"2024-10-04T02:55:44.147Z\",\"custom_data\":null,\"description\":null,\"import_meta\":null,\"tax_category\":\"saas\"},\"quantity\":1,\"recurring\":true,\"created_at\":\"2024-10-23T02:51:37.802Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"trial_dates\":null,\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"previously_billed_at\":\"2024-10-23T02:51:37.163694Z\"}],\"status\":\"active\",\"discount\":null,\"paused_at\":null,\"address_id\":\"add_01javmj875ykcnw5962fy7epaq\",\"created_at\":\"2024-10-23T02:51:37.802Z\",\"started_at\":\"2024-10-23T02:51:37.163694Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"business_id\":null,\"canceled_at\":null,\"custom_data\":null,\"customer_id\":\"ctm_01javmgfq796j6k2mraxa8p8xs\",\"import_meta\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"currency_code\":\"USD\",\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"transaction_id\":\"txn_01javmhc9wttpewqdj2rjp5rxz\",\"billing_details\":null,\"collection_mode\":\"automatic\",\"first_billed_at\":\"2024-10-23T02:51:37.163694Z\",\"scheduled_change\":null,\"current_billing_period\":{\"ends_at\":\"2024-11-23T02:51:37.163694Z\",\"starts_at\":\"2024-10-23T02:51:37.163694Z\"}},\"event_id\":\"evt_01javmjyfhftgsxr7yw2zh5sqp\",\"event_type\":\"subscription.created\",\"occurred_at\":\"2024-10-23T02:51:38.865096Z\",\"notification_id\":\"ntf_01javmjykdgyss5rw2bqzmxat4\",\"paddle_billing\":{\"data\":{\"id\":\"sub_01javmjxeax84dxdy5rmp3r47s\",\"items\":[{\"price\":{\"id\":\"pri_01j31vccj0pp48wjhspa20kjp2\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"quantity\":{\"maximum\":1,\"minimum\":1},\"tax_mode\":\"account_setting\",\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:40:15.936926Z\",\"product_id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"unit_price\":{\"amount\":\"1500\",\"currency_code\":\"USD\"},\"updated_at\":\"2024-07-18T20:41:17.49105Z\",\"custom_data\":null,\"description\":\"Monthly Pro Plan\",\"import_meta\":null,\"trial_period\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"unit_price_overrides\":[]},\"status\":\"active\",\"product\":{\"id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"image_url\":null,\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:36:38.659Z\",\"updated_at\":\"2024-10-04T02:55:44.147Z\",\"custom_data\":null,\"description\":null,\"import_meta\":null,\"tax_category\":\"saas\"},\"quantity\":1,\"recurring\":true,\"created_at\":\"2024-10-23T02:51:37.802Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"trial_dates\":null,\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"previously_billed_at\":\"2024-10-23T02:51:37.163694Z\"}],\"status\":\"active\",\"discount\":null,\"paused_at\":null,\"address_id\":\"add_01javmj875ykcnw5962fy7epaq\",\"created_at\":\"2024-10-23T02:51:37.802Z\",\"started_at\":\"2024-10-23T02:51:37.163694Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"business_id\":null,\"canceled_at\":null,\"custom_data\":null,\"customer_id\":\"ctm_01javmgfq796j6k2mraxa8p8xs\",\"import_meta\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"currency_code\":\"USD\",\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"transaction_id\":\"txn_01javmhc9wttpewqdj2rjp5rxz\",\"billing_details\":null,\"collection_mode\":\"automatic\",\"first_billed_at\":\"2024-10-23T02:51:37.163694Z\",\"scheduled_change\":null,\"current_billing_period\":{\"ends_at\":\"2024-11-23T02:51:37.163694Z\",\"starts_at\":\"2024-10-23T02:51:37.163694Z\"}},\"event_id\":\"evt_01javmjyfhftgsxr7yw2zh5sqp\",\"event_type\":\"subscription.created\",\"occurred_at\":\"2024-10-23T02:51:38.865096Z\",\"notification_id\":\"ntf_01javmjykdgyss5rw2bqzmxat4\"}}"], ["created_at", "2024-10-23 02:51:39.203205"], ["updated_at", "2024-10-23 02:51:39.203205"]] TRANSACTION (0.6ms) COMMIT [ActiveJob] TRANSACTION (0.4ms) BEGIN Started POST "/pay/webhooks/paddle_billing" for 54.234.237.108 at 2024-10-22 20:51:39 -0600 Cannot render console from 54.234.237.108! Allowed networks: 127.0.0.0/127.255.255.255, ::1 [ActiveJob] GoodJob::Job Create (1.3ms) INSERT INTO "good_jobs" ("id", "queue_name", "priority", "serialized_params", "scheduled_at", "performed_at", "finished_at", "error", "created_at", "updated_at", "active_job_id", "concurrency_key", "cron_key", "cron_at", "batch_id", "batch_callback_id", "executions_count", "job_class", "error_event", "labels", "locked_by_id", "locked_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) RETURNING "id" [["id", "9ab6a656-a271-4dc5-87dd-228bf2ce631f"], ["queue_name", "default"], ["priority", 0], ["serialized_params", "{\"job_class\":\"Pay::Webhooks::ProcessJob\",\"job_id\":\"9ab6a656-a271-4dc5-87dd-228bf2ce631f\",\"provider_job_id\":null,\"queue_name\":\"default\",\"priority\":null,\"arguments\":[{\"_aj_globalid\":\"gid://coda/Pay::Webhook/40e41e68-e320-46b8-a21c-3826cb23b732\"}],\"executions\":0,\"exception_executions\":{},\"locale\":\"en\",\"timezone\":\"UTC\",\"enqueued_at\":\"2024-10-23T02:51:39Z\"}"], ["scheduled_at", "2024-10-23 02:51:39.208988"], ["performed_at", nil], ["finished_at", nil], ["error", nil], ["created_at", "2024-10-23 02:51:39.208988"], ["updated_at", "2024-10-23 02:51:39.222300"], ["active_job_id", "9ab6a656-a271-4dc5-87dd-228bf2ce631f"], ["concurrency_key", "[FILTERED]"], ["cron_key", "[FILTERED]"], ["cron_at", nil], ["batch_id", nil], ["batch_callback_id", nil], ["executions_count", nil], ["job_class", "Pay::Webhooks::ProcessJob"], ["error_event", nil], ["labels", nil], ["locked_by_id", nil], ["locked_at", nil]] [ActiveJob] TRANSACTION (0.7ms) COMMIT [ActiveJob] Enqueued Pay::Webhooks::ProcessJob (Job ID: 9ab6a656-a271-4dc5-87dd-228bf2ce631f) to GoodJob(default) with arguments: #<GlobalID:0x0000000108375678 @uri=#<URI::GID gid://coda/Pay::Webhook/40e41e68-e320-46b8-a21c-3826cb23b732>> Completed 200 OK in 37ms (ActiveRecord: 10.8ms | Allocations: 30540)

Processing by Pay::Webhooks::PaddleBillingController#create as JSON Parameters: {"data"=>{"id"=>"sub_01javmjxeax84dxdy5rmp3r47s", "items"=>[{"price"=>{"id"=>"pri_01j31vccj0pp48wjhspa20kjp2", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "quantity"=>{"maximum"=>1, "minimum"=>1}, "tax_mode"=>"account_setting", "seller_id"=>"21184", "created_at"=>"2024-07-18T02:40:15.936926Z", "product_id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "unit_price"=>{"amount"=>"1500", "currency_code"=>"USD"}, "updated_at"=>"2024-07-18T20:41:17.49105Z", "custom_data"=>nil, "description"=>"Monthly Pro Plan", "import_meta"=>nil, "trial_period"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "unit_price_overrides"=>[]}, "status"=>"active", "product"=>{"id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "image_url"=>nil, "seller_id"=>"21184", "created_at"=>"2024-07-18T02:36:38.659Z", "updated_at"=>"2024-10-04T02:55:44.147Z", "custom_data"=>nil, "description"=>nil, "import_meta"=>nil, "tax_category"=>"saas"}, "quantity"=>1, "recurring"=>true, "created_at"=>"2024-10-23T02:51:37.802Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "trial_dates"=>nil, "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "previously_billed_at"=>"2024-10-23T02:51:37.163694Z"}], "status"=>"active", "discount"=>nil, "paused_at"=>nil, "address_id"=>"add_01javmj875ykcnw5962fy7epaq", "created_at"=>"2024-10-23T02:51:37.802Z", "started_at"=>"2024-10-23T02:51:37.163694Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "business_id"=>nil, "canceled_at"=>nil, "custom_data"=>nil, "customer_id"=>"ctm_01javmgfq796j6k2mraxa8p8xs", "import_meta"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "currency_code"=>"USD", "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "billing_details"=>nil, "collection_mode"=>"automatic", "first_billed_at"=>"2024-10-23T02:51:37.163694Z", "scheduled_change"=>nil, "current_billing_period"=>{"ends_at"=>"2024-11-23T02:51:37.163694Z", "starts_at"=>"2024-10-23T02:51:37.163694Z"}}, "event_id"=>"evt_01javmjygkmytnanbjbkx47h6z", "event_type"=>"subscription.activated", "occurred_at"=>"2024-10-23T02:51:38.899961Z", "notification_id"=>"ntf_01javmjymkbcaekpqfh92jhscq", "paddle_billing"=>{"data"=>{"id"=>"sub_01javmjxeax84dxdy5rmp3r47s", "items"=>[{"price"=>{"id"=>"pri_01j31vccj0pp48wjhspa20kjp2", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "quantity"=>{"maximum"=>1, "minimum"=>1}, "tax_mode"=>"account_setting", "seller_id"=>"21184", "created_at"=>"2024-07-18T02:40:15.936926Z", "product_id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "unit_price"=>{"amount"=>"1500", "currency_code"=>"USD"}, "updated_at"=>"2024-07-18T20:41:17.49105Z", "custom_data"=>nil, "description"=>"Monthly Pro Plan", "import_meta"=>nil, "trial_period"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "unit_price_overrides"=>[]}, "status"=>"active", "product"=>{"id"=>"pro_01j31v5rc3trh19b6z87wpsk6k", "name"=>"Pro Plan", "type"=>"standard", "status"=>"active", "image_url"=>nil, "seller_id"=>"21184", "created_at"=>"2024-07-18T02:36:38.659Z", "updated_at"=>"2024-10-04T02:55:44.147Z", "custom_data"=>nil, "description"=>nil, "import_meta"=>nil, "tax_category"=>"saas"}, "quantity"=>1, "recurring"=>true, "created_at"=>"2024-10-23T02:51:37.802Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "trial_dates"=>nil, "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "previously_billed_at"=>"2024-10-23T02:51:37.163694Z"}], "status"=>"active", "discount"=>nil, "paused_at"=>nil, "address_id"=>"add_01javmj875ykcnw5962fy7epaq", "created_at"=>"2024-10-23T02:51:37.802Z", "started_at"=>"2024-10-23T02:51:37.163694Z", "updated_at"=>"2024-10-23T02:51:37.802Z", "business_id"=>nil, "canceled_at"=>nil, "custom_data"=>nil, "customer_id"=>"ctm_01javmgfq796j6k2mraxa8p8xs", "import_meta"=>nil, "billing_cycle"=>{"interval"=>"month", "frequency"=>1}, "currency_code"=>"USD", "next_billed_at"=>"2024-11-23T02:51:37.163694Z", "billing_details"=>nil, "collection_mode"=>"automatic", "first_billed_at"=>"2024-10-23T02:51:37.163694Z", "scheduled_change"=>nil, "current_billing_period"=>{"ends_at"=>"2024-11-23T02:51:37.163694Z", "starts_at"=>"2024-10-23T02:51:37.163694Z"}}, "event_id"=>"evt_01javmjygkmytnanbjbkx47h6z", "event_type"=>"subscription.activated", "occurred_at"=>"2024-10-23T02:51:38.899961Z", "notification_id"=>"ntf_01javmjymkbcaekpqfh92jhscq"}} TRANSACTION (0.2ms) BEGIN Pay::Webhook Create (0.8ms) INSERT INTO "pay_webhooks" ("processor", "event_type", "event", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5) RETURNING "id" [["processor", "paddle_billing"], ["event_type", "subscription.activated"], ["event", "{\"data\":{\"id\":\"sub_01javmjxeax84dxdy5rmp3r47s\",\"items\":[{\"price\":{\"id\":\"pri_01j31vccj0pp48wjhspa20kjp2\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"quantity\":{\"maximum\":1,\"minimum\":1},\"tax_mode\":\"account_setting\",\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:40:15.936926Z\",\"product_id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"unit_price\":{\"amount\":\"1500\",\"currency_code\":\"USD\"},\"updated_at\":\"2024-07-18T20:41:17.49105Z\",\"custom_data\":null,\"description\":\"Monthly Pro Plan\",\"import_meta\":null,\"trial_period\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"unit_price_overrides\":[]},\"status\":\"active\",\"product\":{\"id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"image_url\":null,\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:36:38.659Z\",\"updated_at\":\"2024-10-04T02:55:44.147Z\",\"custom_data\":null,\"description\":null,\"import_meta\":null,\"tax_category\":\"saas\"},\"quantity\":1,\"recurring\":true,\"created_at\":\"2024-10-23T02:51:37.802Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"trial_dates\":null,\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"previously_billed_at\":\"2024-10-23T02:51:37.163694Z\"}],\"status\":\"active\",\"discount\":null,\"paused_at\":null,\"address_id\":\"add_01javmj875ykcnw5962fy7epaq\",\"created_at\":\"2024-10-23T02:51:37.802Z\",\"started_at\":\"2024-10-23T02:51:37.163694Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"business_id\":null,\"canceled_at\":null,\"custom_data\":null,\"customer_id\":\"ctm_01javmgfq796j6k2mraxa8p8xs\",\"import_meta\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"currency_code\":\"USD\",\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"billing_details\":null,\"collection_mode\":\"automatic\",\"first_billed_at\":\"2024-10-23T02:51:37.163694Z\",\"scheduled_change\":null,\"current_billing_period\":{\"ends_at\":\"2024-11-23T02:51:37.163694Z\",\"starts_at\":\"2024-10-23T02:51:37.163694Z\"}},\"event_id\":\"evt_01javmjygkmytnanbjbkx47h6z\",\"event_type\":\"subscription.activated\",\"occurred_at\":\"2024-10-23T02:51:38.899961Z\",\"notification_id\":\"ntf_01javmjymkbcaekpqfh92jhscq\",\"paddle_billing\":{\"data\":{\"id\":\"sub_01javmjxeax84dxdy5rmp3r47s\",\"items\":[{\"price\":{\"id\":\"pri_01j31vccj0pp48wjhspa20kjp2\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"quantity\":{\"maximum\":1,\"minimum\":1},\"tax_mode\":\"account_setting\",\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:40:15.936926Z\",\"product_id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"unit_price\":{\"amount\":\"1500\",\"currency_code\":\"USD\"},\"updated_at\":\"2024-07-18T20:41:17.49105Z\",\"custom_data\":null,\"description\":\"Monthly Pro Plan\",\"import_meta\":null,\"trial_period\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"unit_price_overrides\":[]},\"status\":\"active\",\"product\":{\"id\":\"pro_01j31v5rc3trh19b6z87wpsk6k\",\"name\":\"Pro Plan\",\"type\":\"standard\",\"status\":\"active\",\"image_url\":null,\"seller_id\":\"21184\",\"created_at\":\"2024-07-18T02:36:38.659Z\",\"updated_at\":\"2024-10-04T02:55:44.147Z\",\"custom_data\":null,\"description\":null,\"import_meta\":null,\"tax_category\":\"saas\"},\"quantity\":1,\"recurring\":true,\"created_at\":\"2024-10-23T02:51:37.802Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"trial_dates\":null,\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"previously_billed_at\":\"2024-10-23T02:51:37.163694Z\"}],\"status\":\"active\",\"discount\":null,\"paused_at\":null,\"address_id\":\"add_01javmj875ykcnw5962fy7epaq\",\"created_at\":\"2024-10-23T02:51:37.802Z\",\"started_at\":\"2024-10-23T02:51:37.163694Z\",\"updated_at\":\"2024-10-23T02:51:37.802Z\",\"business_id\":null,\"canceled_at\":null,\"custom_data\":null,\"customer_id\":\"ctm_01javmgfq796j6k2mraxa8p8xs\",\"import_meta\":null,\"billing_cycle\":{\"interval\":\"month\",\"frequency\":1},\"currency_code\":\"USD\",\"next_billed_at\":\"2024-11-23T02:51:37.163694Z\",\"billing_details\":null,\"collection_mode\":\"automatic\",\"first_billed_at\":\"2024-10-23T02:51:37.163694Z\",\"scheduled_change\":null,\"current_billing_period\":{\"ends_at\":\"2024-11-23T02:51:37.163694Z\",\"starts_at\":\"2024-10-23T02:51:37.163694Z\"}},\"event_id\":\"evt_01javmjygkmytnanbjbkx47h6z\",\"event_type\":\"subscription.activated\",\"occurred_at\":\"2024-10-23T02:51:38.899961Z\",\"notification_id\":\"ntf_01javmjymkbcaekpqfh92jhscq\"}}"], ["created_at", "2024-10-23 02:51:39.242094"], ["updated_at", "2024-10-23 02:51:39.242094"]] TRANSACTION (0.5ms) COMMIT [ActiveJob] TRANSACTION (0.2ms) BEGIN [ActiveJob] GoodJob::Job Create (0.7ms) INSERT INTO "good_jobs" ("id", "queue_name", "priority", "serialized_params", "scheduled_at", "performed_at", "finished_at", "error", "created_at", "updated_at", "active_job_id", "concurrency_key", "cron_key", "cron_at", "batch_id", "batch_callback_id", "executions_count", "job_class", "error_event", "labels", "locked_by_id", "locked_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) RETURNING "id" [["id", "e31efbe3-2c81-476d-b889-fcc24d739868"], ["queue_name", "default"], ["priority", 0], ["serialized_params", "{\"job_class\":\"Pay::Webhooks::ProcessJob\",\"job_id\":\"e31efbe3-2c81-476d-b889-fcc24d739868\",\"provider_job_id\":null,\"queue_name\":\"default\",\"priority\":null,\"arguments\":[{\"_aj_globalid\":\"gid://coda/Pay::Webhook/5c5cd557-2aef-42a0-a477-89ab13b0ec80\"}],\"executions\":0,\"exception_executions\":{},\"locale\":\"en\",\"timezone\":\"UTC\",\"enqueued_at\":\"2024-10-23T02:51:39Z\"}"], ["scheduled_at", "2024-10-23 02:51:39.247077"], ["performed_at", nil], ["finished_at", nil], ["error", nil], ["created_at", "2024-10-23 02:51:39.247077"], ["updated_at", "2024-10-23 02:51:39.247243"], ["active_job_id", "e31efbe3-2c81-476d-b889-fcc24d739868"], ["concurrency_key", "[FILTERED]"], ["cron_key", "[FILTERED]"], ["cron_at", nil], ["batch_id", nil], ["batch_callback_id", nil], ["executions_count", nil], ["job_class", "Pay::Webhooks::ProcessJob"], ["error_event", nil], ["labels", nil], ["locked_by_id", nil], ["locked_at", nil]] [ActiveJob] TRANSACTION (0.3ms) COMMIT [ActiveJob] Enqueued Pay::Webhooks::ProcessJob (Job ID: e31efbe3-2c81-476d-b889-fcc24d739868) to GoodJob(default) with arguments: #<GlobalID:0x0000000108b62840 @uri=#<URI::GID gid://coda/Pay::Webhook/5c5cd557-2aef-42a0-a477-89ab13b0ec80>> Completed 200 OK in 11ms (ActiveRecord: 2.7ms | Allocations: 14050)

GoodJob::Job Load (3.1ms) SELECT "good_jobs"."id", "good_jobs"."queue_name", "good_jobs"."priority", "good_jobs"."serialized_params", "good_jobs"."scheduled_at", "good_jobs"."performed_at", "good_jobs"."finished_at", "good_jobs"."error", "good_jobs"."created_at", "good_jobs"."updated_at", "good_jobs"."active_job_id", "good_jobs"."concurrency_key", "good_jobs"."cron_key", "good_jobs"."cron_at", "good_jobs"."batch_id", "good_jobs"."batch_callback_id", "good_jobs"."executions_count", "good_jobs"."job_class", "good_jobs"."error_event", "good_jobs"."labels", "good_jobs"."locked_by_id", "good_jobs"."locked_at" FROM "good_jobs" WHERE "good_jobs"."id" IN (WITH "rows" AS MATERIALIZED (SELECT "good_jobs"."id" FROM "good_jobs" WHERE "good_jobs"."finished_at" IS NULL AND ("good_jobs"."scheduled_at" <= $1 OR "good_jobs"."scheduled_at" IS NULL) ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC) SELECT "rows"."id" FROM "rows" WHERE pg_try_advisory_lock(('x' || substr(md5('good_jobs' || '-' || "rows"."id"::text), 1, 16))::bit(64)::bigint) LIMIT $2) ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC [["scheduled_at", "2024-10-23 02:51:39.258930"], ["LIMIT", 1]] GoodJob::Job Load (0.4ms) SELECT "good_jobs"."id", "good_jobs"."queue_name", "good_jobs"."priority", "good_jobs"."serialized_params", "good_jobs"."scheduled_at", "good_jobs"."performed_at", "good_jobs"."finished_at", "good_jobs"."error", "good_jobs"."created_at", "good_jobs"."updated_at", "good_jobs"."active_job_id", "good_jobs"."concurrency_key", "good_jobs"."cron_key", "good_jobs"."cron_at", "good_jobs"."batch_id", "good_jobs"."batch_callback_id", "good_jobs"."executions_count", "good_jobs"."job_class", "good_jobs"."error_event", "good_jobs"."labels", "good_jobs"."locked_by_id", "good_jobs"."locked_at" FROM "good_jobs" WHERE "good_jobs"."id" = $1 LIMIT $2 [["id", "9ab6a656-a271-4dc5-87dd-228bf2ce631f"], ["LIMIT", 1]] TRANSACTION (0.3ms) BEGIN GoodJob::Job Load (4.3ms) SELECT "good_jobs"."id", "good_jobs"."queue_name", "good_jobs"."priority", "good_jobs"."serialized_params", "good_jobs"."scheduled_at", "good_jobs"."performed_at", "good_jobs"."finished_at", "good_jobs"."error", "good_jobs"."created_at", "good_jobs"."updated_at", "good_jobs"."active_job_id", "good_jobs"."concurrency_key", "good_jobs"."cron_key", "good_jobs"."cron_at", "good_jobs"."batch_id", "good_jobs"."batch_callback_id", "good_jobs"."executions_count", "good_jobs"."job_class", "good_jobs"."error_event", "good_jobs"."labels", "good_jobs"."locked_by_id", "good_jobs"."locked_at" FROM "good_jobs" WHERE "good_jobs"."id" IN (WITH "rows" AS MATERIALIZED (SELECT "good_jobs"."id" FROM "good_jobs" WHERE "good_jobs"."finished_at" IS NULL AND ("good_jobs"."scheduled_at" <= $1 OR "good_jobs"."scheduled_at" IS NULL) ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC) SELECT "rows"."id" FROM "rows" WHERE pg_try_advisory_lock(('x' || substr(md5('good_jobs' || '-' || "rows"."id"::text), 1, 16))::bit(64)::bigint) LIMIT $2) ORDER BY priority ASC NULLS LAST, "good_jobs"."created_at" ASC [["scheduled_at", "2024-10-23 02:51:39.270069"], ["LIMIT", 1]] GoodJob::Job Load (0.4ms) SELECT "good_jobs"."id", "good_jobs"."queue_name", "good_jobs"."priority", "good_jobs"."serialized_params", "good_jobs"."scheduled_at", "good_jobs"."performed_at", "good_jobs"."finished_at", "good_jobs"."error", "good_jobs"."created_at", "good_jobs"."updated_at", "good_jobs"."active_job_id", "good_jobs"."concurrency_key", "good_jobs"."cron_key", "good_jobs"."cron_at", "good_jobs"."batch_id", "good_jobs"."batch_callback_id", "good_jobs"."executions_count", "good_jobs"."job_class", "good_jobs"."error_event", "good_jobs"."labels", "good_jobs"."locked_by_id", "good_jobs"."locked_at" FROM "good_jobs" WHERE "good_jobs"."id" = $1 LIMIT $2 [["id", "e31efbe3-2c81-476d-b889-fcc24d739868"], ["LIMIT", 1]] TRANSACTION (0.2ms) BEGIN GoodJob::Execution Create (1.1ms) INSERT INTO "good_job_executions" ("created_at", "updated_at", "active_job_id", "job_class", "queue_name", "serialized_params", "scheduled_at", "finished_at", "error", "error_event", "error_backtrace", "process_id", "duration") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING "id" [["created_at", "2024-10-23 02:51:39.264658"], ["updated_at", "2024-10-23 02:51:39.278248"], ["active_job_id", "9ab6a656-a271-4dc5-87dd-228bf2ce631f"], ["job_class", "Pay::Webhooks::ProcessJob"], ["queue_name", "default"], ["serialized_params", "{\"job_id\":\"9ab6a656-a271-4dc5-87dd-228bf2ce631f\",\"locale\":\"en\",\"priority\":null,\"timezone\":\"UTC\",\"arguments\":[{\"_aj_globalid\":\"gid://coda/Pay::Webhook/40e41e68-e320-46b8-a21c-3826cb23b732\"}],\"job_class\":\"Pay::Webhooks::ProcessJob\",\"executions\":0,\"queue_name\":\"default\",\"enqueued_at\":\"2024-10-23T02:51:39Z\",\"provider_job_id\":null,\"exception_executions\":{}}"], ["scheduled_at", "2024-10-23 02:51:39.208988"], ["finished_at", nil], ["error", nil], ["error_event", nil], ["error_backtrace", nil], ["process_id", "fcb5e591-7dd2-479c-857b-133a2484bb85"], ["duration", nil]] GoodJob::Execution Create (1.0ms) INSERT INTO "good_job_executions" ("created_at", "updated_at", "active_job_id", "job_class", "queue_name", "serialized_params", "scheduled_at", "finished_at", "error", "error_event", "error_backtrace", "process_id", "duration") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13) RETURNING "id" [["created_at", "2024-10-23 02:51:39.277285"], ["updated_at", "2024-10-23 02:51:39.278770"], ["active_job_id", "e31efbe3-2c81-476d-b889-fcc24d739868"], ["job_class", "Pay::Webhooks::ProcessJob"], ["queue_name", "default"], ["serialized_params", "{\"job_id\":\"e31efbe3-2c81-476d-b889-fcc24d739868\",\"locale\":\"en\",\"priority\":null,\"timezone\":\"UTC\",\"arguments\":[{\"_aj_globalid\":\"gid://coda/Pay::Webhook/5c5cd557-2aef-42a0-a477-89ab13b0ec80\"}],\"job_class\":\"Pay::Webhooks::ProcessJob\",\"executions\":0,\"queue_name\":\"default\",\"enqueued_at\":\"2024-10-23T02:51:39Z\",\"provider_job_id\":null,\"exception_executions\":{}}"], ["scheduled_at", "2024-10-23 02:51:39.247077"], ["finished_at", nil], ["error", nil], ["error_event", nil], ["error_backtrace", nil], ["process_id", "fcb5e591-7dd2-479c-857b-133a2484bb85"], ["duration", nil]] GoodJob::Job Update (0.8ms) UPDATE "good_jobs" SET "performed_at" = $1, "updated_at" = $2, "executions_count" = $3, "locked_by_id" = $4, "locked_at" = $5 WHERE "good_jobs"."id" = $6 [["performed_at", "2024-10-23 02:51:39.264658"], ["updated_at", "2024-10-23 02:51:39.280351"], ["executions_count", 1], ["locked_by_id", "fcb5e591-7dd2-479c-857b-133a2484bb85"], ["locked_at", "2024-10-23 02:51:39.264772"], ["id", "9ab6a656-a271-4dc5-87dd-228bf2ce631f"]] GoodJob::Job Update (0.6ms) UPDATE "good_jobs" SET "performed_at" = $1, "updated_at" = $2, "executions_count" = $3, "locked_by_id" = $4, "locked_at" = $5 WHERE "good_jobs"."id" = $6 [["performed_at", "2024-10-23 02:51:39.277285"], ["updated_at", "2024-10-23 02:51:39.281238"], ["executions_count", 1], ["locked_by_id", "fcb5e591-7dd2-479c-857b-133a2484bb85"], ["locked_at", "2024-10-23 02:51:39.277383"], ["id", "e31efbe3-2c81-476d-b889-fcc24d739868"]] TRANSACTION (0.6ms) COMMIT TRANSACTION (0.9ms) COMMIT [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::Webhook Load (0.8ms) SELECT "pay_webhooks". FROM "pay_webhooks" WHERE "pay_webhooks"."id" = $1 LIMIT $2 [["id", "40e41e68-e320-46b8-a21c-3826cb23b732"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Performing Pay::Webhooks::ProcessJob (Job ID: 9ab6a656-a271-4dc5-87dd-228bf2ce631f) from GoodJob(default) enqueued at 2024-10-23T02:51:39Z with arguments: #<GlobalID:0x0000000108eca668 @uri=#<URI::GID gid://coda/Pay::Webhook/40e41e68-e320-46b8-a21c-3826cb23b732>> [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Pay::Webhook Load (1.4ms) SELECT "pay_webhooks". FROM "pay_webhooks" WHERE "pay_webhooks"."id" = $1 LIMIT $2 [["id", "5c5cd557-2aef-42a0-a477-89ab13b0ec80"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Performing Pay::Webhooks::ProcessJob (Job ID: e31efbe3-2c81-476d-b889-fcc24d739868) from GoodJob(default) enqueued at 2024-10-23T02:51:39Z with arguments: #<GlobalID:0x0000000108f13278 @uri=#<URI::GID gid://coda/Pay::Webhook/5c5cd557-2aef-42a0-a477-89ab13b0ec80>> [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::Customer Load (0.5ms) SELECT "pay_customers". FROM "pay_customers" WHERE "pay_customers"."processor" = $1 AND "pay_customers"."processor_id" = $2 LIMIT $3 [["processor", "paddle_billing"], ["processor_id", "ctm_01javmgfq796j6k2mraxa8p8xs"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Pay::Customer Load (1.1ms) SELECT "pay_customers". FROM "pay_customers" WHERE "pay_customers"."processor" = $1 AND "pay_customers"."processor_id" = $2 LIMIT $3 [["processor", "paddle_billing"], ["processor_id", "ctm_01javmgfq796j6k2mraxa8p8xs"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::PaddleBilling::Subscription Load (1.9ms) SELECT "pay_subscriptions". FROM "pay_subscriptions" WHERE "pay_subscriptions"."type" = $1 AND "pay_subscriptions"."customer_id" = $2 AND "pay_subscriptions"."processor_id" = $3 LIMIT $4 [["type", "Pay::PaddleBilling::Subscription"], ["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Pay::PaddleBilling::Subscription Load (1.7ms) SELECT "pay_subscriptions". FROM "pay_subscriptions" WHERE "pay_subscriptions"."type" = $1 AND "pay_subscriptions"."customer_id" = $2 AND "pay_subscriptions"."processor_id" = $3 LIMIT $4 [["type", "Pay::PaddleBilling::Subscription"], ["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] TRANSACTION (0.3ms) BEGIN [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] TRANSACTION (0.4ms) BEGIN [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::Subscription Exists? (0.6ms) SELECT 1 AS one FROM "pay_subscriptions" WHERE "pay_subscriptions"."processor_id" = $1 AND "pay_subscriptions"."customer_id" = $2 LIMIT $3 [["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Pay::Subscription Exists? (1.1ms) SELECT 1 AS one FROM "pay_subscriptions" WHERE "pay_subscriptions"."processor_id" = $1 AND "pay_subscriptions"."customer_id" = $2 LIMIT $3 [["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["LIMIT", 1]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::PaddleBilling::Subscription Create (0.9ms) INSERT INTO "pay_subscriptions" ("customer_id", "name", "processor_id", "processor_plan", "quantity", "status", "current_period_start", "current_period_end", "trial_ends_at", "ends_at", "metered", "pause_behavior", "pause_starts_at", "pause_resumes_at", "application_fee_percent", "metadata", "data", "stripe_account", "payment_method_id", "created_at", "updated_at", "type") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) RETURNING "id" [["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["name", "default"], ["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["processor_plan", "pri_01j31vccj0pp48wjhspa20kjp2"], ["quantity", 1], ["status", "active"], ["current_period_start", "2024-10-23 02:51:37.163694"], ["current_period_end", "2024-11-23 02:51:37.163694"], ["trial_ends_at", nil], ["ends_at", nil], ["metered", nil], ["pause_behavior", nil], ["pause_starts_at", nil], ["pause_resumes_at", nil], ["application_fee_percent", nil], ["metadata", nil], ["data", "{}"], ["stripe_account", nil], ["payment_method_id", nil], ["created_at", "2024-10-23 02:51:39.326535"], ["updated_at", "2024-10-23 02:51:39.326535"], ["type", "Pay::PaddleBilling::Subscription"]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] TRANSACTION (0.5ms) COMMIT [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] TRANSACTION (0.3ms) BEGIN [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Pay::PaddleBilling::Subscription Create (2.4ms) INSERT INTO "pay_subscriptions" ("customer_id", "name", "processor_id", "processor_plan", "quantity", "status", "current_period_start", "current_period_end", "trial_ends_at", "ends_at", "metered", "pause_behavior", "pause_starts_at", "pause_resumes_at", "application_fee_percent", "metadata", "data", "stripe_account", "payment_method_id", "created_at", "updated_at", "type") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22) RETURNING "id" [["customer_id", "4bb97797-0cfa-4c37-b524-0147bf6de1bb"], ["name", "default"], ["processor_id", "sub_01javmjxeax84dxdy5rmp3r47s"], ["processor_plan", "pri_01j31vccj0pp48wjhspa20kjp2"], ["quantity", 1], ["status", "active"], ["current_period_start", "2024-10-23 02:51:37.163694"], ["current_period_end", "2024-11-23 02:51:37.163694"], ["trial_ends_at", nil], ["ends_at", nil], ["metered", nil], ["pause_behavior", nil], ["pause_starts_at", nil], ["pause_resumes_at", nil], ["application_fee_percent", nil], ["metadata", nil], ["data", "{}"], ["stripe_account", nil], ["payment_method_id", nil], ["created_at", "2024-10-23 02:51:39.327538"], ["updated_at", "2024-10-23 02:51:39.327538"], ["type", "Pay::PaddleBilling::Subscription"]] [ActiveJob] [Pay::Webhooks::ProcessJob] [9ab6a656-a271-4dc5-87dd-228bf2ce631f] Pay::Webhook Destroy (0.5ms) DELETE FROM "pay_webhooks" WHERE "pay_webhooks"."id" = $1 [["id", "40e41e68-e320-46b8-a21c-3826cb23b732"]] [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] TRANSACTION (4.8ms) ROLLBACK [ActiveJob] [Pay::Webhooks::ProcessJob] [e31efbe3-2c81-476d-b889-fcc24d739868] Error performing Pay::Webhooks::ProcessJob (Job ID: e31efbe3-2c81-476d-b889-fcc24d739868) from GoodJob(default) in 42.69ms: ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_pay_subscriptions_on_customer_id_and_processor_id" DETAIL: Key (customer_id, processor_id)=(4bb97797-0cfa-4c37-b524-0147bf6de1bb, sub_01javmjxeax84dxdy5rmp3r47s) already exists. ):

Checklist:

excid3 commented 3 hours ago

Please provide the full stacktrace for the error in the job.

codadrop commented 2 hours ago

Hi Chris: Let me know if I can provide more info

/Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:768:in exec_params' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:768:inblock (2 levels) in exec_no_cache' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/share_lock.rb:187:in yield_shares' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/dependencies/interlock.rb:41:inpermit_concurrent_loads' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:767:in block in exec_no_cache' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inhandle_interrupt' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:inhandle_interrupt' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract_adapter.rb:752:inblock in log' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/instrumenter.rb:24:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract_adapter.rb:743:inlog' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:766:in exec_no_cache' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql_adapter.rb:745:inexecute_and_clear' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:54:in exec_query' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/database_statements.rb:132:inexec_insert' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/postgresql/database_statements.rb:88:in exec_insert' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/database_statements.rb:167:ininsert' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/query_cache.rb:22:in insert' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/persistence.rb:496:in_insert_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/persistence.rb:1098:in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/counter_cache.rb:166:in_create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/locking/optimistic.rb:84:in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/attribute_methods/dirty.rb:222:in_create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/callbacks.rb:459:in block in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:107:inrun_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:929:in _run_create_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/callbacks.rb:459:in_create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/timestamp.rb:108:in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/persistence.rb:1069:increate_or_update' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/callbacks.rb:455:in block in create_or_update' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:118:inblock in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/autosave_association.rb:370:in around_save_collection_association' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:inblock in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:138:in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:929:in_run_save_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/callbacks.rb:455:in create_or_update' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/timestamp.rb:126:increate_or_update' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/persistence.rb:648:in save!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/validations.rb:53:insave!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/transactions.rb:302:in block in save!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/transactions.rb:354:inblock in with_transaction_returning_status' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/database_statements.rb:314:in transaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/transactions.rb:350:inwith_transaction_returning_status' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/transactions.rb:302:in save!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/suppressor.rb:54:insave!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:365:in insert_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/has_many_association.rb:58:ininsert_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:352:in block (2 levels) in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:456:inreplace_on_target' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:272:in add_to_target' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:351:inblock in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/transaction.rb:319:in block in within_new_transaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inhandle_interrupt' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in block in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:inhandle_interrupt' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/transaction.rb:317:inwithin_new_transaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in transaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/transactions.rb:209:intransaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:308:in transaction' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_association.rb:349:in_create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/has_many_association.rb:140:in _create_record' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/association.rb:208:increate!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/associations/collection_proxy.rb:364:in create!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/app/models/pay/paddle_billing/subscription.rb:63:insync' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/lib/pay/paddle_billing/webhooks/subscription.rb:6:in call' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/lib/pay/webhooks/delegator.rb:50:incall' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:236:in finish' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:76:inblock in finish' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:91:in block in iterate_guarding_exceptions' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:90:ineach' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:90:in iterate_guarding_exceptions' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/fanout.rb:76:infinish' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/instrumenter.rb:49:in finish_with_state' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/instrumenter.rb:30:ininstrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications.rb:206:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/lib/pay/webhooks/delegator.rb:35:ininstrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/lib/pay/webhooks.rb:7:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/app/models/pay/webhook.rb:8:inprocess!' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/pay-8.1.2/lib/pay/webhooks/process_job.rb:5:in perform' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/execution.rb:65:inblock in _perform_job' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:118:in block in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/i18n-1.14.5/lib/i18n.rb:351:inwith_locale' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/translation.rb:9:in block (2 levels) in <module:Translation>' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:ininstance_exec' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:in block in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/core_ext/time/zones.rb:65:inuse_zone' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/timezones.rb:9:in block (2 levels) in <module:Timezones>' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:ininstance_exec' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:in block in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:138:inrun_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/execution.rb:64:in _perform_job' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/instrumentation.rb:20:in_perform_job' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/execution.rb:52:in perform_now' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/instrumentation.rb:14:inblock in perform_now' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/instrumentation.rb:25:in block in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications.rb:206:inblock in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/instrumenter.rb:24:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications.rb:206:ininstrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/instrumentation.rb:35:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/instrumentation.rb:14:inperform_now' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/logging.rb:18:in block in perform_now' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/tagged_logging.rb:99:inblock in tagged' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/tagged_logging.rb:37:in tagged' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/tagged_logging.rb:99:intagged' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/logging.rb:25:in tag_logger' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/logging.rb:18:inperform_now' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/execution.rb:30:in block in execute' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:118:inblock in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/railtie.rb:54:in block (4 levels) in <class:Railtie>' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/execution_wrapper.rb:92:inwrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:72:in block in wrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/execution_wrapper.rb:88:inwrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:71:in wrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/railtie.rb:53:inblock (3 levels) in ' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:in instance_exec' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:inblock in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:138:in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activejob-7.0.8.4/lib/active_job/execution.rb:28:inexecute' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:600:in block (3 levels) in perform' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications.rb:206:inblock in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications/instrumenter.rb:24:in instrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/notifications.rb:206:ininstrument' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:599:in block (2 levels) in perform' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/current_thread.rb:113:inwithin' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:557:in block in perform' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:118:inblock in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/batch.rb:80:in within_thread' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:742:inreset_batch_values' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:127:in block in run_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/callbacks.rb:138:inrun_callbacks' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:551:in perform' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:299:inblock in perform_with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/concerns/good_job/advisory_lockable.rb:172:in block in with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:881:in_scoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:428:in scoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/scoping/default.rb:43:inunscoped' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/concerns/good_job/advisory_lockable.rb:172:in with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation/delegation.rb:67:inblock in with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:881:in _scoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:428:inscoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation/delegation.rb:67:in with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/app/models/good_job/job.rb:293:inperform_with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation/delegation.rb:67:in block in perform_with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:881:in_scoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation.rb:428:in scoping' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activerecord-7.0.8.4/lib/active_record/relation/delegation.rb:67:inperform_with_advisory_lock' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/job_performer.rb:35:in block in next' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/capsule_tracker.rb:103:inregister' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/job_performer.rb:34:in next' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/scheduler.rb:276:inblock (2 levels) in create_task' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/execution_wrapper.rb:92:in wrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:72:inblock in wrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/execution_wrapper.rb:92:in wrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/activesupport-7.0.8.4/lib/active_support/reloader.rb:71:inwrap' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/good_job-4.3.0/lib/good_job/scheduler.rb:275:in block in create_task' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:24:inblock in execute' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in block in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:insynchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/synchronization/mutex_lockable_object.rb:48:in synchronize' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/safe_task_executor.rb:22:inexecute' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/ivar.rb:170:in safe_execute' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/scheduled_task.rb:298:inprocess_task' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/timer_set.rb:98:in block in ns_post_task' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:inrun_task' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in block (3 levels) in create_worker' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:inloop' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in block (2 levels) in create_worker' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:incatch' /Users/s/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/concurrent-ruby-1.3.3/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in `block in create_worker'

codadrop commented 2 hours ago

Also, I think I mis-titled the issue. I'm not sure the problem is in the charge method, and I now think it may be in the subscription.

excid3 commented 2 hours ago

Thanks!