Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined method `type' for nil:NilClass #209

Open
mherasymiv-blackbird opened this issue Jan 18, 2024 · 6 comments
Open

Undefined method `type' for nil:NilClass #209

mherasymiv-blackbird opened this issue Jan 18, 2024 · 6 comments

Comments

@mherasymiv-blackbird
Copy link

mherasymiv-blackbird commented Jan 18, 2024

After upgrading deimos-ruby from 1.3.0-beta5 to 1.23.0 version in scope of Ruby upgrade we started getting an error

undefined method `type' for nil:NilClass

Backtrace:

\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_schema_coercer.rb:32:in `block in coerce_record'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_schema_coercer.rb:30:in `each'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_schema_coercer.rb:30:in `map'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_schema_coercer.rb:30:in `coerce_record'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_schema_coercer.rb:79:in `coerce_type'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/avro_base.rb:62:in `coerce_field'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/base.rb:74:in `block in coerce'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/base.rb:69:in `each'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/schema_backends/base.rb:69:in `coerce'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/message.rb:57:in `coerce_fields'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:193:in `_process_message'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:128:in `block (2 levels) in publish_list'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:128:in `each'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:128:in `block in publish_list'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/instrumentation.rb:36:in `block in instrument'\",
\"/usr/local/bundle/gems/activesupport-7.0.8/lib/active_support/notifications.rb:208:in `instrument'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/instrumentation.rb:35:in `instrument'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:121:in `publish_list'\",
\"/usr/local/bundle/gems/deimos-ruby-1.23.0/lib/deimos/producer.rb:101:in `publish'\",
\"/var/app/lib/kafka/producers/feed_items_producer.rb:20:in `publish'\", 

Payload:

