123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Web-Hosting >> View Article

R2 Down Too!? (r2d2) 200s And 0 Byte Responses!

Profile Picture
By Author: Cole Arendt
Total Articles: 3
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

"Is this my phone or the site? Lol"

"Same is happening on my phone."

Thus it begins! An outage on 1/10/2024 at 5pm. Somebody (me) shipped some code and left for the day

Code named: R2 Down Too! (Get it... R2D2?)

Why we use R2

Cloudflare R2 is a fantastic service that Cloudflare provides. It is classic blob storage, has an S3 compatible API, and no egress fees!! Their tooling does have some shortcomings, but you can use S3 tooling like `aws s3 sync` to get around that.

Pricing is overall quite reasonable and the integration with Workers is superb (more on Workers later). Moreover, they are private by default and easy to turn into a CDN via attaching a "Custom Domain" that makes item access (but not bucket list access) public.

The Outage

When my colleagues opened the site, _all static resources_ were not showing up. I immediately figured I was the problem... but I had not made any changes lately, and no network calls were returning 404s. What is going ...
... on?

curl -i cdn.btst.io/test.html
HTTP/1.1 200 OK
Date: Thu, 11 Jan 2024 03:01:22 GMT
Content-Length: 0
Connection: keep-alive
Access-Control-Allow-Origin: *
Vary: Origin
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Content-Type, Vary, Origin, Referer, User-Agent, Authorization
Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, PATCH, HEAD
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ioFpioSLw6%2B4yTuBiRiId5XFaKbmupwDEngFurqI00Psx6r77PrA68uWDly8vNZSbBuqTfIZpRsTaoOZttQMCoqP0REN3ytXbH4w1KKsckwtB791dE8qq3QuQ6Z0PGg%3D"}],"group":"cf-nel","max_age":604800}
NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Server: cloudflare
CF-RAY: 8439ea2cc8ed5ca1-RDU
alt-svc: h3=":443"; ma=86400

Cloudflare was returning 200 responses with fully-open CORS and 0 bytes! "Yep! We found your file! Here it is!..." Nothing.

It was doing this for files that exist _and_ for files that did not. So clearly some simple little "hello-world service" is intercepting requests for my CDN. But no images or other static files on our website will load.

The Fix

I immediately hopped onto CloudFlare's Discord server and started searching for threads. Nobody else is having issues? Status is 100% OK? What is going on?

So I wrote up the issue and posted it. Let's see what happens...

But wait! What about my other site that uses a worker as an intermediary to fetch content from its R2 bucket? It is working great!

To mitigate downtime while waiting for a response (now at 11pm at night), I quickly copied the fetching worker, tweaked a few parameters in its `wrangler.toml` (which bucket it is attached to and the name of the worker) and deployed it.

Uploaded cms-download (0.99 sec)
Published cms-download (3.69 sec)

Less than 5 seconds and we are now serving files from the bucket again! But at the wrong DNS... I really do not want to make code changes to the site.

So a few tweaks to the DNS are incoming...

Remove the DNS from the R2 Bucket
Set up the DNS Trigger for the new Worker
Set up a route for the Worker

And voila! We are back up!


I love using Cloudflare's service because of the high quality products and amazing developer experience that they provide. I was able to self-resolve this issue extremely quickly once I noticed the path to resolution.

Unfortunately, the jury is still out on _why_ we had the issue in the first place. I'm hoping that they can help me trace down the problem. I created an alternate domain (cdn2.btst.io) that is still presenting the issue presently.

Sometimes you've just gotta roll with the punches when R2D2 isn't cooperating!

Need some help managing your site or your tech stack? Give me a call! I would love to help.

More About the Author

Software engineer and entrepreneur helping folks level up in tech and build their web presence. Supporting small businesses through Benetist

Total Views: 46Word Count: 533See All articles From Author

Add Comment

Web Hosting Articles

1. Unlocking Digital Potential: The Rewards Of Professional Website Development Service Engagement
Author: By Mass Technologies LCC

2. The Best Choice For Your Website: Affordable Web Hosting Solutions In India
Author: Mohit

3. Elevate Your Online Presence With Professional Website Maintenance Services In India
Author: Web Rank

4. Navigating The Digital Realm: Wordpress And Reseller Hosting In Nepal
Author: himalayanhost

5. Empowering Online Presence: The Dynamics Of Web Hosting And Domain Registration In Nepal
Author: himalayanhost

6. Build Your Business Around Customer Centric Solutions!
Author: Liam Mackie

7. All About Web Hosting
Author: VIV DAS

8. What Is Domain Names And Web Hosting (guide)
Author: Hamza Ali

9. Empowering Digital Entrepreneurs: Wordpress Hosting And Reseller Hosting In Nepal
Author: himalayanhost

10. Navigating Nepal's Digital Frontier: The Vital Role Of Web Hosting And Domain Registration
Author: himalayanhost

11. How Can You Up Your Game As A Web Development Company In Newcastle?
Author: Liam Mackie

12. Understanding The Difference Between Web Hosting And Web Servers
Author: Malik Rizwan

13. Choosing The Right Iot App Development Company: A Comprehensive Guide Introduction In The Rapidly Evolving Landscape Of Technology, The Internet Of T
Author: Dhwanil Patel

14. How To Choose The Right Blog Hosting Provider For Your Needs
Author: Malik Rizwan

15. Wordpress Hosting: Enhancing Your Website's Performance
Author: Hosting Home

Login To Account
Login Email:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: