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

`project init` fails after trying to allocate 30Gb of memory

Open kaathewisegit opened this issue 1 year ago • 0 comments

  • EdgeDB Version: not initialized
  • EdgeDB CLI Version: EdgeDB CLI 5.1.0+7c5764f
  • OS Version: Alpine Linux 3.20.1, 6.6.35-0-lts, x86_64

When I try to initialize a new project with edgedb (installed via the curl-shell installer), it fails. There are two errors: a vector allocation panic or a plain allocation error:

~/project/edgy-forum> edgedb project init
...
┌────────────────────────┬─────────────────────────────────────────────────┐
│ Project directory      │ /home/kaathewise/project/edgy-forum             │
│ Project config         │ /home/kaathewise/project/edgy-forum/edgedb.toml │
│ Schema dir (non-empty) │ /home/kaathewise/project/edgy-forum/dbschema    │
│ Installation method    │ portable package                                │
│ Version                │ 5.4+867a505                                     │
│ Instance name          │ edgy_forum                                      │
│ Branch                 │ trunk                                           │
└────────────────────────┴─────────────────────────────────────────────────┘
Version 5.4+867a505 is already downloaded
Initializing EdgeDB instance...
[edgedb] thread 'main' panicked at library/alloc/src/raw_vec.rs:571:5:
[edgedb] capacity overflow
[edgedb] note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[edgedb] stack backtrace:
edgedb error: cannot bootstrap EdgeDB instance: bootstrap failed: exit status: 101 (command-line: Command { std: EDGEDB_SERVER_LOG_LEVEL="warn" LANG="C.UTF-8" LC_ALL="C.UTF-8" "/home/kaathewise/.local/share/edgedb/portable/5.4/bin/edgedb-server" "--bootstrap-only" "--data-dir" "/home/kaathewise/.local/share/edgedb/data/.~edgy_forum.tmp" "--runstate-dir" "/tmp/1000-runtime-dir/edgedb-edgy_forum" "--tls-cert-mode=generate_self_signed" "--jose-key-mode=generate" "--bootstrap-command" "\n            ALTER ROLE edgedb {\n                SET password_hash := \"SCRAM-SHA-256$4096:6p+Zzqq+wDa7LZMoCCN1Pg==$zyNaInMGvasbxpDF+7DSY2aLQNLw93oy84/3Cqbmzd8=:yKsGTs8NCwxEROpnxLvfrLH0jpL1ow2xOAnOTjiCHi0=\";\n            };\n            ", kill_on_drop: false })
~/project/edgy-forum> edgedb project init
...
┌────────────────────────┬─────────────────────────────────────────────────┐
│ Project directory      │ /home/kaathewise/project/edgy-forum             │
│ Project config         │ /home/kaathewise/project/edgy-forum/edgedb.toml │
│ Schema dir (non-empty) │ /home/kaathewise/project/edgy-forum/dbschema    │
│ Installation method    │ portable package                                │
│ Version                │ 5.4+867a505                                     │
│ Instance name          │ edgy_forum                                      │
│ Branch                 │ main                                            │
└────────────────────────┴─────────────────────────────────────────────────┘
Version 5.4+867a505 is already downloaded
Initializing EdgeDB instance...
[edgedb] memory allocation of 48290318592 bytes failed
edgedb error: cannot bootstrap EdgeDB instance: bootstrap failed: signal: 6 (SIGABRT) (command-line: Command { std: EDGEDB_SERVER_LOG_LEVEL="warn" LANG="C.UTF-8" LC_ALL="C.UTF-8" "/home/kaathewise/.local/share/edgedb/portable/5.4/bin/edgedb-server" "--bootstrap-only" "--data-dir" "/home/kaathewise/.local/share/edgedb/data/.~edgy_forum.tmp" "--runstate-dir" "/tmp/1000-runtime-dir/edgedb-edgy_forum" "--tls-cert-mode=generate_self_signed" "--jose-key-mode=generate" "--bootstrap-command" "\n            ALTER ROLE edgedb {\n                SET password_hash := \"SCRAM-SHA-256$4096:doSmhSjXyROa6NGGxNxnwQ==$9Ox1WAyuNH3kJ36G0hCEPi8K48H+1yWXC6VaKGl/pME=:/15D2FkAZrsx1DieH0pQq/re7wh+Y8wzdocrCY2hO7k=\";\n            };\n            ", kill_on_drop: false })

As can be seen here, the CLI tries to allocate 40Gb[^mem] of memory, which causes a crash. I'm running this with full stacktraces, but that's all the output I get.

[^mem]: or almost 50, wow, that's a first. Usually it tries to allocate 25-30Gb.

kaathewisegit avatar Jun 25 '24 17:06 kaathewisegit