{"id":84769,"date":"2018-08-16T13:34:17","date_gmt":"2018-08-16T20:34:17","guid":{"rendered":"https:\/\/www.backblaze.com\/blog\/?p=84769"},"modified":"2019-04-07T10:44:53","modified_gmt":"2019-04-07T17:44:53","slug":"b2-503-500-server-error","status":"publish","type":"post","link":"https:\/\/www.backblaze.com\/blog\/b2-503-500-server-error\/","title":{"rendered":"What To Do When You Get a B2 503 (or 500) Server Error"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-84801 size-full\" title=\"What to Do When You Get a B2 503 or 500 Server Error\" src=\"https:\/\/www.backblaze.com\/blog\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg\" alt=\"Backblaze logo\" width=\"1440\" height=\"820\" srcset=\"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg 1440w, https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background-300x171.jpg 300w, https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background-1024x583.jpg 1024w, https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background-768x437.jpg 768w, https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background-560x319.jpg 560w, https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background-220x124.jpg 220w\" sizes=\"auto, (max-width: 1440px) 100vw, 1440px\" \/><br \/>\nJust try again &#8212; it\u2019s free, easy, and will work.<\/p>\n<p>Seriously, that\u2019s it. Occasionally, I\u2019ll see questions that amount to, \u201cI\u2019m getting a 503 error; does that mean B2 is down?\u201d To address that question, I wanted to take today\u2019s post to go into a bit more detail on how to handle a 500 or 503 error. The short answer is no. B2 is not down. It simply means that B2 is functioning as designed as the most <a href=\"https:\/\/www.backblaze.com\/cloud-storage\" target=\"_blank\" rel=\"noopener noreferrer\">affordable, easy to use cloud storage service<\/a> on the planet.<\/p>\n<p>As we\u2019ve described in our <a href=\"https:\/\/www.backblaze.com\/b2\/docs\/integration_checklist.html\" target=\"_blank\" rel=\"noopener noreferrer\">developer docs<\/a>, the best decision is to write your integration in a way that it retries in the event of a 500 or 503. This modest amount of upfront work will result in a stable and transparent long term experience.<\/p>\n<h3 class=\"b3\">The Backblaze Contract Architecture<\/h3>\n<p>To understand the vast majority of B2 500 and 503 errors, it\u2019s helpful to go into the \u201ccontract architecture\u201d for B2. To create a service that is fully scalable at incredibly low cost, Backblaze has had to innovate in a number of areas. One way is what we refer to as \u201ccontract architecture.\u201d It\u2019s the approach that let us cut a large expense in traditional cloud storage infrastructure &#8212; high bandwidth load balancers for uploads.<\/p>\n<p>Here\u2019s how it works: when a client wants to push data to Backblaze, it contacts a &#8220;dispatching server.&#8221; That dispatching server figures out where there data will ultimately live inside a given Backblaze data center.<\/p>\n<p>The dispatching server tells the client &#8220;there is space over on vault-9015.<\/p>\n<p>Armed with that information (and an auth token), the client ends its connection with the dispatching server and creates a brand new request directly to vault-9015. The &#8220;contract\u201d concept is not novel: ultimately, all APIs are contracts between two entities (machines). In the B2 case, our design leverages that insight as the client and vault negotiate how they will work together. In this example, once authenticated, the client continues to transmit to vault-9015 until it\u2019s done or the vault fills up (or happens to go offline). In those instances, all the client has to do is return to the dispatching server to get information for the next available vault. This is a relatively trivial step and can be easily handled at the software level.<\/p>\n<h2 class=\"b2\">What Causes a B2 500 or 503 Error Response?<\/h2>\n<p>The client knows when to go back to the dispatching server because it receives (wait for it) a 500 or 503 error from vault-9015. The system is designed to send a firm message that says, in effect, \u201cstop uploading to vault-9015.&#8221; We documented the specifics of what happens where in the <a href=\"https:\/\/www.backblaze.com\/b2\/docs\/integration_checklist.html\" target=\"_blank\" rel=\"noopener noreferrer\">B2 error handling protocols<\/a>. The bottom line is an error in the 500 block should be interpreted by the client as the signal to GO BACK to the dispatching server and ask for a new vault for uploads. Rinse and repeat. It\u2019s a free process that causes negligible incremental overhead and no charges to the customer. Unlike other services, B2 uploads and upload transactions are free.<\/p>\n<p>What if, after getting a 503 and asking the dispatch server for a new URL, you try to upload and get ANOTHER 503 from the new vault? To address this unusual case, write your software to pause for a few seconds, then go back to the dispatch server. In this scenario, the user has hit a statistically unusual situation where the user was told to go to a vault with very little space left and somebody else got there and filled up that space. The second 503 is a sign the system is functioning as designed. Your program can elegantly handle it by going back to the dispatch server.<\/p>\n<p>Other services, notably, Amazon S3, provide the client with a \u201cwell known URL.\u201d The client can merrily push data to the URL and Amazon handles load balancing and finding open storage space after receiving the data. That\u2019s a totally valid approach, but objectively more expensive as it involves high bandwidth load balancers. There are other interesting implications to the load balancing scenario. If you\u2019re interested, I wrote a <a href=\"\/blog\/design-thinking-b2-apis-the-hidden-costs-of-s3-compatibility\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog post<\/a> on the difference between the two approaches.<\/p>\n<p>As I discussed in that post, the contract architecture does introduce some complexity when the client has to go back to the dispatching server. But, for that modest amount of error handling upfront, we help fuel Backblaze B2 as an infinitely scalable, fully sustainable service that has and will continue to be the affordability leader in the object storage market.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let&#8217;s look at the process.<\/p>\n","protected":false},"author":8,"featured_media":84801,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[131],"tags":[291,373],"class_list":["post-84769","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-backblaze-bits","tag-b2","tag-developer","entry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Why You Are Getting a B2 503 or 500 Server Error and What to Do Next<\/title>\n<meta name=\"description\" content=\"If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let&#039;s look at the process.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.backblaze.com\/blog\/b2-503-500-server-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why You Are Getting a B2 503 or 500 Server Error and What to Do Next\" \/>\n<meta property=\"og:description\" content=\"If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let&#039;s look at the process.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/\" \/>\n<meta property=\"og:site_name\" content=\"Backblaze Blog | Cloud Storage &amp; Cloud Backup\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/backblaze\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-16T20:34:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-07T17:44:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1440\" \/>\n\t<meta property=\"og:image:height\" content=\"820\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Brian Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@brianwski\" \/>\n<meta name=\"twitter:site\" content=\"@backblaze\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brian Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Why You Are Getting a B2 503 or 500 Server Error and What to Do Next","description":"If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let's look at the process.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.backblaze.com\/blog\/b2-503-500-server-error\/","og_locale":"en_US","og_type":"article","og_title":"Why You Are Getting a B2 503 or 500 Server Error and What to Do Next","og_description":"If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let's look at the process.","og_url":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/","og_site_name":"Backblaze Blog | Cloud Storage &amp; Cloud Backup","article_publisher":"https:\/\/www.facebook.com\/backblaze","article_published_time":"2018-08-16T20:34:17+00:00","article_modified_time":"2019-04-07T17:44:53+00:00","og_image":[{"width":1440,"height":820,"url":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","type":"image\/jpeg"}],"author":"Brian Wilson","twitter_card":"summary_large_image","twitter_creator":"@brianwski","twitter_site":"@backblaze","twitter_misc":{"Written by":"Brian Wilson","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#article","isPartOf":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/"},"author":{"name":"Brian Wilson","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#\/schema\/person\/aba7cf9500053a387aedc001281ceaca"},"headline":"What To Do When You Get a B2 503 (or 500) Server Error","datePublished":"2018-08-16T20:34:17+00:00","dateModified":"2019-04-07T17:44:53+00:00","mainEntityOfPage":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/"},"wordCount":764,"commentCount":2,"publisher":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#organization"},"image":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#primaryimage"},"thumbnailUrl":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","keywords":["B2","Developer"],"articleSection":["Backblaze Bits"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/","url":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/","name":"Why You Are Getting a B2 503 or 500 Server Error and What to Do Next","isPartOf":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#primaryimage"},"image":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#primaryimage"},"thumbnailUrl":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","datePublished":"2018-08-16T20:34:17+00:00","dateModified":"2019-04-07T17:44:53+00:00","description":"If you get a 503 or 500 server error it does not mean that the B2 service is down. It simply means that B2 is functioning as designed. Let's look at the process.","breadcrumb":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#primaryimage","url":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","contentUrl":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","width":1440,"height":820},{"@type":"BreadcrumbList","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/b2-503-500-server-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What To Do When You Get a B2 503 (or 500) Server Error"}]},{"@type":"WebSite","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#website","url":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/","name":"Backblaze Cloud Solutions Blog","description":"Cloud Storage &amp; Cloud Backup","publisher":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#organization","name":"Backblaze","url":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.backblaze.com\/blog\/wp-content\/uploads\/2017\/12\/backblaze_icon_transparent.png?fit=512%2C512&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.backblaze.com\/blog\/wp-content\/uploads\/2017\/12\/backblaze_icon_transparent.png?fit=512%2C512&ssl=1","width":512,"height":512,"caption":"Backblaze"},"image":{"@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/backblaze","https:\/\/x.com\/backblaze","https:\/\/www.youtube.com\/user\/Backblaze","https:\/\/en.wikipedia.org\/wiki\/Backblaze"]},{"@type":"Person","@id":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/#\/schema\/person\/aba7cf9500053a387aedc001281ceaca","name":"Brian Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a577f5043f0e3f7d7747611d28ccbccf568c496fd60687ed31fe555636b72880?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a577f5043f0e3f7d7747611d28ccbccf568c496fd60687ed31fe555636b72880?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a577f5043f0e3f7d7747611d28ccbccf568c496fd60687ed31fe555636b72880?s=96&d=blank&r=g","caption":"Brian Wilson"},"description":"I completed my undergraduate at Oregon State University in 1990, then completed a Stanford Masters degree in 1991. Ever since then I've worked at various companies as a software engineer, in the last few years starting my own software startups called MailFrontier (started in 2002) and most recently Backblaze (started in 2007). I have a personal web site at http:\/\/www.ski-epic.com that I started in 1999 (it was originally just for one vacation, but it kept growing) where I put up my vacation pictures and videos. Nothing professional, it's all just for fun. In my spare time I enjoy skiing, motorcycling, and boating. I have been lucky enough to travel to a few countries, and I enjoy scouting out new places for the first time. Follow Brian on: Twitter: @brianwski YouTube: brianwski LinkedIn: brianwski Reddit: brianwski","sameAs":["http:\/\/www.ski-epic.com","https:\/\/x.com\/brianwski"],"url":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/author\/brianw\/"}]}},"jetpack_featured_media_url":"https:\/\/backblazeprod.wpenginepowered.com\/wp-content\/uploads\/2018\/08\/red-cloud-black-background.jpg","_links":{"self":[{"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/posts\/84769","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/comments?post=84769"}],"version-history":[{"count":0,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/posts\/84769\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/media\/84801"}],"wp:attachment":[{"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/media?parent=84769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/categories?post=84769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/backblazeprod.wpenginepowered.com\/blog\/wp-json\/wp\/v2\/tags?post=84769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}