edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Fetching https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json takes too long.

Open disjukr opened this issue 3 years ago • 7 comments

  • EdgeDB Version: 2.0-rc.3+8c42ac9
  • EdgeDB CLI Version: 1.2.3+ed95e8b
  • OS Version: Windows 11 Pro 21H2 22000.795

Steps to Reproduce:

  1. install edgedb
iwr https://ps1.edgedb.com -useb | iex
  1. run edgedb project init
$ edgedb project init
No `edgedb.toml` found in `\\?\C:\Users\me\tmp\edgedb-practice` or above
Do you want to initialize a new project? [Y/n]
> Y
Specify the name of EdgeDB instance to use with this project [default: edgedb_practice]:
> edgedb_practice
Checking EdgeDB versions...
Specify the version of EdgeDB to use with this project [default: 2.0-rc.3]:
> 2.0-rc.3
┌─────────────────────┬─────────────────────────────────────────────────┐
│ Project directory   │ \\?\C:\Users\me\tmp\edgedb-practice             │
│ Project config      │ \\?\C:\Users\me\tmp\edgedb-practice\edgedb.toml │
│ Schema dir (empty)  │ \\?\C:\Users\me\tmp\edgedb-practice\dbschema    │
│ Installation method │ WSL                                             │
│ Version             │ 2.0-rc.3+8c42ac9                                │
│ Instance name       │ edgedb_practice                                 │
└─────────────────────┴─────────────────────────────────────────────────┘
00:02:14 [====================] 167.07MiB/167.07MiB 1.25MiB/s | ETA: 0s
Unpacking WSL distribution...
Initializing WSL distribution...
Updating container's CLI version...
00:00:01 [====================] 4.47MiB/4.47MiB 3.36MiB/s | ETA: 0s
Checking certificate updates...
[apt] Preconfiguring packages ...
[apt] Selecting previously unselected package openssl.
[apt] (Reading database ... 10007 files and directories currently installed.)
[apt] Preparing to unpack .../openssl_1.1.1n-0+deb11u3_amd64.deb ...
[apt] Unpacking openssl (1.1.1n-0+deb11u3) ...
[apt] Selecting previously unselected package ca-certificates.
[apt] Preparing to unpack .../ca-certificates_20210119_all.deb ...
[apt] Unpacking ca-certificates (20210119) ...
[apt] Setting up openssl (1.1.1n-0+deb11u3) ...
[apt] Setting up ca-certificates (20210119) ...
[apt] Updating certificates in /etc/ssl/certs...
[apt] 129 added, 0 removed; done.
[apt] Processing triggers for ca-certificates (20210119) ...
[apt] Updating certificates in /etc/ssl/certs...
[apt] 0 added, 0 removed; done.
[apt] Running hooks in /etc/ca-certificates/update.d...
[apt] done.
Fetching https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json takes too long. Common reasons are:
  1. Your internet connectivity is slow
  2. Firewall blocks internet access to this resource

disjukr avatar Jul 26 '22 16:07 disjukr

I'm not sure what is the expected behavior for you.

tailhook avatar Jul 27 '22 14:07 tailhook

When I run the wget command on wsl (default Ubuntu image. I want to test it on EdgeDB.WSL.1, but it is difficult because curl or wget are not included here.) with the json of that address(https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json), I see that the file is immediately downloaded, so it doesn't seem to be an internet speed or firewall problem as mentioned in the log.

And no matter how long I wait after that message(Fetching https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json takes too long.), the project initialization does not proceed.

disjukr avatar Jul 27 '22 14:07 disjukr

Ah, right. This operation is running from the windows, not WSL. So you should adjust the firewall settings from the edgedb.exe itself. If firewall is not the issue, please try running RUST_LOG=debug edgedb project init.

tailhook avatar Jul 28 '22 10:07 tailhook

I don't use any firewall other than the feature Windows 11 has by default. And just in case, I turned off all the default firewall of Windows 11 and tested it, but the result was the same. image

