chatwoot / chatwoot

Open-source live-chat, email support, omni-channel desk. An alternative to Intercom, Zendesk, Salesforce Service Cloud etc. 🔥💬
https://www.chatwoot.com/help-center
Other
21.24k stars 3.58k forks source link

Error performing Webhooks::InstagramEventsJob #5906

Closed alex4o closed 1 year ago

alex4o commented 1 year ago

Describe the bug

I have setup an instagram connection for chatwoot. But when I send a message this is what I see.

To Reproduce

Steps to reproduce the behavior:

Setup a facebook app, and add the instagram webhook.

Expected behavior

See the messages that were send properly.

image When I run this test the message appears fine. Facebook messages appear fine too.

Server logs This is the file where it fails: https://github.com/chatwoot/chatwoot/blob/develop/app/jobs/webhooks/instagram_events_job.rb

rails_1     | I, [2022-11-20T06:43:01.412932 #1]  INFO -- : [9ac0d561-7d39-42e0-9722-b8e268176467]   Parameters: {"object"=>"instagram", "entry"=>[{"time"=>1668926581011, "id"=>"17841456778752687", "standby"=>[{"sender"=>{"id"=>"8422491661125971"}, "recipient"=>{"id"=>"17841456778752687"}, "timestamp"=>1668926580365, "message"=>{"mid"=>"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD", "text"=>"Hello"}}]}], "instagram"=>{"object"=>"instagram", "entry"=>[{"time"=>1668926581011, "id"=>"17841456778752687", "standby"=>[{"sender"=>{"id"=>"8422491661125971"}, "recipient"=>{"id"=>"17841456778752687"}, "timestamp"=>1668926580365, "message"=>{"mid"=>"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD", "text"=>"Hello"}}]}]}}
rails_1     | I, [2022-11-20T06:43:01.413646 #1]  INFO -- : [9ac0d561-7d39-42e0-9722-b8e268176467] Instagram webhook received events
sidekiq_1   | 2022-11-20T06:43:01.416Z pid=1 tid=2fi1 class=Webhooks::InstagramEventsJob jid=ee44ed7515635503f9b7c0ab INFO: start
rails_1     | I, [2022-11-20T06:43:01.416164 #1]  INFO -- : [9ac0d561-7d39-42e0-9722-b8e268176467] [ActiveJob] Enqueued Webhooks::InstagramEventsJob (Job ID: 6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a) to Sidekiq(default) with arguments: [{"time"=>1668926581011, "id"=>"17841456778752687", "standby"=>[{"sender"=>{"id"=>"8422491661125971"}, "recipient"=>{"id"=>"17841456778752687"}, "timestamp"=>1668926580365, "message"=>{"mid"=>"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD", "text"=>"Hello"}}]}]
rails_1     | I, [2022-11-20T06:43:01.417316 #1]  INFO -- : [9ac0d561-7d39-42e0-9722-b8e268176467] Completed 200 OK in 4ms (Views: 0.5ms | ActiveRecord: 0.0ms | Allocations: 889)
rails_1     | I, [2022-11-20T06:43:01.417822 #1]  INFO -- : source=rack-timeout id=9ac0d561-7d39-42e0-9722-b8e268176467 timeout=15000ms service=11ms state=completed
sidekiq_1   | I, [2022-11-20T06:43:01.418262 #1]  INFO -- : [ActiveJob] [Webhooks::InstagramEventsJob] [6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a] Performing Webhooks::InstagramEventsJob (Job ID: 6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a) from Sidekiq(default) enqueued at 2022-11-20T06:43:01Z with arguments: [{"time"=>1668926581011, "id"=>"17841456778752687", "standby"=>[{"sender"=>{"id"=>"8422491661125971"}, "recipient"=>{"id"=>"17841456778752687"}, "timestamp"=>1668926580365, "message"=>{"mid"=>"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD", "text"=>"Hello"}}]}]
sidekiq_1   | E, [2022-11-20T06:43:01.420721 #1] ERROR -- : [ActiveJob] [Webhooks::InstagramEventsJob] [6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a] Error performing Webhooks::InstagramEventsJob (Job ID: 6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a) from Sidekiq(default) in 2.1ms: NoMethodError (undefined method `each' for nil:NilClass):
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:17:in `block in perform'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `each'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:48:in `block in perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/i18n-1.11.0/lib/i18n.rb:322:in `with_locale'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:31:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `block in tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:37:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:47:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-rails-5.3.1/lib/sentry/rails/active_job.rb:6:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:25:in `block in execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:23:in `execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-sidekiq-5.3.1/lib/sentry/sidekiq/sentry_context_middleware.rb:7:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:114:in `local'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:14:in `block in call'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:81:in `global'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:39:in `prepare'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:56:in `watchdog'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:65:in `block in safe_thread'
sidekiq_1   | 2022-11-20T06:43:01.422Z pid=1 tid=2fi1 class=Webhooks::InstagramEventsJob jid=ee44ed7515635503f9b7c0ab elapsed=0.006 INFO: fail
sidekiq_1   | 2022-11-20T06:43:01.422Z pid=1 tid=2fi1 WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"default","class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"Webhooks::InstagramEventsJob","args":[{"job_class":"Webhooks::InstagramEventsJob","job_id":"6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[[{"time":1668926581011,"id":"17841456778752687","standby":[{"sender":{"id":"8422491661125971","_aj_hash_with_indifferent_access":true},"recipient":{"id":"17841456778752687","_aj_hash_with_indifferent_access":true},"timestamp":1668926580365,"message":{"mid":"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD","text":"Hello","_aj_hash_with_indifferent_access":true},"_aj_hash_with_indifferent_access":true}],"_aj_hash_with_indifferent_access":true}]],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2022-11-20T06:43:01Z"}],"jid":"ee44ed7515635503f9b7c0ab","created_at":1668926581.414649,"enqueued_at":1668926581.4149902},"jobstr":"{\"retry\":true,\"queue\":\"default\",\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"wrapped\":\"Webhooks::InstagramEventsJob\",\"args\":[{\"job_class\":\"Webhooks::InstagramEventsJob\",\"job_id\":\"6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a\",\"provider_job_id\":null,\"queue_name\":\"default\",\"priority\":null,\"arguments\":[[{\"time\":1668926581011,\"id\":\"17841456778752687\",\"standby\":[{\"sender\":{\"id\":\"8422491661125971\",\"_aj_hash_with_indifferent_access\":true},\"recipient\":{\"id\":\"17841456778752687\",\"_aj_hash_with_indifferent_access\":true},\"timestamp\":1668926580365,\"message\":{\"mid\":\"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD\",\"text\":\"Hello\",\"_aj_hash_with_indifferent_access\":true},\"_aj_hash_with_indifferent_access\":true}],\"_aj_hash_with_indifferent_access\":true}]],\"executions\":0,\"exception_executions\":{},\"locale\":\"en\",\"timezone\":\"UTC\",\"enqueued_at\":\"2022-11-20T06:43:01Z\"}],\"jid\":\"ee44ed7515635503f9b7c0ab\",\"created_at\":1668926581.414649,\"enqueued_at\":1668926581.4149902}"}
sidekiq_1   | 2022-11-20T06:43:01.422Z pid=1 tid=2fi1 WARN: NoMethodError: undefined method `each' for nil:NilClass
sidekiq_1   | 2022-11-20T06:43:01.422Z pid=1 tid=2fi1 WARN: /app/app/jobs/webhooks/instagram_events_job.rb:17:in `block in perform'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `each'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:48:in `block in perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/i18n-1.11.0/lib/i18n.rb:322:in `with_locale'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:31:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `block in tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:37:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:47:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-rails-5.3.1/lib/sentry/rails/active_job.rb:6:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:25:in `block in execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:23:in `execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-sidekiq-5.3.1/lib/sentry/sidekiq/sentry_context_middleware.rb:7:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:114:in `local'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:14:in `block in call'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:81:in `global'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:39:in `prepare'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:56:in `watchdog'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:65:in `block in safe_thread'
sidekiq_1   | I, [2022-11-20T06:43:07.333254 #1]  INFO -- : [ActiveJob] Enqueued Inboxes::FetchImapEmailInboxesJob (Job ID: 88108c32-d969-4f15-920a-4bd0e8d76994) to Sidekiq(scheduled_jobs)
sidekiq_1   | 2022-11-20T06:43:07.333Z pid=1 tid=2fch class=Inboxes::FetchImapEmailInboxesJob jid=bf7f07f287d4a78d2e262d35 INFO: start
sidekiq_1   | I, [2022-11-20T06:43:07.335544 #1]  INFO -- : [ActiveJob] [Inboxes::FetchImapEmailInboxesJob] [88108c32-d969-4f15-920a-4bd0e8d76994] Performing Inboxes::FetchImapEmailInboxesJob (Job ID: 88108c32-d969-4f15-920a-4bd0e8d76994) from Sidekiq(scheduled_jobs) enqueued at 2022-11-20T06:43:07Z
sidekiq_1   | I, [2022-11-20T06:43:07.340231 #1]  INFO -- : [ActiveJob] [Inboxes::FetchImapEmailInboxesJob] [88108c32-d969-4f15-920a-4bd0e8d76994] Performed Inboxes::FetchImapEmailInboxesJob (Job ID: 88108c32-d969-4f15-920a-4bd0e8d76994) from Sidekiq(scheduled_jobs) in 4.42ms
sidekiq_1   | 2022-11-20T06:43:07.341Z pid=1 tid=2fch class=Inboxes::FetchImapEmailInboxesJob jid=bf7f07f287d4a78d2e262d35 elapsed=0.007 INFO: done
rails_1     | I, [2022-11-20T06:43:16.403259 #1]  INFO -- : RoomChannel#update_presence
sidekiq_1   | 2022-11-20T06:43:20.850Z pid=1 tid=2f45 class=Webhooks::InstagramEventsJob jid=ee44ed7515635503f9b7c0ab INFO: start
sidekiq_1   | I, [2022-11-20T06:43:20.851960 #1]  INFO -- : [ActiveJob] [Webhooks::InstagramEventsJob] [6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a] Performing Webhooks::InstagramEventsJob (Job ID: 6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a) from Sidekiq(default) enqueued at 2022-11-20T06:43:01Z with arguments: [{"time"=>1668926581011, "id"=>"17841456778752687", "standby"=>[{"sender"=>{"id"=>"8422491661125971"}, "recipient"=>{"id"=>"17841456778752687"}, "timestamp"=>1668926580365, "message"=>{"mid"=>"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD", "text"=>"Hello"}}]}]
sidekiq_1   | E, [2022-11-20T06:43:20.854492 #1] ERROR -- : [ActiveJob] [Webhooks::InstagramEventsJob] [6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a] Error performing Webhooks::InstagramEventsJob (Job ID: 6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a) from Sidekiq(default) in 2.12ms: NoMethodError (undefined method `each' for nil:NilClass):
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:17:in `block in perform'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `each'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:48:in `block in perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/i18n-1.11.0/lib/i18n.rb:322:in `with_locale'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:31:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `block in tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:37:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:47:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-rails-5.3.1/lib/sentry/rails/active_job.rb:6:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:25:in `block in execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:23:in `execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-sidekiq-5.3.1/lib/sentry/sidekiq/sentry_context_middleware.rb:7:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:114:in `local'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:14:in `block in call'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:81:in `global'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:39:in `prepare'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:56:in `watchdog'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:65:in `block in safe_thread'
sidekiq_1   | 2022-11-20T06:43:20.856Z pid=1 tid=2f45 class=Webhooks::InstagramEventsJob jid=ee44ed7515635503f9b7c0ab elapsed=0.006 INFO: fail
sidekiq_1   | 2022-11-20T06:43:20.856Z pid=1 tid=2f45 WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"default","class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"Webhooks::InstagramEventsJob","args":[{"job_class":"Webhooks::InstagramEventsJob","job_id":"6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a","provider_job_id":null,"queue_name":"default","priority":null,"arguments":[[{"time":1668926581011,"id":"17841456778752687","standby":[{"sender":{"id":"8422491661125971","_aj_hash_with_indifferent_access":true},"recipient":{"id":"17841456778752687","_aj_hash_with_indifferent_access":true},"timestamp":1668926580365,"message":{"mid":"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD","text":"Hello","_aj_hash_with_indifferent_access":true},"_aj_hash_with_indifferent_access":true}],"_aj_hash_with_indifferent_access":true}]],"executions":0,"exception_executions":{},"locale":"en","timezone":"UTC","enqueued_at":"2022-11-20T06:43:01Z"}],"jid":"ee44ed7515635503f9b7c0ab","created_at":1668926581.414649,"enqueued_at":1668926600.84929,"error_message":"undefined method `each' for nil:NilClass","error_class":"NoMethodError","failed_at":1668926581.4211926,"retry_count":0},"jobstr":"{\"retry\":true,\"queue\":\"default\",\"class\":\"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper\",\"wrapped\":\"Webhooks::InstagramEventsJob\",\"args\":[{\"job_class\":\"Webhooks::InstagramEventsJob\",\"job_id\":\"6c591da9-ed21-4fd8-b4a8-e7442cfd2b5a\",\"provider_job_id\":null,\"queue_name\":\"default\",\"priority\":null,\"arguments\":[[{\"time\":1668926581011,\"id\":\"17841456778752687\",\"standby\":[{\"sender\":{\"id\":\"8422491661125971\",\"_aj_hash_with_indifferent_access\":true},\"recipient\":{\"id\":\"17841456778752687\",\"_aj_hash_with_indifferent_access\":true},\"timestamp\":1668926580365,\"message\":{\"mid\":\"aWdfZAG1faXRlbToxOklHTWVzc2FnZAUlEOjE3ODQxNDU2Nzc4NzUyNjg3OjM0MDI4MjM2Njg0MTcxMDMwMDk0OTEyODIyOTI1MDE3MzM4OTQ0MzozMDc4NjI2MTUwNTgxMDQ0MzU2NDA0MDQ0MjY0MzIxODQzMgZDZD\",\"text\":\"Hello\",\"_aj_hash_with_indifferent_access\":true},\"_aj_hash_with_indifferent_access\":true}],\"_aj_hash_with_indifferent_access\":true}]],\"executions\":0,\"exception_executions\":{},\"locale\":\"en\",\"timezone\":\"UTC\",\"enqueued_at\":\"2022-11-20T06:43:01Z\"}],\"jid\":\"ee44ed7515635503f9b7c0ab\",\"created_at\":1668926581.414649,\"enqueued_at\":1668926600.84929,\"error_message\":\"undefined method `each' for nil:NilClass\",\"error_class\":\"NoMethodError\",\"failed_at\":1668926581.4211926,\"retry_count\":0}"}
sidekiq_1   | 2022-11-20T06:43:20.857Z pid=1 tid=2f45 WARN: NoMethodError: undefined method `each' for nil:NilClass
sidekiq_1   | 2022-11-20T06:43:20.857Z pid=1 tid=2f45 WARN: /app/app/jobs/webhooks/instagram_events_job.rb:17:in `block in perform'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `each'
sidekiq_1   | /app/app/jobs/webhooks/instagram_events_job.rb:15:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:48:in `block in perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/i18n-1.11.0/lib/i18n.rb:322:in `with_locale'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/translation.rb:9:in `block (2 levels) in <module:Translation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/core_ext/time/zones.rb:66:in `use_zone'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/timezones.rb:9:in `block (2 levels) in <module:Timezones>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:21:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `block in instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/notifications.rb:203:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:31:in `instrument'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/instrumentation.rb:14:in `block (2 levels) in <module:Instrumentation>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `block in tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `block in tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:37:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/tagged_logging.rb:99:in `tagged'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:22:in `tag_logger'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/logging.rb:15:in `block (2 levels) in <module:Logging>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:47:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-rails-5.3.1/lib/sentry/rails/active_job.rb:6:in `perform_now'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:25:in `block in execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:117:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:47:in `block (4 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:87:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/railtie.rb:46:in `block (3 levels) in <class:Railtie>'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `instance_exec'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:126:in `block in run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/callbacks.rb:137:in `run_callbacks'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/execution.rb:23:in `execute'
sidekiq_1   | /gems/ruby/3.0.0/gems/activejob-6.1.6.1/lib/active_job/queue_adapters/sidekiq_adapter.rb:42:in `perform'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sentry-sidekiq-5.3.1/lib/sentry/sidekiq/sentry_context_middleware.rb:7:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:114:in `local'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:14:in `block in call'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:72:in `block in wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/execution_wrapper.rb:91:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/activesupport-6.1.6.1/lib/active_support/reloader.rb:71:in `wrap'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/rails.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_retry.rb:81:in `global'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/job_logger.rb:39:in `prepare'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:56:in `watchdog'
sidekiq_1   | /gems/ruby/3.0.0/gems/sidekiq-6.4.2/lib/sidekiq/util.rb:65:in `block in safe_thread'

Environment

Describe whether you are using Chatwoot Cloud (app.chatwoot.com) or a self-hosted installation of Chatwoot. If you are using a self-hosted installation of Chatwoot, describe the type of deployment (Docker/Linux VM installation/Heroku/Kubernetes/Other).

Desktop (please complete the following information) (If applicable)

Smartphone (please complete the following information) (If applicable)

Docker (If applicable)

Please share the output of the following.

Server: Containers: 5 Running: 4 Paused: 0 Stopped: 1 Images: 3 Server Version: 20.10.21 Storage Driver: btrfs Build Version: Btrfs v6.0 Library Version: 102 Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runtime.v1.linux runc io.containerd.runc.v2 Default Runtime: runc Init Binary: docker-init containerd version: 1c90a442489720eec95342e1789ee8a5e1b9536f runc version: v1.1.4-0-g5fd4c4d init version: de40ad0 Security Options: seccomp Profile: default cgroupns Kernel Version: 5.17.5-300.fc36.x86_64 Operating System: Fedora Linux 36 (Cloud Edition) OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.758GiB Name: vmi691347.contaboserver.net ID: VNJ7:HAVX:SMTW:G72O:SIYK:YWEW:6LYQ:7QCI:LJPH:XDOZ:ERWF:K3IW Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

- `docker-compose version` 

docker-compose version 1.29.2, build unknown docker-py version: 5.0.3 CPython version: 3.10.8 OpenSSL version: OpenSSL 3.0.5 5 Jul 2022



**Cloud Provider** (If applicable)
- [ ] AWS
- [ ] GCP
- [ ] Azure
- [ ] DigitalOcean
- [x] Others

**Additional context**

Add any other context about the problem here.
alex4o commented 1 year ago

Ok sry, fixed it https://www.chatwoot.com/docs/self-hosted/configuration/features/integrations/instagram-channel-setup please change this page with better description. Or if possible I will update the descriptions. I had added more permissions than needed.

You only need: message_reactions messages messaging_seen

tejaswinichile commented 1 year ago

It seems you had added standby messages; they are only helpful when your pages are connected to multiple apps. We have added it to some of our customers using various apps; it is only beneficial if you implement the handover protocol on top of this webhook.

@alex4o We will surely change the description, and if you have a better suggestion from the customer's point of view you are always welcome with the PR.

Thanks.

Closing this issue and creating one under https://github.com/chatwoot/docs with this ticket as a suggestion.

tejaswinichile commented 1 year ago

@alex4o If you are going to submit your app for review, make sure you do that on the live app. Facebook doesn't support test app webhook events for Instagram anymore. You can receive the Instagram message webhooks only when the app is in live mode.

https://developers.facebook.com/support/bugs/468852858104743/

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.