expo / vscode-expo

Expo Tools keep you productive with debugging, IntelliSense, and prebuild previews
https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools
MIT License
433 stars 11 forks source link

Expo Extension: Unable to perform cash r #67

Closed zkhalapyan closed 2 years ago

zkhalapyan commented 3 years ago

Description of the bug

When installing expo extension, getting an error that cache cannot be refreshed.

Screen Shot 2021-10-28 at 1 46 24 PM

Oops, looks like we couldn't activate the Expo manifest tools: Unable to perform cache refresh for /Users/zkhalapyan/.expo/cache/schema-43.0.0.json: Error: certificate has expired

To Reproduce

  1. Open VS Code
  2. Install Expo extension
  3. Notice warning bottom right corner

Expected behavior

What did you expect to have happened?

Actual behavior

Not sure what this means — what's broken?

Additional context

On Mac OSX

byCedric commented 2 years ago

Hi @zkhalapyan! Sorry for the late response, from what part of the world are you connecting to the internet? I've seen the "certificate expired" a few times before in other issues from Expo, but I can assure you that our certificate is still valid. So, I guess it might be related to one of the Cloudflare entrypoints in the world, but so far I couldn't find it yet.

Whenever the extension gets activated, it downloads the latest app.json specification from our servers. In this case, it tried to pull in https://exp.host/--/api/v2/project/configuration/schema/43.0.0. It's a JSON Schema that we add to the vscode JSON Schema-based IntelliSense.

byCedric commented 2 years ago

Closing due to inactivity

andrei-zgirvaci commented 2 years ago

I have the same issue, after adding the schema manually to the expected folder it stopped crashing, but this obviously isn't a long-term fix...

tgreve15 commented 2 years ago

I just received this message as well (in Australia) only since VSCode prompted me to upgrade to the later version a few minutes earlier (and I upgraded). It looks like manually downloading the schema to the expected file/folder has held off the message for now like Andrei suggested. I am experiencing some spotty internet today as well which could be related.

IgorThierry commented 2 years ago

@andrei-zgirvaci same thing here

Euclidean-Dev commented 2 years ago

Same here. I think this needs to be reopened.

byCedric commented 2 years ago

There isn't much we can do with "spotty" internet. We need to fetch the manifest from our servers to enable autocompletion. Adding a hard-coded manifest into the plugin will result in an out-of-date version, and thus incorrect autocompletion. I'm open to ideas of how to combat this.

Euclidean-Dev commented 2 years ago

There isn't much we can do with "spotty" internet. We need to fetch the manifest from our servers to enable autocompletion. Adding a hard-coded manifest into the plugin will result in an out-of-date version, and thus incorrect autocompletion. I'm open to ideas of how to combat this.

Are you sure that "spotty" internet isn't a red herring? I know how this sounds, but I do not have unreliable internet. This could well be an issue upstream with config somewhere i.e. a hosting issue.

andrei-zgirvaci commented 2 years ago

@Euclidean-Dev 💯 agree!

donni106 commented 2 years ago

in my case the schema for version 44 was missing. i have manually downloaded it from https://exp.host/--/api/v2/project/configuration/schema/44.0.0, removed the outer wrapping { "data": ... } so that it starts with { "schema": as the files of the other versions i found in the .expo/cache folder. this seems to satisfy the extension.

i do not know where the schemas for older versions came from and why the new one was missing.

Euclidean-Dev commented 2 years ago

@donni106 thanks, that did resolve it.

@byCedric It persisted to report the cert error until I manually saved the latest schema as per donni106's suggestion. As you state, the browser reports the cert is valid so I tried a few things. I could reproduce the error by renaming the v44 json file and relaunching vscode - consistently reported a cert error. I then launched vscode with with Charles running and SSL proxy enabled, only so I could be sure the request was to the same path, and unexpectedly this resulted in no error (because Charles injected it's proxy cert around the request), with the latest schema version getting pulled down to the cache folder as expected.

Some process appears to be failing the cert, suggesting the vscode extension activation request might use a different cert verification process to chrome (and other browsers presumably). Not sure where or how this happens, and cert validation still confuses me so I doubt I'd have luck trying to investigate further.

Just for the record, I am on win11 and vscode is: Version: 1.63.2 (user setup) Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2021-12-15T09:40:02.816Z Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Windows_NT x64 10.0.22000

jer-sen commented 2 years ago

@byCedric can you reopen this issue? There is in fact some activity.