$ RUST_LOG=debug edgedb project init
[2022-07-30T06:42:44Z DEBUG edgedb::cli] Options: Options {
        conn_options: ConnectionOptions {
            instance: None,
            dsn: None,
            credentials_file: None,
            host: None,
            port: None,
            unix_path: None,
            user: None,
            database: None,
            password: false,
            no_password: false,
            password_from_stdin: false,
            tls_ca_file: None,
            tls_verify_hostname: false,
            no_tls_verify_hostname: false,
            tls_security: None,
            wait_until_available: None,
            admin: false,
            connect_timeout: None,
        },
        cloud_options: CloudOptions {
            cloud_base_url: None,
            cloud_access_token: None,
        },
        subcommand: Some(
            Project(
                ProjectCommand {
                    subcommand: Init(
                        Init {
                            project_dir: None,
                            server_version: None,
                            link: false,
                            server_instance: None,
                            server_start_conf: None,
                            no_migrations: false,
                            non_interactive: false,
                            cloud: false,
                        },
                    ),
                },
            ),
        ),
        interactive: false,
        debug_print_frames: false,
        debug_print_descriptors: false,
        debug_print_codecs: false,
        output_format: None,
        no_cli_update_check: false,
    }
[2022-07-30T06:42:44Z INFO  edgedb::portable::repository] Fetching JSON at https://packages.edgedb.com/archive/.jsonindexes/x86_64-pc-windows-msvc.json
[2022-07-30T06:42:45Z WARN  edgedb::version_check] Newer version of edgedb tool exists 2.0.1+107445f (current 1.2.3+ed95e8b). To upgrade run `edgedb cli upgrade`
[2022-07-30T06:42:45Z DEBUG edgedb::version_check] Remote version Some(Semver(Version { major: 2, minor: 0, patch: 1, build: BuildMetadata("107445f") }))
Found `edgedb.toml` in \\?\C:\Users\me\tmp\edgedb-practice
Initializing project...
Specify the name of EdgeDB instance to use with this project [default: edgedb_practice]:
[2022-07-30T06:42:45Z DEBUG rustyline] ANSI colors already enabled
[2022-07-30T06:42:45Z DEBUG rustyline] Changeset::delete(0, "")
[2022-07-30T06:42:45Z DEBUG rustyline] Changeset::insert_str(0, "edgedb_practice")
[2022-07-30T06:42:45Z DEBUG rustyline] old layout: Layout { prompt_size: Position { col: 0, row: 0 }, left_margin: 0, default_prompt: false, cursor: Position { col: 0, row: 0 }, end: Position { col: 0, row: 0 }, scroll_top: 0, screen_rows: 0 }
[2022-07-30T06:42:45Z DEBUG rustyline] new layout: Layout { prompt_size: Position { col: 2, row: 0 }, left_margin: 0, default_prompt: true, cursor: Position { col: 17, row: 0 }, end: Position { col: 17, row: 0 }, scroll_top: 0, screen_rows: 30 }
> edgedb_practice[2022-07-30T06:42:55Z DEBUG rustyline] key: KeyEvent(Enter, NONE)
[2022-07-30T06:42:55Z DEBUG rustyline] Emacs command: AcceptOrInsertLine { accept_in_the_middle: true }

Checking EdgeDB versions...
[2022-07-30T06:42:55Z INFO  edgedb::portable::repository] Fetching JSON at https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-gnu.json
┌────────────────────────┬─────────────────────────────────────────────────┐
│ Project directory      │ \\?\C:\Users\me\tmp\edgedb-practice             │
│ Project config         │ \\?\C:\Users\me\tmp\edgedb-practice\edgedb.toml │
│ Schema dir (non-empty) │ \\?\C:\Users\me\tmp\edgedb-practice\dbschema    │
│ Installation method    │ WSL                                             │
│ Version                │ 2.0+710b779                                     │
│ Instance name          │ edgedb_practice                                 │
└────────────────────────┴─────────────────────────────────────────────────┘
[2022-07-30T06:42:56Z INFO  edgedb::process] Running edgedb: "wsl" "--user" "edgedb" "--distribution" "EdgeDB.WSL.1" "_EDGEDB_FROM_WINDOWS=1" "/usr/bin/edgedb" "instance" "create" "edgedb_practice" "--version" "2.0" "--port" "10700" "--default-database" "edgedb" "--default-user" "edgedb" "--non-interactive"
[2022-07-30T06:42:56Z DEBUG edgedb::process] Writing pid file None (pid: 5360)
Fetching https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json takes too long. Common reasons are:
  1. Your internet connectivity is slow
  2. Firewall blocks internet access to this resource

disjukr avatar Jul 30 '22 07:07 disjukr

It seems that a new cli version has been released, so I updated it and ran it again, but the result is same.

$ edgedb cli upgrade
00:00:01 [====================] 3.51MiB/3.51MiB 2.96MiB/s | ETA: 0s
Upgraded to version 2.0.1+107445f

$ RUST_LOG=debug edgedb project init
[2022-07-30T07:06:11Z DEBUG edgedb::cli] Options: Options {
        conn_options: ConnectionOptions {
            instance: None,
            dsn: None,
            credentials_file: None,
            host: None,
            port: None,
            unix_path: None,
            user: None,
            database: None,
            password: false,
            no_password: false,
            password_from_stdin: false,
            tls_ca_file: None,
            tls_verify_hostname: false,
            no_tls_verify_hostname: false,
            tls_security: None,
            wait_until_available: None,
            admin: false,
            connect_timeout: None,
        },
        cloud_options: CloudOptions {
            cloud_base_url: None,
            cloud_access_token: None,
        },
        subcommand: Some(
            Project(
                ProjectCommand {
                    subcommand: Init(
                        Init {
                            project_dir: None,
                            server_version: None,
                            link: false,
                            server_instance: None,
                            server_start_conf: None,
                            no_migrations: false,
                            non_interactive: false,
                            cloud: false,
                        },
                    ),
                },
            ),
        ),
        interactive: false,
        debug_print_frames: false,
        debug_print_descriptors: false,
        debug_print_codecs: false,
        output_format: None,
        no_cli_update_check: false,
    }
[2022-07-30T07:06:11Z DEBUG edgedb::version_check] Cached version Some(Semver(Version { major: 2, minor: 0, patch: 1, build: BuildMetadata("107445f") }))
Found `edgedb.toml` in \\?\C:\Users\me\tmp\edgedb-practice
Initializing project...
Specify the name of EdgeDB instance to use with this project [default: edgedb_practice]:
[2022-07-30T07:06:11Z DEBUG rustyline] ANSI colors already enabled
[2022-07-30T07:06:11Z DEBUG rustyline] Changeset::delete(0, "")
[2022-07-30T07:06:11Z DEBUG rustyline] Changeset::insert_str(0, "edgedb_practice")
[2022-07-30T07:06:11Z DEBUG rustyline] old layout: Layout { prompt_size: Position { col: 0, row: 0 }, left_margin: 0, default_prompt: false, cursor: Position { col: 0, row: 0 }, end: Position { col: 0, row: 0 }, scroll_top: 0, screen_rows: 0 }
[2022-07-30T07:06:11Z DEBUG rustyline] new layout: Layout { prompt_size: Position { col: 2, row: 0 }, left_margin: 0, default_prompt: true, cursor: Position { col: 17, row: 0 }, end: Position { col: 17, row: 0 }, scroll_top: 0, screen_rows: 45 }
> edgedb_practice[2022-07-30T07:06:12Z DEBUG rustyline] key: KeyEvent(Enter, NONE)
[2022-07-30T07:06:12Z DEBUG rustyline] Emacs command: AcceptOrInsertLine { accept_in_the_middle: true }

Checking EdgeDB versions...
[2022-07-30T07:06:12Z INFO  edgedb::portable::repository] Fetching JSON at https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-gnu.json
┌────────────────────────┬─────────────────────────────────────────────────┐
│ Project directory      │ \\?\C:\Users\me\tmp\edgedb-practice             │
│ Project config         │ \\?\C:\Users\me\tmp\edgedb-practice\edgedb.toml │
│ Schema dir (non-empty) │ \\?\C:\Users\me\tmp\edgedb-practice\dbschema    │
│ Installation method    │ WSL                                             │
│ Version                │ 2.0+710b779                                     │
│ Instance name          │ edgedb_practice                                 │
└────────────────────────┴─────────────────────────────────────────────────┘
Updating container's CLI version...
[2022-07-30T07:06:12Z INFO  edgedb::portable::repository] Fetching JSON at https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json
[2022-07-30T07:06:13Z INFO  edgedb::portable::repository] Downloading https://packages.edgedb.com/archive/x86_64-unknown-linux-musl/edgedb-cli-2.0.1+93a7fab.zst -> C:\Users\me\AppData\Local\EdgeDB\cache\downloads\edgedb.download
[2022-07-30T07:06:13Z INFO  edgedb::portable::repository] Fetching JSON at https://packages.edgedb.com/archive/x86_64-unknown-linux-musl/edgedb-cli-2.0.1+93a7fab.zst
00:00:01 [====================] 4.46MiB/4.46MiB 3.42MiB/s | ETA: 0s
[2022-07-30T07:06:19Z INFO  edgedb::process] Running check version: "wsl" "--user" "edgedb" "--distribution" "EdgeDB.WSL.1" "/usr/bin/edgedb" "--version"
[2022-07-30T07:06:19Z DEBUG edgedb::process] Writing pid file None (pid: 10244)
[2022-07-30T07:06:19Z DEBUG edgedb::process] Result of check version: exit code: 0
[2022-07-30T07:06:19Z INFO  edgedb::process] Running edgedb: "wsl" "--user" "edgedb" "--distribution" "EdgeDB.WSL.1" "_EDGEDB_FROM_WINDOWS=1" "/usr/bin/edgedb" "instance" "create" "edgedb_practice" "--version" "2.0" "--port" "10700" "--default-database" "edgedb" "--default-user" "edgedb" "--non-interactive"
[2022-07-30T07:06:19Z DEBUG edgedb::process] Writing pid file None (pid: 16740)
Fetching https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-musl.json takes too long. Common reasons are:
  1. Your internet connectivity is slow
  2. Firewall blocks internet access to this resource

disjukr avatar Jul 30 '22 07:07 disjukr

Okay, it looks like I'm mistaken and this is actually from WSL. We suspect that this might be a bug in our network stack. I'll make some updates and make better logging for this issue, and notify you. It will probably be on Wednesday. I'll notify you, hopefully you will be able to run the new nightly to test this. Thanks for the report!

tailhook avatar Aug 01 '22 17:08 tailhook

Great. Thank you!

disjukr avatar Aug 02 '22 01:08 disjukr

Oh, sorry, I've forgot to follow up on this issue. Please try nightly CLI:

curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh -s -- --nightly

tailhook avatar Sep 09 '22 15:09 tailhook

@tailhook It seems work well. Thank you!

disjukr avatar Sep 10 '22 03:09 disjukr

Oh, sorry, I've forgot to follow up on this issue. Please try nightly CLI:

curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh -s -- --nightly

can you provide a command for powershell too? Try to init a project with the provided command in powershell and in wsl but i did not work.

in case of powershell i get the following edgedb error: error installing EdgeDB: failed to fetch JSON at URL: https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-gnu.json: timed out edgedb error: edgedb failed: exit code: 1 (command-line: Command { std: "wsl" "--user" "edgedb" "--distribution" "EdgeDB.WSL.1" "_EDGEDB_FROM_WINDOWS=1" "/usr/bin/edgedb" "instance" "create" "rest_api_fasapi_edgedb" "--version" "4.7" "--port" "10700" "--default-database" "edgedb" "--default-user" "edgedb" "--non-interactive", kill_on_drop: false })

in case of wsl: edgedb error: failed to fetch JSON at URL: https://packages.edgedb.com/archive/.jsonindexes/x86_64-unknown-linux-gnu.json: timed out

firewall is off

EdgeDB CLI 4.1.1+1520d83

odinakholiqov avatar Apr 07 '24 19:04 odinakholiqov