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

YAML(786) Unable to load schema #694

Open
1 of 4 tasks
kaysond opened this issue Feb 10, 2022 · 29 comments
Open
1 of 4 tasks

YAML(786) Unable to load schema #694

kaysond opened this issue Feb 10, 2022 · 29 comments
Labels

Comments

@kaysond
Copy link

kaysond commented Feb 10, 2022

Describe the bug

I'm getting the following "Problem" on a yaml file.
Unable to load schema from 'https://www.graphql-code-generator.com/config.schema.json': Request vscode/content failed unexpectedly without providing any details.
This is loaded from the default catalog, and I'm able to access the schema via browser and using curl within the vscode terminal. Please let me know how I can help debug.

Expected Behavior

Schema is downloaded without problem

Current Behavior

Schema isn't loaded

Steps to Reproduce

  1. Create a file called codegen.yaml
  2. Type anything

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@evidolob
Copy link
Collaborator

@kaysond Do you have any VPN/proxy on your laptop?
And make sure that you can access to https://www.graphql-code-generator.com/config.schema.json

@kaysond
Copy link
Author

kaysond commented Feb 11, 2022

@evidolob I do have a VPN, but it happens even when the VPN is disconnected. I am able to access the URL.

@evidolob evidolob added the bug label Feb 11, 2022
@kaysond
Copy link
Author

kaysond commented Feb 11, 2022

Interestingly, I'm not seeing any http requests in the vscode dev tools (not sure if extension requests show up there or not...)

@thomasjo
Copy link

I'm experiencing the same issue, but for a different schema;

Unable to load schema from 'https://goreleaser.com/static/schema.json': Request vscode/content failed unexpectedly without providing any details.YAML(768)

I'm able to access the URL just fine using curl (and with web browsers). I'm not behind a proxy.

Version: 1.64.2
Commit: f80445acd5a3dadef24aa209168452a3d97cc326
Date: 2022-02-09T22:02:29.527Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.16.8-200.fc35.x86_64

@kaysond
Copy link
Author

kaysond commented Feb 22, 2022

@evidolob is it possible to make the extension log the http return code when this fails?

@evidolob
Copy link
Collaborator

@kaysond Yes, it is possible

@evidolob evidolob added this to the 1.6.0 milestone Mar 1, 2022
@gorkem gorkem removed this from the 1.6.0 milestone Apr 23, 2022
@OutOfFocus4
Copy link

I am experiencing this issue, too.

Unable to load schema from 'https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json': Request vscode/content failed unexpectedly without providing any details. YAML(768)

I can access the schema using curl:

$ curl -I https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json
HTTP/2 200 
date: Tue, 26 Apr 2022 12:07:35 GMT
content-type: text/plain; charset=utf-8
content-length: 57802
cache-control: max-age=60, public
content-disposition: inline
etag: W/"7564abcf92c34d51f345019f8b483695"
permissions-policy: interest-cohort=()
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
x-download-options: noopen
x-frame-options: SAMEORIGIN
x-permitted-cross-domain-policies: none
x-request-id: 01G1JW92GB6ARNVBC96MQTCF7K
x-runtime: 0.064061
x-ua-compatible: IE=edge
x-xss-protection: 1; mode=block
gitlab-lb: fe-08-lb-gprd
gitlab-sv: gke-cny-web
cf-cache-status: HIT
age: 35
accept-ranges: bytes
expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=U5i%2BSjoU5LWKNPOz52qL1XaXLXfrOLjcBEifNlTrlNxqNG%2BCZeIsaKzhgdo7XN3q6JFcoMqg6scrfEVdaashlUB7lf5AEJ9tIEp1lXrJynoMv83M0rAH4kKiGFw%3D"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}
strict-transport-security: max-age=31536000
server: cloudflare
cf-ray: 701f32f11dbf197c-EWR

I am using version 1.7.0 of the extension.

Visual Studio Code Info:

Version: 1.66.2 (Universal)
Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977
Date: 2022-04-11T07:49:20.994Z
Electron: 17.2.0
Chromium: 98.0.4758.109
Node.js: 16.13.0
V8: 9.8.177.11-electron.0
OS: Darwin x64 21.4.0

@Araxeus
Copy link

Araxeus commented May 6, 2022

I suddenly have the same error on all files, and like others I can access it manually just fine

Unable to load schema from 'https://json.schemastore.org/github-workflow': Request vscode/content failed unexpectedly without providing any details.

@Vivapercuore
Copy link

same error
I fix it by:

  • access it manually on browser
  • reload IDE window
  • done

@diskmanti
Copy link

Hello @Vivapercuore ,

I am facing the same issue, can you please explain what do you mean by: access it manually on browser ?

Thank you

@dkirrane
Copy link

dkirrane commented Jun 8, 2022

