question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix 503 response not adding confirmation to queue to be retried

See original GitHub issue

Description

If you get a 503 response to OnCreateConfirmation the confirmation is not created and therefore is not put in the queue for retries.

Steps to Reproduce

Unsure (can you Charles Proxy to rewrite the CreateConfirmation request to return status response code 503

Actual result:

See in the logs:

[4856:775:0808/110311.405988:INFO:redeem_token.cc(169)] OnCreateConfirmation
[4856:775:0808/110311.406032:INFO:redeem_token.cc(171)] URL Request Response:
[4856:775:0808/110311.406047:INFO:redeem_token.cc(172)]   URL: https://ads-serve.brave.com/v1/confirmation/e1afb398-2be4-44b6-96fd-d55dd6e87ff3/eyJwYXlsb2FkIjoie1wiYmxpbmRlZFBheW1lbnRUb2tlblwiOlwiZEJzU2QyZWpTQ1J0R09VV3UybXd3VHY4RTFDOXdqRmZiYUx6cTBzSTlBQT1cIixcImNyZWF0aXZlSW5zdGFuY2VJZFwiOlwiNTcwMTM4ZmYtMDU1OC00MWRjLTg3ZTQtNzk4M2EzZDk0MDQzXCIsXCJwYXlsb2FkXCI6e30sXCJ0eXBlXCI6XCJjbGlja1wifSIsInNpZ25hdHVyZSI6IktUSkRTeUpJQkE5SVNtSlBWTlByendMdHR3ZXEzZkF6ZGJaUENIazFLZytmZTVrOUFKSmJRMjZvdUY4eU1iMWxEMG9QZHl1TkxuYnl2YjcxNXdJWFdnPT0iLCJ0IjoiL05WYlpSOEVCMURNSnRWWHFiOTVPVGhwdHVqcFpqVnliako3Y3k1b2hXRnUvelpKVkhURzFLYm5WSTE2Z2YrWjM2Wi9mU0RGS1haV3dtOHFJcGZuU0E9PSJ9
[4856:775:0808/110311.406063:INFO:redeem_token.cc(173)]   Response Status Code: 503
[4856:775:0808/110311.406077:INFO:redeem_token.cc(174)]   Response: 
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>503 first byte timeout</title>
  </head>
  <body>
    <h1>Error 503 first byte timeout</h1>
    <p>first byte timeout</p>
    <h3>Guru Mediation:</h3>
    <p>Details: cache-ewr18139-EWR 1565276591 2658566784</p>
    <hr>
    <p>Varnish cache server</p>
  </body>
</html>

[4856:775:0808/110311.406094:INFO:redeem_token.cc(175)]   Headers:
[4856:775:0808/110311.406106:INFO:redeem_token.cc(177)]     accept-ranges: bytes
[4856:775:0808/110311.406119:INFO:redeem_token.cc(177)]     connection: close
[4856:775:0808/110311.406131:INFO:redeem_token.cc(177)]     content-length: 449
[4856:775:0808/110311.406143:INFO:redeem_token.cc(177)]     content-type: text/html; charset=utf-8
[4856:775:0808/110311.406155:INFO:redeem_token.cc(177)]     date: Thu, 08 Aug 2019 15:03:11 GMT
[4856:775:0808/110311.406168:INFO:redeem_token.cc(177)]     retry-after: 0
[4856:775:0808/110311.406180:INFO:redeem_token.cc(177)]     server: Varnish
[4856:775:0808/110311.406192:INFO:redeem_token.cc(177)]     via: 1.1 varnish
[4856:775:0808/110311.406204:INFO:redeem_token.cc(177)]     x-cache: MISS
[4856:775:0808/110311.406216:INFO:redeem_token.cc(177)]     x-cache-hits: 0
[4856:775:0808/110311.406228:INFO:redeem_token.cc(177)]     x-served-by: cache-ewr18139-EWR
[4856:775:0808/110311.406241:ERROR:redeem_token.cc(181)] Failed to create confirmation
[4856:775:0808/110311.406260:WARNING:redeem_token.cc(429)] Failed to redeem e1afb398-2be4-44b6-96fd-d55dd6e87ff3 confirmation id with 570138ff-0558-41dc-87e4-7983a3d94043 creative instance id for click

Expected result:

no 503s, or if 503 does happen, put confirmation in failed queue for retries

Reproduces how often:

unsure

Brave version (brave://version info)

Brave 0.70.48 Chromium: 76.0.3809.100 (Official Build) nightly (64-bit)
Revision ed9d447d30203dc5069e540f05079e493fc1c132-refs/branch-heads/3809@{#990}
OS Mac OS X

Version/Channel Information:

  • Can you reproduce this issue with the current release? probably
  • Can you reproduce this issue with the beta channel? probably
  • Can you reproduce this issue with the dev channel? probably
  • Can you reproduce this issue with the nightly channel? yes

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

cc @tmancey @jsecretan

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
tmanceycommented, Aug 19, 2019

@GeetaSarvadnya This issue is not in 0.68, this issue has only been merged with nightly and dev. I have requested uplift but before this is potentially accepted we need to pass QA for nightly and dev.

0reactions
GeetaSarvadnyacommented, Sep 5, 2019

Verification passed on

Brave 0.69.123 Chromium: 76.0.3809.132 (Official Build) beta (64-bit)
Revision fd1acc410994a7a68ac25bc77513d443f3130860-refs/branch-heads/3809@{#1035}
OS Windows 10 OS Version 1803 (Build 17134.523)

(Used Charles proxy to simulate 503 Response statuses)

  • Verified that the failed confirmations generated due to Status_Response code 503 are recorded or queued in the Confirmation.json file
  • Verified that the failed confirmations View, Click, Dismiss and Landed are queued in Confirmation.json file
  • Verified that the failed confirmations queue becomes empty once retry is completed
  • Verified that the Ads panel Ads notifications received count and Estimated pending rewards BAT updated properly ( I have viewed 2 ads and both ads data updated properly after retry) image

Verified passed with

Brave 0.69.124 Chromium: 76.0.3809.132 (Official Build) (64-bit)
Revision fd1acc410994a7a68ac25bc77513d443f3130860-refs/branch-heads/3809@{#1035}
OS Mac OS X

Utilized Charles Proxy to emulate a 503 response to createConfirmation.

  • Verified that this failed onCreateConfirmation was added to the failed-confirmations queue in confirmations.json to be retried.
  • Verified for view, click, landed, and dismiss confirmation types.
  • Verified that retries continuously retried until queue was empty.
  • Verified brave://rewards Ads panel updated for applicable successful retries.

Verification passed on

Brave 0.69.124 Chromium: 76.0.3809.132 (Official Build) (64-bit)
Revision fd1acc410994a7a68ac25bc77513d443f3130860-refs/branch-heads/3809@{#1035}
OS Ubuntu 18.04 LTS

Utilized Charles Proxy to emulate a 503 response to createConfirmation.

  • Verified that this failed onCreateConfirmation was added to the failed-confirmations queue in confirmations.json to be retried.
  • Verified for view, click, landed, and dismiss confirmation types.
  • Verified that retries continuously retried until queue was empty.
  • Verified brave://rewards Ads panel updated for applicable successful retries.
Read more comments on GitHub >

github_iconTop Results From Across the Web

503 error: How to solve - SupportHost
Try reloading the page. Reloading the page is not really a solution. Since, however, the 503 error is often due to a temporary...
Read more >
How to Fix 503 Service Unavailable Error: 7 Steps That Work
7 Steps to Find Root Cause and Resolve the 503 Error: · 1. Check Resource Usage · 2. Check for Ongoing Maintenance ·...
Read more >
How to Fix the HTTP Error 503 Service Unavailable - Kinsta
The 503 error in WordPress signifies that your website can't be reached at the present moment because the server in question is unavailable....
Read more >
503 Service Unavailable - Backend Server | Apigee Edge
A backend server is overloaded/busy and cannot handle any new requests. The backend server is down for a temporary period due to maintenance....
Read more >
503 Service Unavailable Error Message: What It Is and How to ...
How to Fix the 503 Service Unavailable Error · Retry the URL from the address bar again by selecting Reload or Refresh, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found