Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Layers and Metadata Badges Report HTTP 400 in Production #443

Open
lucashalbert opened this issue Oct 28, 2020 · 17 comments
Open

Docker Layers and Metadata Badges Report HTTP 400 in Production #443

lucashalbert opened this issue Oct 28, 2020 · 17 comments

Comments

@lucashalbert
Copy link
Contributor

The Docker Layers and Metadata Badges report HTTP 400 errors in production on badgen.net, but not in the development environment.

To test the dev environment, simply clone the https://github.com/badgen/badgen.net.git repo, build the master branch, and run.

Badgen.net/docker environment

image

Dev environment

image

@amio
Copy link
Member

amio commented Oct 29, 2020

Just did a check, it seems fine

@lucashalbert
Copy link
Contributor Author

This appears to only effect requests coming from the Eastern/Northeastern USA. I've VPNed to Western USA, Mexico, Canada, Germany, etc... and it works.

My assumption is that one of the Vercel edge delivery data centers (located in the Eastern US) is having problems.

@amio
Copy link
Member

amio commented Nov 3, 2020

Got a strange error while deploying to sfo region:

image

@lucashalbert
Copy link
Contributor Author

There is no secret required to query Docker layers or metadata, so I doubt that this particular problem would be contributing to the rogue 400 errors being seen in the Northeastern US. It could, however, be indicating a bigger problem in general with vercel.

@lucashalbert
Copy link
Contributor Author

lucashalbert commented Dec 7, 2020

@amio, any idea on how we can fix these 400 errors? I can try to restructure the code to see if that helps.

Here is a bit more information so that you can check the Vercel logs.

General Headers

Request URL: https://badgen.net/docker/layers/lucashalbert/curl/latest/arm/v7
Request Method: GET
Status Code: 500 
Remote Address: 76.76.21.21:443
Referrer Policy: strict-origin-when-cross-origin

Response Headers

age: 0
cache-control: public, max-age=120, s-maxage=5, stale-while-revalidate=86400
content-length: 985
content-type: image/svg+xml;charset=utf-8
date: Tue, 08 Dec 2020 12:30:17 GMT
server: Vercel
strict-transport-security: max-age=63072000
x-vercel-cache: MISS
x-vercel-id: iad1::iad1::ntdz9-1607430617630-3a021b4406ce

Request Headers

:authority: badgen.net
:method: GET
:path: /docker/layers/lucashalbert/curl/latest/arm/v7
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9
cache-control: no-cache
pragma: no-cache
sec-fetch-dest: document
sec-fetch-mode: navigate
sec-fetch-site: none
sec-fetch-user: ?1
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36

@amio
Copy link
Member

amio commented Dec 13, 2020

Couldn't reproduce it locally, but I just deployed an instance in sfo region, would you take a look? @lucashalbert
https://badgennet-n9jacaosx.vercel.app/docker

@lucashalbert
Copy link
Contributor Author

@amio, the SFO region instance loads correctly. Do you have the IAD1 region direct URL like you have for the SFO region?

@amio
Copy link
Member

amio commented Dec 19, 2020

@lucashalbert Here is the iad deployment
https://badgennet-o255hrsym.vercel.app/docker

layers and metadata is broken 🤔

@amio
Copy link
Member

amio commented Dec 19, 2020

Got some empty error logs:

image

Strange, it seems only happens on iad region with docker/layers or docker/metadata badge

@lucashalbert
Copy link
Contributor Author

Do you think redeploying to the iad region might help, or is this possibly something that Vercel would assist in troubleshooting? It seems more likely to be a problem with their infrastructure in iad than a problem with the app.

@amio
Copy link
Member

amio commented Jan 7, 2021

@styfle It looks like something wrong with iad region:

docker/layers and docker/metadata badge are broken only in iad region, for the error log:

image

Could it be some network issue with connection to upstream (https://auth.docker.io or https://registry.hub.docker.com)?

@styfle
Copy link
Member

styfle commented Jan 8, 2021

@amio That's what it sounds like. Maybe they blocked the Vercel IP in IAD for some reason? The IP address is not static so its strange to see this happening for so long.

@amio
Copy link
Member

amio commented Jan 8, 2021

@styfle I've seen same error happens on other badge occasionally:

image

but this badge seems fine while I check:
https://badgen.net/github/license/doocs/technical-books?color=green

same badge from iad region, still fine while I check:
https://badgennet-o255hrsym.vercel.app/github/license/doocs/technical-books?color=green

@styfle
Copy link
Member

styfle commented Jan 8, 2021

Perhaps the docker or github API is rate limiting if there are more people visiting from the IAD region?

@amio
Copy link
Member

amio commented Jan 10, 2021

Fair guess 👍 let me do a check

@amio
Copy link
Member

amio commented Jan 15, 2021

According to this https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting
It would be a 403 Error when it hit rate limiting on GitHub

@styfle
Copy link
Member

styfle commented Jan 15, 2021

I just realized the screenshot for your error says the request was for www.google-analytics.com, not GitHub or Docker.

You could try wrapping that in a try/catch and see if its only GA affected or other upstream APIs too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants