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

Cannot download schema using check-jsonschema #421

Open
piotrwiniarczyk-silvair opened this issue Apr 22, 2024 · 3 comments
Open

Cannot download schema using check-jsonschema #421

piotrwiniarczyk-silvair opened this issue Apr 22, 2024 · 3 comments
Labels
upstream-schema-issue An issue with a schema or schema provider

Comments

@piotrwiniarczyk-silvair

Hi

The following is not working
check-jsonschema --schemafile 'https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#' example.json Error: Unexpected Error building schema validator FailedDownloadError: got responses with status=403, retries exhausted

While the following is working (notice -L in curl):
curl -L 'https://www.bluetooth.com/specifications/specs/mesh-cdb-1-0-1-schema.json#' | check-jsonschema --schemafile - example.json

The platform is Windows 11, running "GIT bash" terminal.

@sirosen
Copy link
Member

sirosen commented Apr 29, 2024

Thanks for reporting this; I haven't had a chance to look into it in any serious way yet.

I'm not sure what's going on over at bluetooth.com, but they are serving up a 403 to GET requests made in python requests or urllib, but not to curl. This is almost definitely an issue over at the schema-provider's side, but I'm willing to poke at it a bit and see if I can do anything about it. Most likely, we need to find a point of contact for www.bluetooth.com to ask about this.

@sirosen sirosen added the upstream-schema-issue An issue with a schema or schema provider label Apr 29, 2024
@sirosen
Copy link
Member

sirosen commented Apr 29, 2024

I sent a request to their support form (which was awkward and not really an issue tracker) for now, but don't expect to hear much back.

I was able to confirm, in the course of writing up details for the upstream maintainers, that setting a dumb User-Agent like "" makes the error disappear.
I'm not eager to bulk up the CLI with an option for this, but perhaps an env var to control the user agent would be appropriate. I'll have to chew on the best way to expose this to users if (as I expect) there's no response or a bad response upstream.

@piotrwiniarczyk-silvair
Copy link
Author

Thanks for writing the bug report for the Bluetooth.com. I will also try to contact them.

The whole point with schema files is that they must be easily accessible via any http(s) client, even a very restricted one.

Per rfc723, section-5.5.3:
A user agent SHOULD send a User-Agent field in each request unless specifically configured not to do so.

Since it is "SHOULD" (RFC2119 ) this header field is recommended but not mandatory.

3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-schema-issue An issue with a schema or schema provider
Projects
None yet
Development

No branches or pull requests

2 participants