vscode-yaml
vscode-yaml copied to clipboard
YAML(786) Unable to load schema
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
- Create a file called codegen.yaml
- Type anything
Environment
- [x] Windows
- [ ] Mac
- [ ] Linux
- [ ] other (please specify)
@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
@evidolob I do have a VPN, but it happens even when the VPN is disconnected. I am able to access the URL.
Interestingly, I'm not seeing any http requests in the vscode dev tools (not sure if extension requests show up there or not...)
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
@evidolob is it possible to make the extension log the http return code when this fails?
@kaysond Yes, it is possible
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
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.
same error I fix it by:
- access it manually on browser
- reload IDE window
- done
Hello @Vivapercuore ,
I am facing the same issue, can you please explain what do you mean by: access it manually on browser ?
Thank you
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.
No issue accessing https://json.schemastore.org/github-workflow.json from my browser.
Hello @dkirrane
I encounter the same issue when I am behind the company proxy, even though I have setup the http.proxy config etc
Yip error disappears when I disable proxy on startup code --no-proxy-server
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.
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 ...
open vpn and test in browser, make sure you can access the url, then reopen vscode
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.
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.
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.
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
How do I reload the IDE window?
How do I reload the IDE window?
ctrl+shift+p => developer: reload window
or just quit and restart
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.
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.
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.