edgedb / edgedb-cli

The EdgeDB CLI
https://www.edgedb.com/docs/cli/index
Apache License 2.0
167 stars 23 forks source link

Can't create instance while offline #753

Open divan opened 2 years ago

divan commented 2 years ago

It seems like it's not possible to create a new instance without active internet connection.

edgedb project init --server-instance test --non-interactive --server-version "1.4"
Found `edgedb.toml` in <redacted>
Initializing project...
Checking EdgeDB versions...
edgedb error: failed to fetch JSON at URL: https://packages.edgedb.com/archive/.jsonindexes/x86_64-apple-darwin.json: HTTP error: failed to lookup address information: nodename nor servname provided, or not known

I used to have this issue before, but was able to solve by speicfying server version explicitly in the script (--server-version "1.4" part, though it was different version naming scheme back then). Now it seems to be not working again.

Steps to Reproduce:

  1. Disconnect from internet
  2. Run edgedb project init --server-instance test --non-interactive --server-version "1.4"
tailhook commented 2 years ago

Yes. Currently, we're always trying to install the latest version.

This should be implemented by adding an --offline option and/or EDGEDB_*_OFFLINE env var. In interactive mode, we may also try and ask if user okay with using the potentially old version once we detect that JSON can't be fetched.

divan commented 2 years ago

Thanks. Yes, --offline mode would be great.

My use case is that I have a scaffolding for the apps that use EdgeDB as a database (think like rails new ..., but not rails). While working on it, I often create and drop projects. That includes creating new EdgeDB databases on my working laptop often (like dozens times per day).

Couple of days ago I had to work without an internet, and it was very frustrating not to be able to spin a new database (and the project), because of this JSON downloading attempt. I see no reason why it should be a blocker. Big red error message – fine, but not to block the whole process.