{\"page_id\"=>17473736, \"flyer_run_id\"=>934249, \"merchant_id\"=>2393, \"google_category_id\"=>3814, \"current_price\"=>0.1199e2, \"original_price\"=>0.1199e2, \"name\"=>\"Bounty Paper Towels or Charmin Bath Tissue\", \"description\"=>\"Selected Varieties, Bounty, 6 Double or 4 Triple Roll or Charmin, 9 Mega, or 6 Super Mega Roll pkg.\\nWithout coupon $12.99\", \"brand\"=>nil, \"display_type\"=>\"ITEM\", \"pre_price_text\"=>nil, \"price_text\"=>\"DIGITAL COUPON\", \"sale_story\"=>nil, \"sku\"=>nil, \"url\"=>\"https://stopandshop.com/savings/weekly-ad/grid-view\", \"valid_from\"=>nil, \"valid_to\"=>nil, \"custom_ids\"=>[\"\", \"6329827\", \"Y\"], \"merchant_categories\"=>[\"Household Supplies\"], \"disclaimer_text\"=>nil, \"deleted\"=>false, \"timestamp\"=>\"2024-01-17T07:28:43-05:00\", \"message_id\"=>\"a5d8db04-bf54-4efa-b6f2-e53ce5fa983a\", \"created_at\"=>\"2024-01-17T07:28:42-05:00\", \"updated_at\"=>\"2024-01-17T07:28:42-05:00\", \"item_type\"=>\"flyer\", \"google_categories_hierarchy\"=>\"Home & Garden > Household Supplies > Household Paper Products > Paper Towels\", \"us_based\"=>true, \"position\"=>1, \"page_description\"=>\"24_03_M01__ABE\", \"preview_image_s3_key\"=>\"page_preview_images/36144120/output.png\", \"merchant_name\"=>\"Stop & Shop\", \"merchant_display_name\"=>\"Stop & Shop\", \"merchant_logo\"=>\"https://images.wishabi.net/merchants/RynVVkaos3cDrA==/RackMultipart20191009-1-1oe511e.jpg\", \"external_display_name\"=>\"WK 03\", \"flyer_item_ids\"=>[\"809166472\", \"809166530\", \"809166608\", \"809166682\", \"809166771\", \"809166840\", \"809166909\", \"809166989\", \"809167075\", \"809167148\", \"809167239\", \"809167330\", \"809167408\", \"809167480\", \"809167567\", \"809167656\", \"809167743\", \"809167823\", \"809167901\", \"809167965\", \"809168038\", \"809168117\", \"809168180\", \"809168259\", \"809168320\", \"809168386\", \"809168448\", \"809136197\", \"809136229\", \"809129182\"], \"flyer_ids\"=>[\"6210689\", \"6210690\", \"6210691\", \"6210692\", \"6210693\", \"6210694\", \"6210697\", \"6210698\", \"6210699\", \"6210700\", \"6210701\", \"6210702\", \"6210703\", \"6210704\", \"6210705\", \"6210706\", \"6210707\", \"6210708\", \"6210709\", \"6210710\", \"6210711\", \"6210713\", \"6210714\", \"6210715\", \"6210712\", \"6210716\", \"6210717\", \"6210728\", \"6210731\", \"6210499\"], \"flyer_item_ids_flyer_ids\"=>[{\"flyer_item_id\"=>\"809166472\", \"flyer_id\"=>\"6210689\"}, {\"flyer_item_id\"=>\"809166530\", \"flyer_id\"=>\"6210690\"}, {\"flyer_item_id\"=>\"809166608\", \"flyer_id\"=>\"6210691\"}, {\"flyer_item_id\"=>\"809166682\", \"flyer_id\"=>\"6210692\"}, {\"flyer_item_id\"=>\"809166771\", \"flyer_id\"=>\"6210693\"}, {\"flyer_item_id\"=>\"809166840\", \"flyer_id\"=>\"6210694\"}, {\"flyer_item_id\"=>\"809166909\", \"flyer_id\"=>\"6210697\"}, {\"flyer_item_id\"=>\"809166989\", \"flyer_id\"=>\"6210698\"}, {\"flyer_item_id\"=>\"809167075\", \"flyer_id\"=>\"6210699\"}, {\"flyer_item_id\"=>\"809167148\", \"flyer_id\"=>\"6210700\"}, {\"flyer_item_id\"=>\"809167239\", \"flyer_id\"=>\"6210701\"}, {\"flyer_item_id\"=>\"809167330\", \"flyer_id\"=>\"6210702\"}, {\"flyer_item_id\"=>\"809167408\", \"flyer_id\"=>\"6210703\"}, {\"flyer_item_id\"=>\"809167480\", \"flyer_id\"=>\"6210704\"}, {\"flyer_item_id\"=>\"809167567\", \"flyer_id\"=>\"6210705\"}, {\"flyer_item_id\"=>\"809167656\", \"flyer_id\"=>\"6210706\"}, {\"flyer_item_id\"=>\"809167743\", \"flyer_id\"=>\"6210707\"}, {\"flyer_item_id\"=>\"809167823\", \"flyer_id\"=>\"6210708\"}, {\"flyer_item_id\"=>\"809167901\", \"flyer_id\"=>\"6210709\"}, {\"flyer_item_id\"=>\"809167965\", \"flyer_id\"=>\"6210710\"}, {\"flyer_item_id\"=>\"809168038\", \"flyer_id\"=>\"6210711\"}, {\"flyer_item_id\"=>\"809168117\", \"flyer_id\"=>\"6210713\"}, {\"flyer_item_id\"=>\"809168180\", \"flyer_id\"=>\"6210714\"}, {\"flyer_item_id\"=>\"809168259\", \"flyer_id\"=>\"6210715\"}, {\"flyer_item_id\"=>\"809168320\", \"flyer_id\"=>\"6210712\"}, {\"flyer_item_id\"=>\"809168386\", \"flyer_id\"=>\"6210716\"}, {\"flyer_item_id\"=>\"809168448\", \"flyer_id\"=>\"6210717\"}, {\"flyer_item_id\"=>\"809136197\", \"flyer_id\"=>\"6210728\"}, {\"flyer_item_id\"=>\"809136229\", \"flyer_id\"=>\"6210731\"}, {\"flyer_item_id\"=>\"809129182\", \"flyer_id\"=>\"6210499\"}], \"flyer_info\"=>[{\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"ABE\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210689\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"BAN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210690\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"BAY\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210691\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"BFD\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210692\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"BYN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210693\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"CLF\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210694\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"EBK\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210697\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"ELZ\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210698\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"EMR\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210699\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"ESN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210700\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"ETN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210701\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"FMN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210702\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"FRD\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210703\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"HCK\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210704\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"JCT\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210705\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"KEY\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210706\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"MPL\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210707\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"MTW\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210708\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"PPL\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210709\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"RDW\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210710\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"SET\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210711\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"TMR\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210713\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"TOM\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210714\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"TRV\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210715\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"UNI\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210712\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"WHT\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210716\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"WSF\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210717\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"NOR\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210728\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"NWK\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210731\"}, {\"valid_to\"=>\"2024-01-18T23:59:59-05:00\", \"valid_from\"=>\"2024-01-12T00:00:00-05:00\", \"description\"=>\"ARN\", \"available_to\"=>\"2024-01-18T23:59:59-05:00\", \"available_from\"=>\"2024-01-11T00:00:00-05:00\", \"id\"=>\"6210499\"}], \"coupon\"=>true, \"pdf_image\"=>\"https://f.wishabi.net/page_pdf_images/17473736/c3485566-a5fc-11ee-a3d5-0efae983d694/original\", \"pdf_image_x_large\"=>\"https://f.wishabi.net/page_pdf_images/17473736/c3485566-a5fc-11ee-a3d5-0efae983d694/x_large\", \"cutout_image\"=>\"page_items/321123606/1703821465/extra_large.jpg\", \"external_image\"=>nil, \"external_image_extra_large\"=>nil, \"secondary_id\"=>\"auto-8725acf1-321123606\", \"flyers_positions\"=>[{\"flyer_id\"=>\"6210689.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210690.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210691.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210692.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210693.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210694.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210697.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210698.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210699.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210700.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210701.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210702.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210703.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210704.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210705.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210706.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210707.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210708.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210709.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210710.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210711.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210713.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210714.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210715.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210712.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210716.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210717.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210728.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210731.0\", \"position\"=>\"first\"}, {\"flyer_id\"=>\"6210499.0\", \"position\"=>\"first\"}], \"page_item_ids\"=>[0.321123606e9, 0.321124252e9, 0.321124645e9], \"page_ids\"=>[0.17473736e8, 0.17473743e8, 0.17473709e8], \"search_key\"=>\"bounty paper towels or charmin bath tissue__selected varieties, bounty, 6 double or 4 triple roll or charmin, 9 mega, or 6 super mega roll pkg.\\nwithout coupon $12.99\", \"zip_codes\"=>[], \"zip_coverage\"=>0.0, \"discount\"=>nil, \"all_coupons\"=>[{\"valid_to\"=>\"2024-01-18 05:00:00.000000\", \"coupon_id\"=>2140133.0, \"valid_from\"=>\"2024-01-12 05:00:00.000000\", \"coupon_type\"=>\"AMOUNT_OFF\", \"dollars_off\"=>1.0, \"final_price\"=>10.989999771118164, \"percent_off\"=>nil, \"flyer_item_id\"=>809166472.0, \"total_savings\"=>1.0, \"promotion_text\"=>\"$1.00 OFF ONE Bounty Triple Roll 4ct, Bounty Double Roll 6ct, Charmin Ultra Soft or Ultra Strong Mega Rolls 9ct, Charmin Ultra Soft or Ultra Strong Super Mega Rolls 6ct, OR Charmin Essentials Soft or Strong Mega Roll 12ct (excludes trial/travel size)\", \"reward_quantity\"=>nil, \"qualifying_quantity\"=>nil, \"flyer_item_id_str\"=>\"809166472.0\"}], \"coverage_codes\"=>{\"codes\"=>[], \"coverage\"=>{\"percent\"=>0.0}}, \"country\"=>\"US\", \"ttl\"=>1706849999.0, \"coverage\"=>{:covered_flyers=>\"30\", :all_flyers=>\"246\", :percent=>\"12.195121951219512\"}, \"campaign_name\"=>\"Test\", \"tracking_url\"=>nil, \"base_url\"=>nil, \"dynamic_params\"=>{:store_code=>nil, :flyer_run_id=>nil, :division_id=>nil, :page=>nil}, \"static_params\"=>[], \"page_item_id\"=>321123606, \"campaign_id\"=>\"auto-7c405a2f\", \"qc\"=>false, \"tagged\"=>false, \"content_id\"=>\"8725acf1\", \"final_image_url\"=>\"https://f.wishabi.net/page_pdf_images/17473736/c3485566-a5fc-11ee-a3d5-0efae983d694/original\", \"final_image_url_x_large\"=>\"https://f.wishabi.net/page_pdf_images/17473736/c3485566-a5fc-11ee-a3d5-0efae983d694/x_large\", \"square_image\"=>nil, \"sync_date\"=>\"2024-01-17T07:28:42-05:00\", \"priority\"=>\"0\", \"top\"=>0.0, \"right\"=>0.0, \"bottom\"=>0.0, \"left\"=>0.0, \"external_images\"=>{:extra_large=>nil, :large=>nil, :medium=>nil, :small=>nil}, \"cutout_images\"=>{:spotlight_small=>nil, :standard=>nil, :extra_large=>nil, :large=>nil, :plus_large=>nil, :spotlight_large=>nil, :spotlight_large_260x121=>nil, :spotlight_medium=>nil, :spotlight_xlarge_600x280=>nil}, \"pdf_images\"=>{:large=>nil, :medium=>nil, :original=>nil, :small=>nil, :tiny=>nil, :x_large=>nil}, \"coupon_info\"=>{\"valid_to\"=>\"2024-01-18 05:00:00.000000\", \"coupon_id\"=>2140133.0, \"valid_from\"=>\"2024-01-12 05:00:00.000000\", \"coupon_type\"=>\"AMOUNT_OFF\", \"dollars_off\"=>1.0, \"final_price\"=>10.989999771118164, \"percent_off\"=>nil, \"flyer_item_id\"=>809166472.0, \"total_savings\"=>1.0, \"promotion_text\"=>\"$1.00 OFF ONE Bounty Triple Roll 4ct, Bounty Double Roll 6ct, Charmin Ultra Soft or Ultra Strong Mega Rolls 9ct, Charmin Ultra Soft or Ultra Strong Super Mega Rolls 6ct, OR Charmin Essentials Soft or Strong Mega Roll 12ct (excludes trial/travel size)\", \"reward_quantity\"=>nil, \"qualifying_quantity\"=>nil, \"flyer_item_id_str\"=>\"809166472.0\"}, \"store_info\"=>[], \"all_market\"=>false}"

Gemfile.lock

Ruby 3.2
Rails 7
flipp-ruby-kafka (2.6.0)
deimos-ruby (1.23.0)
@dorner
Copy link
Member

dorner commented Jan 18, 2024

@mherasymiv-blackbird that's a really huge leap - 1.3.0 is more than four years old. I might need to see the Avro schema you're using to figure out what's going on. In the meantime, do you think you can try a binary version search to pinpoint what version this started breaking?

@mherasymiv-blackbird
Copy link
Author

@dorner
Copy link
Member

dorner commented Jan 18, 2024

@mherasymiv-blackbird hence "binary search" :) You go halfway between the version that works and the one that doesn't. If it works, you go halfway in the second half, and if it doesn't, you go halfway in the first half, till you get to the one where the breakage was introduced.

@mherasymiv-blackbird
Copy link
Author

@dorner yep yep, I'll try to check more.

@dorner
Copy link
Member

dorner commented Jan 18, 2024

From what I can tell it looks like you're passing a hash key for one of these records that doesn't exist in the actual schema. Maybe 1.3.0 let it pass, but newer versions do more validation. The schema is enormous, so I wouldn't be able to tell just by looking. If you run the code with a debugger and put a conditional breakpoint on that line (if field.nil?) you should be able to tell which field / name it's looking for and failing.

@mherasymiv-blackbird
Copy link
Author

@dorner you were right. Undefined method 'type' for nil:NilClass error occured for case when record key didn't exist in the actual schema. Seems your suggestion that old versions would let it pass, but newer versions have more validation is true. I fixed it by updating the schema to actual payload sent, but I have also created PR to update deimos lib and add error raising with appropriate message as the current behavior is not obvious at all and can be difficult to debug.
#211
Can you please review once you have a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants