prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.28k stars 2.05k forks source link

Currency module fails with error if prebid.org cannot be resolved #1843

Closed amelzer closed 6 years ago

amelzer commented 6 years ago

Type of issue

Bug

Description

Prebid.org had some DNS issues resulting in a failure of the currency module.

screen shot 2017-11-16 at 12 04 25 screen shot 2017-11-16 at 12 05 09

This also lead to no bids being returned.

screen shot 2017-11-16 at 14 19 34

Steps to reproduce

  1. Bundle prebid with currency module and indexExchange bid adapter
  2. Fake net::ERR_NAME_NOT_RESOLVED response for GET http://currency.prebid.org/latest.json
  3. Set AdServer currency to EUR with pbjs.setConfig()
  4. Define adslot with indexExchange header bidding
  5. Open test page with ?pbjs_debug=true&pbjs_ix_debug=sandbox
  6. Log latest bids

Test page

I wan't able to create that setup in jsfiddle (seems like URL parameters get ignored) :(

Expected results

Bid response contains dummy bid from indexExchange. Dummy ad from indexExchange is shown.

Actual results

Bid response is empty. Fallback ad is shown.

Platform details

Prebid 0.33-pre with currency module and indexExchange Adapter

Other information

No problems when pbjs.setConfig({ currency: { adServerCurrency: 'EUR' } }); is removed.

bretg commented 6 years ago

Thanks @amelzer - was there a page impact, or just console error logs?

Not much we can do about the feature not working if the DNS entry can't be resolved, but we can make sure the failure is as graceful as possible.

It should be noted that the DNS issue was a regrettable one-off problem caused during the transfer of the name service from one provider to another.

amelzer commented 6 years ago

Well, it led to no bids being received at all, so the page impact would be: Prebid will not work for that side at all, regardless what currency the bids will come in.

I suggest the following: If the currency modules fails because the currency file cannot be fetched, remove bidders that have a different currency than specified in adServerCurrency. That will prevent from Prebid failing totally on that page and allow bidders with the same currency to deliver ads.

amelzer commented 6 years ago

Another method would be allowing the developer to provide a fallback themselves. This could also be combined with the above suggestion.

amelzer commented 6 years ago

Addendum: This is can also be tested with a file URL returning a 404

pbjs.setConfig({ currency: { adServerCurrency: 'EUR', conversionRateFile: 'https://httpstat.us/404' } }))

bretg commented 6 years ago

Thanks @amelzer -- we'll be able to get someone on this in January -- would welcome a community fix before then.

amelzer commented 6 years ago

@bretg I can definitely take this on as a community fix, but I'd need some support re: setup. Currently tests are not even running because they are running out of memory ^^

mkendall07 commented 6 years ago

@amelzer Suggest you make the change against the prebid-1.0 branch - tests should be more stable there.

snapwich commented 6 years ago

@amelzer I attempted to recreate the issue but it seems to be working as intended. If the currency file is down the bids that are already in the proper adServerCurrency get sent through still and work as normal, it's only the bids that are NOT in the proper adServerCurrency (and can't be converted because currency rates wasn't loaded) that are blocked.

That seems like the ideal solution. I don't think we want to submit bids that are in the improper currency.

bretg commented 6 years ago

@amelzer - how about this as an alternate solution: we offer another option on the currency config where the page can specify default rates if the currency conversion service is down. e.g.

pbjs.setConfig({
    "currency": {
       "adServerCurrency": "JPY",
       "granularityMultiplier": 108,
       "defaultRates": { "USD": { "JPY": 110.21 }}
    }
});
bretg commented 6 years ago

@snapwich has implemented the defaultRates feature. This allows pubs to set up defaults in case the currency file fails to load.