brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.54k stars 2.27k forks source link

Follow up to #37390: Failing to Initialize ads due to corrupted confirmations.json #37589

Closed btlechowski closed 5 months ago

btlechowski commented 5 months ago

Steps to Reproduce

  1. Run Brave with corrupted confirmations.json

Actual result:

Ads fail to intialize

[10289:10289:0415/170655.091746:VERBOSE3:confirmation_state_manager.cc(40)] Loading confirmation state
[0415/170655.100381:ERROR:elf_dynamic_array_reader.h(64)] tag not found
[0415/170655.113759:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0415/170655.113870:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[10289:10289:0415/170655.120013:INFO:confirmation_state_manager.cc(60)] Failed to load confirmation state
[10289:10289:0415/170655.120013:VERBOSE3:confirmation_state_manager.cc(61)] Failed to parse confirmation state: {
[10289:10289:0415/170655.125263:INFO:ads_impl.cc(34)] Failed to initialize ads
[10289:10289:0415/170655.125568:VERBOSE1:ads_service_impl.cc(490)] Failed to initialize Bat Ads

Expected result:

Ads are initizlized

Brave version (brave://version info)

Brave 1.67.10 Chromium: 124.0.6367.29 (Official Build) nightly (64-bit)
Revision 5271b7eae5a8ec529004f4eea384c94a64c075d5
OS Linux

cc @tmancey @aseren

kjozwiak commented 5 months ago

The above requires 1.65.114 or higher for 1.65.x verification 👍

btlechowski commented 5 months ago

Verified with

Brave 1.65.114 Chromium: 124.0.6367.60 (Official Build) (64-bit)
Revision f1e2cbb65e11340d9040d5ef0b0115c7a5206207
OS Linux

Verified recovered from corrupted state

[9493:9493:0417/140554.697315:INFO:legacy_confirmation_migration.cc(64)] Confirmation state is corrupted, resetting to default values
[9493:9493:0417/140554.701844:VERBOSE1:legacy_confirmation_migration.cc(78)] Migrating confirmation state
[9493:9493:0417/140554.729667:VERBOSE9:legacy_confirmation_migration.cc(89)] Successfully saved confirmation state
[9493:9493:0417/140554.730478:VERBOSE3:confirmation_state_manager.cc(40)] Loading confirmation state
[9493:9493:0417/140554.732787:VERBOSE3:confirmation_state_manager.cc(66)] Successfully loaded confirmation state
[9493:9493:0417/140554.733083:VERBOSE1:ads_impl.cc(412)] Successfully initialized ads

Verified ads are served:

[9493:9493:0417/140821.790173:VERBOSE1:new_tab_page_ad_handler.cc(148)] Opportunity arose to serve a new tab page ad
[9493:9493:0417/140821.791004:VERBOSE1:text_classification_model.cc(78)] No text classification probabilities found for en_US.UTF-8 locale
[9493:9493:0417/140821.791062:VERBOSE1:eligible_new_tab_page_ads_v2.cc(37)] Get eligible new tab page ads
[9493:9493:0417/140821.813085:VERBOSE3:priority_util.h(21)] 1 untargeted ads with a priority of 1 in bucket 1
[9493:9493:0417/140821.813838:VERBOSE1:eligible_new_tab_page_ads_v2.cc(128)] Predicted ad with creative instance id 0aaafcc8-2c2c-45e1-bf89-9244d3c331d0 and a priority of 1
[9493:9493:0417/140821.815786:VERBOSE1:new_tab_page_ad_serving.cc(95)] Found 1 eligible ads
[9493:9493:0417/140821.816568:VERBOSE1:new_tab_page_ad_serving.cc(100)] Chosen eligible ad with creative instance id 0aaafcc8-2c2c-45e1-bf89-9244d3c331d0 and a priority of 1
[9493:9493:0417/140821.816754:VERBOSE1:new_tab_page_ad_handler.cc(169)] Served new tab page ad:
  placementId: 38ef5b5f-25d5-4fbd-ac6a-ddb2093f2a53
  creativeInstanceId: 0aaafcc8-2c2c-45e1-bf89-9244d3c331d0
  creativeSetId: b03f540a-d70a-432c-af2d-10702fa6cc7e
  campaignId: 10477b6c-eac9-4ef3-8f3b-caf4e8e83e07
  advertiserId: 803953a8-56b4-4d4b-942a-fa81357f1427
  segment: untargeted
  companyName: BMW
  imageUrl: https://mobile-data-dev.s3.brave.software/assets/ntp-si/69aa9044-d6d2-4e24-ac03-958391b2bb7a.png
  alt: BMW
  targetUrl: https://www.bmwusa.com/?brave-creative-id=0aaafcc8-2c2c-45e1-bf89-9244d3c331d0&source=image1
  wallpaper:
    imageUrl: https://mobile-data-dev.s3.brave.software/assets/ntp-si/72ba7af0-160e-4b1b-bdec-5ae0d166f7e1.jpg
    focalPoint:
      x: 756
      y: 720
[9493:9493:0417/140821.852435:VERBOSE3:new_tab_page_ad_handler.cc(176)] Served new tab page ad with placement id 38ef5b5f-25d5-4fbd-ac6a-ddb2093f2a53 and creative instance id 0aaafcc8-2c2c-45e1-bf89-9244d3c331d0