I don't know if this is related but I see the following warning in Logs (Extension Host)

[2022-06-08 11:44:10.729] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.

image

No issue accessing https://json.schemastore.org/github-workflow.json from my browser.

@diskmanti
Copy link

Hello @dkirrane

I encounter the same issue when I am behind the company proxy, even though I have setup the http.proxy config etc

@dkirrane
Copy link

dkirrane commented Jun 8, 2022

Yip error disappears when I disable proxy on startup code --no-proxy-server

@graham2071
Copy link

All schemas fail to load with the following environment:

Version: 1.68.1 (user setup)
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-14T12:48:58.283Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.22000

The extension v1.8.0 is running on WSL Ubuntu-22.04.

I use a VPN. Schemas can be downloaded with browser on Windows and wget on WSL.

@aj-stein-nist
Copy link

Yip error disappears when I disable proxy on startup code --no-proxy-server

Same. It does seem an org proxy rollout maybe be the culprit, but I am not sure how with VS Code and the WSL Remote plugin ...

@shushenghong
Copy link

open vpn and test in browser, make sure you can access the url, then reopen vscode

@Blackclaws
Copy link

This issue happens to me as well with the gitlab ci schema. Access works fine in the browser and on command line. VSCode fails without even trying to perform a network access.

@Blackclaws
Copy link

Ok, so I figured out the issue. The problem has to do with routing. In the specific case I had a route added that falsely routed traffic to the specific ip range that the server hosting the schema in question to a dummy interface ( a mixup of /8 vs /16 subnets ). That was very subtle to debug, and I still don't understand why the browser was able to resolve it fine while Vscode and some other IDEs could not. The fact that other IDEs also failed is what finally clued me in that something else must be wrong.

So I would not discount that this is in fact purely a network issue in your case as well albeit it might be a subtle one.

@JacekArdanowski
Copy link

For those who face this issue and are behind corporate vpn and try to host JSON schemas internally:
check if this error disappears when removing TLS. In my case I got rid of https in favour of http and it somehow worked... So my conclusion is that there might be a problem with certificates.

@Ikpambese
Copy link

same error I fix it by:

  • access it manually on browser
  • reload IDE window
  • done

this worked for me however am not still sure where this is from

@kamorrissey
Copy link

How do I reload the IDE window?

@kaysond
Copy link
Author

kaysond commented Apr 4, 2023

How do I reload the IDE window?

ctrl+shift+p => developer: reload window

or just quit and restart

@yc185048
Copy link

I have encountered the same issue and share the same assumption as you. Our company utilizes Zscaler, and I have manually configured the ZScaler root and intermediate CA for Python requests, urllib libraries, as well as npm through environmental variables REQUESTS_CA_BUNDLE, SSL_CERT_FILE, and NODE_EXTRA_CA_CERTS. However, I am uncertain about the specific HTTP request library employed by the extension. To address this problem, it may be beneficial to include an option that allows users to specify the CA. This additional feature could potentially resolve the issue.

@reisman234
Copy link

I also encountered this issue for docker-compose files and I had a running VPN connection, but in split mode.

I visited the URL which could not be resolved by the extension, did a reload of the environment, but it did not solve the problem.
Now as a last hope, I downgraded the extension to 1.12.2 which solved the problem in my case.

@akbog
Copy link

akbog commented Jul 31, 2023

Encountered this issue because of my Web Application Firewall on my AWS Coudfront distribution. There is a rule configured by default: "name": "awswaf:managed:aws:core-rule-set:NoUserAgent_Header, which blocks requests that don't include a User-Agent header.

Added a custome route that allows requests to pass through for jsonschema files.

@HuprichT
Copy link

HuprichT commented May 4, 2024

Hi, is there a solution to this so far? Experience same error message, no Proxy, no VPN. Workaround with open it manually and refresh didn't work

@yash-phoenix79
Copy link

same error I fix it by:

  • access it manually on browser
  • reload IDE window
  • done

This really works, I'm curious on how it works

@lipanpan-hub
Copy link

same error I fix it by:

  • access it manually on browser
  • reload IDE window
  • done

work for me

@Peyoz
Copy link

Peyoz commented Jul 29, 2024

I have encountered the same issue and share the same assumption as you. Our company utilizes Zscaler, and I have manually configured the ZScaler root and intermediate CA for Python requests, urllib libraries, as well as npm through environmental variables REQUESTS_CA_BUNDLE, SSL_CERT_FILE, and NODE_EXTRA_CA_CERTS. However, I am uncertain about the specific HTTP request library employed by the extension. To address this problem, it may be beneficial to include an option that allows users to specify the CA. This additional feature could potentially resolve the issue.

Same here, our company uses a different product but the result is that the tls certificate is rewritten.
Adding some settings to specify a custom CA can solve the issue.

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

No branches or pull requests